sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
54787d5a0b93c9b28693458c10627646ab95d0b3a185c13b98f255ac616fbbba | MATLAB | 2,904 | 107 | %
% Draw scatter plots.
%
% PARAMETERS
% $networks Space-separated list of networks
% $kind Kind of plot: Names of two statistics separated by a dot '.'
% $class Name of class used (corresponds to choice of networks)
%
% INPUT FILES
% Depending on the kind
%
% OUTPUT FILES
% plot/scatter.[a...].$kind.$class.eps
% p... |
56dcf3af01832f3279c320c69e874da51849f598c4c16b4f20bd6c3aeb9b093b | MATLAB | 2,904 | 65 | % mglConvertCommandResults: Convert GPU result timestamps to CPU time.
%
% usage: results = mglConvertCommandResults(results, cpuBefore, gpuBefore, cpuAfter, gpuAfter)
% by: Benjamin Heasly
% date: 01/30/2024
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Con... |
727b7f372a48e66224b4a2686e2c623dbda7f565858230a0c3045563d3f7f17d | MATLAB | 2,904 | 49 | function simple_noninteractive_flytracker(output_folder_name, input_video_file_name, input_calibration_file_name, options)
% Runs flytracker, without further user interaction, on a single video. Uses
% calibration in input_calibration_file_name, and does not modify that file.
% options argument is optional... |
9020b574fa579b06c54dc8d76990c509bd597eaf68eba6732fcc060e5ec45670 | MATLAB | 2,911 | 84 | function outputfile = inflate_file(inputfile)
% INFLATE_FILE helper function to uncompress a compressed file of arbitrary
% compression type. Returns the full path to the extracted file or
% directory, which will be located in a temporary location.
% Copyright (C) 2012 Eelke Spaak
%
% This file is part of FieldTrip, ... |
68ba2de493fcccff60a9f9f6b02115ecb44ff76e8345362c8b822a9fe0112823 | MATLAB | 2,912 | 75 | % VL_MSER Maximally Stable Extremal Regions
% R=VL_MSER(I) computes the Maximally Stable Extremal Regions (MSER)
% [1] of image I with stability threshold DELTA. I is any array of
% class UINT8. R is a vector of region seeds.
%
% A (maximally stable) extremal region is just a connected component
% of one of ... |
fa8972ee9d14810e8e122ac25dd2d2af45eb7774775a5edbdb29bc6089d57dd1 | MATLAB | 2,912 | 61 | function mltp_make_session_orientation_plot_unaligned(obj, session)
if obj.isVerbose()
fprintf('Making the session orientation plot (using unaligned coordinates).\n');
end
h = figure('name', sprintf('Session %s', session.getName()), 'Position', get(0,'Screensize'));
p = obj.... |
a69f2cbdad2c04fc28151365d0e374e67ddb95affd6e29c063d51045283b3136 | MATLAB | 2,913 | 72 | function c = DynMCNNInvProbV1Cons(x,Imat_t,dsr_t,tn,ni,nh,no,at_C_in_t,at_H_in_t,at_O_in_t,fv_in_t,V,CAf_in_t,CBf_in_t,CDf_in_t,mol_W_in_t,delta,data,t_steady)
whd = reshape(x(1:ni*nh),[ni,nh]);
wod = reshape(x(ni*nh+1:ni*nh+nh*no),[nh,no]);
wfd = reshape(x(ni*nh+nh*no+1:ni*nh+nh*no+no*nh),[no,nh]);
bhd = (x(ni*n... |
e1404c49a0a7e86ba180fc64b26920fc07f30f9cb87a5c2af12c9e7d6d7f4893 | MATLAB | 2,913 | 105 | function [X,Y] = get_classification_var(be,param,D,ds_events,d)
% INPUTS
type=param.type;
stat=param.stat;
extype=param.extype;
exthresh=param.exthresh;
b=be(1);
e=be(2);
%%
nneuron= size(D(1).data,1);
nobs=size(D(1),2);
start=100;
%%
idx =1;
if strcmp(extype,'ratio')
for tr = 1 : length(D)
rati... |
a1b4f0e105877d5eebbe706a905d50ca3d6ffdefa11377f18319b0c7021a5b32 | MATLAB | 2,914 | 93 | function plot_combination_cluster_performance(combination_results,combinations,full_ident,wave_identities,info)
% function that takes combination of many silhouette distributions and
% plots them together in a 4x4 histogram
% combinations: vector of the wavelengths used
% wave_identities: list of strings that maps... |
35cf7355470fda83a8f3e023ebb4cf8ac033ca764fea41713b34d04193dad187 | MATLAB | 2,917 | 1 | function [status, time0] = StartScan(pulseLength)
% StartScan - Starts the MR scanner by sending a pulse
% [status, time0] = StartScan(pulseLength);
% when error ocurred status will be non-zero
% time0 is the time (GetSecs) when the onset of the pulse
% started, used for syncing sti... |
98600c85e4f499109128e515eeec15b07405b7a935f28a06a2409042289943f0 | MATLAB | 2,919 | 81 | function [Rate, reversal_counts, frame_count]= ReversalRate(folders, bin_size, Tracks, frames)
%not used in paper
fps = 14;
reversal_counts = [];
allTracks = [];
relevant_fields = {'Frames','Pirouettes'};
if nargin < 1 %no folders are given, ask user to select
folders = {};
while tru... |
a02acdda6093ff7eb05fb908b732bb1b9911e7ca3647e8ac2bad167d3ea6be08 | MATLAB | 2,920 | 68 | % mglMetalProcessBatch: start processing Metal commands enqueued earlier.
%
% usage: batchInfo = mglMetalProcessBatch(batchInfo)
% by: ben heasly
% date: 01/12/2024
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Put the Mgl Metal app into its batch "processin... |
2b101205696a942edd50071f8ca62980121f7736ff6973c84e9cf1bd315616bb | MATLAB | 2,921 | 77 | function mltp_plot_movement(obj, session)
outputFolder = fullfile( session.getAnalysisDirectory(), 'trial_movement' );
if ~exist( outputFolder, 'dir')
mkdir(outputFolder)
end
% for iTrial = 1:session.getNumTrials()
% trial = session.getTrial(iTrial);
for iTrial = 1:session.getNu... |
43e70277b0899ac59d9571d43345c7a8ea9d2ef18a6a4c963934bc17660e1de2 | MATLAB | 2,922 | 107 | function [] = Fig04_SongTypeRespDiffHist_shuffle()
% Same as Fig04_SongTypeRespDiffHist.m but for trial shuffled data.
% GT = 'nsybD'; % Fig. 4e
GT = 'nsyb'; % Fig. 4g
%% parameters
% Thre_SongType = 0.001;
Thre_SongType = 0.001;
switch GT
case 'nsybD'
DataFlag_Song = [1,1,1,1,1,0,1,1,1,1];
xlimr... |
802e60cb346121261c7c512f6bcf6dae197ba918cf545dc1758878b7be07356a | MATLAB | 2,925 | 77 | function [] = remake_lists()
% directories for the old and new versions of the lists
oldListDir = 'previous_lists';
newListDir = 'new_lists';
% identifiers for the four image positions
positions = {'north', 'south', 'west', 'east'};
% experimental blocks (each with its own variant of the stimulus lists)
blockIDs = {... |
5b169a559235a659a95d2fa87b0b5f968659e4662d7bbc15b9cf9de6f18400a3 | MATLAB | 2,927 | 84 | function [EER, deltaFMR_EER, deltaFNMR_EER, zeroFMR, FMR1000] = ...
indiciStatisticiIncertezza_fromFprFnr_VLFEAT(fpr, fnr, numGenuini_test, numImpostori_test, resultTag, dbname, dirResults, plottaROCs, savefile)
tnr = 1 - fpr;
tpr = 1 - fnr;
%s = max(find(tnr > tpr));
%[EER, EERlow, EERhigh, iEER] = computeEERI... |
a6726cdd8a116daacb97b1e8bfdaf51bc81290b7d74fc6745c290719e3ebd5b9 | MATLAB | 2,927 | 56 | function H = readIBWbinheader(FFN,pos);
% readIBWbinheader - read BinHeader segment of Igor IBW file
% H = readIBWbinheader('foo') reads BinHeader of file Foo.ibw
% IBW version 2,5 only
MAXDIMS = 4;
if nargin == 1
pos=0;
end
fid = fopen(FFN,'r');
fseek(fid,pos,'bof');
H.version = fread(fid,1,'int16')... |
3d2284407ca2961fba4c4374e8e7afcc6aba1ba1064762ae52c300733df7783f | MATLAB | 2,928 | 121 | function vl_demo_aib
% VL_DEMO_AIB Test Agglomerative Information Bottleneck (AIB)
D = 4 ;
K = 20 ;
randn('state',0) ;
rand('state',0) ;
X1 = randn(2,300) ; X1(1,:) = X1(1,:) + 2 ;
X2 = randn(2,300) ; X2(1,:) = X2(1,:) - 2 ;
X3 = randn(2,300) ; X3(2,:) = X3(2,:) + 2 ;
figure(1) ; clf ; hold on ;
vl_plotframe(X... |
31d812e8e4eb2657906ae75f34e98d29b0a2abf1fb966cc43ba0a57f3b9a1ed9 | MATLAB | 2,929 | 91 | % mglGetParam.m
%
% $Id: mglGetParam.m,v 1.1 2007/10/23 22:21:23 justin Exp $
% usage: mglGetParam(paramName);
% by: justin gardner
% date: 12/30/08
% purpose: Get MGL parameters
%
% verbose = mglGetParam('verbose');
function retval = mglGetParam(paramName)
% default to returning empty
re... |
d67ad128297c34d06d7c491aad10d37b8ee3d3c402fa92dc42048b10afabafb3 | MATLAB | 2,929 | 91 | % mglGetParam.m
%
% $Id: mglGetParam.m,v 1.1 2007/10/23 22:21:23 justin Exp $
% usage: mglGetParam(paramName);
% by: justin gardner
% date: 12/30/08
% purpose: Get MGL parameters
%
% verbose = mglGetParam('verbose');
function retval = mglGetParam(paramName)
% default to returning empty
re... |
ef4aa065596fd2047413f3810ef2d650fb25d4ceaf9ca14b0bdf65b189214a98 | MATLAB | 2,929 | 117 | function [] = ExtDataFig07_Example_F()
% Code for plotting images for the example images in Extended Data Fig. 7a.
GT = 'fruD';
% GT = 'fru';
switch GT
case 'fruD'
TargetDataID = 11;
zrange = [2:9];
ylimrange = [0,300];
filename = 'F2d_20220207_01.mat';
case 'fru'
Targe... |
7fca832747a24bf222570536ea34d634ca9a302948126925016e4f236b1547c3 | MATLAB | 2,931 | 117 | function centerpos = LaserRegFnc(Device,v2d,Vel)
%LASERREGFNC [U[ðRegistlation·éÛÉAjÌð©®èÊ·éÖBZ²ð¸µ½Ì¿AX²ð¸·éB
% Device : HexapodfoCX
tic
Device.KSF('LaserReg');
Device.KEN('LaserReg');
SR = 20; %Sampling Rate (Hz)
%Vel = 20; % Scan speed (mm/sec)
zwidth = 1;
... |
bece7814b1ca280643c134f739c9f9dfd852863884a710fe449fd6c3c497ed89 | MATLAB | 2,931 | 81 | % VL_DEMO_SIFT_BASIC Demo: SIFT: basic functionality
pfx = fullfile(vl_root,'figures','demo') ;
randn('state',0) ;
rand('state',0) ;
figure(1) ; clf ;
% --------------------------------------------------------------------
% Load a figure
% ----------------------... |
0113fdc39499e97cd50c062d350c1dbf288ba380115ac4b52821368b1b46f2e8 | MATLAB | 2,932 | 66 | function vars = alignChans_APP(vars, lag)
%% load data
loadAnalysisInfo_APP;
%% add lag to channels
if lag < 0
% magnet channel 1
mag1.pos_data_aligned = mag1.pos_data((-lag)+1:end);
mag1.saccades_aligned = mag1.saccades((-lag)+1:end);
mag1.vel_data_aligned = mag1.vel_data((-lag)+1:end);
% magnet ... |
9934d234d709f446f6d483fcd17f902ff5f6cedbc87c7580678dd7470f80b017 | MATLAB | 2,933 | 108 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Code for the numerical simulations and computational results
% in the manuscript "Fibromyalgia pathogenesis explained by
% a neuroendocrine multistable model"
% by Ilaria Demori, Serena Losacco, Giulia Giordano, Viviana Mucci,
% Franco Blanch... |
2bdbc8bf85d26d5b99e82ee4e373412b1024aaaaed1c07fd225c7c3290359ff3 | MATLAB | 2,935 | 46 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% Compute the BFO90 per (animal, session) pairs later to be used to average
% over animal per day.
function [StabilityPerCell90, StabilityBFO90] = compute_stability_reg_1day_BFO90_per_animal(analysisSettings, analysisInput, BestAlign... |
012624962da799c4adab124615f32c4d5213c0c50a6851c7214b242969826212 | MATLAB | 2,938 | 82 | % This script creates the mesh (both CAD surface mesh and a computational
% wire grid) for a MagVenture figure eight planar coil with 1 A of total
% current
% The output is saved in the binary file coil.mat and includes:
% strcoil.Pwire(:, 3) - set of nodes for all wires
% strcoil.Ewire(:, 2) - set of... |
136d834921f96e0dbd69d12319125963b30194c9f6efacf6a14cf1e7a5963952 | MATLAB | 2,939 | 89 | % createFictracVidPath.m
%
% Function to create folder system for FicTrac video. Matches folder
% structure for runEphysExpt. Also, creates full path to copy and paste
% into SpinView for saving video.
% Run once for each new cell.
%
% INPUTS:
% none, but prompts user to select date folder
%
% OUTPUTS:
% none, bu... |
aab5b80e14d5fcc936be20591d3e53b217654698fbcd3603ac62bc5080b97e74 | MATLAB | 2,941 | 109 |
% update the model which are trained with the legacy code to an updated format,
% which generates a new model which is compliant with the current code.
% One change in the current code:
% in the legacy code, a model is saved into multiple mat files, while the
% current code save the model into one mat file.
func... |
0cd89c493071b67b87f586712ab480af0164e4e72f92f02dd6a0ffffab7500c8 | MATLAB | 2,942 | 74 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R] = compute_whatever_we_need_per_map(occupancyMap, perimeterPadding_bins)
R = [];
% Compute the fraction of bins visited (entire arena)
BW1 = occupancyMap > 0; % whether or not the bin was visited at least once
BW1 = BW1(... |
a61eff9a703f761755a26d30f9b91c373e6b3c7fe7c77799dfab195afaace9b3 | MATLAB | 2,942 | 99 | function Behaviour_variability(Session,Area,Ndir,edges_dur_bin)
%% Behaviour_variability plots the distribution of each movement parameter
% (Direction, duration, speed and distance) in the Session
% Movements are binned into Ndir directions and Nbins durations
%
% INPUTS
%
% Session: Name of the session to be analyse... |
fd8588c7f5effcbbd90a77fa0df014434cb3f75fbe25c823eb7c093e19f7fe9a | MATLAB | 2,942 | 70 | %analyse the volumes
clear;clc
% addpath '/Users/Tara/Documents/Projects/CHBHVisit/PerceptualLoad/Data/MRI_Data/';
% filePath='/Users/Tara/Documents/Projects/CHBHVisit/PerceptualLoad/Data/MRI_Data/Processed_Data/';
% filePath='/Volumes/rdsprojects/j/jenseno-avtemporal-attention/Load/MRI_data/Processed Data/'; %Portal... |
2885f3a73f841fb5efea555b4e00c16cf22c57a89abec704115a89d945561696 | MATLAB | 2,944 | 104 | function cv = combine_visitors(varargin)
% COMBINE_VISITORS Generate a new visitor by combining existing visitors
%
% cv = combine_visitors(v1, v2, ...) generates a new algorithm visitor that
% works by calling the functions in v1 followed by the functions in v2, and
% so on.
%
% The value returned by the combined vi... |
9d7ab7d0468e94e1cead4ca5567c577fa5f3ea0bbd0880e7187731fb2d11771a | MATLAB | 2,944 | 99 | %% fix errors on exp movies
addpath /home/kristin/FLIES/docs/mtrax_methods_paper/code;
set30minmovienames;
resultdir = '/home/kristin/FLIES/data/walking_arena';
tags = [tags_female;tags_male;tags_both];
movienames = [movienames_female;movienames_male;movienames_both];
matnames = [matnames_female;matnames_male;matnames... |
d53fca8711068ed220b3cb6fd51e7c4662cb36d500df5a1d759746b47a6bc579 | MATLAB | 2,944 | 90 | % analyzeKernelsPooled.m
%
% Script to compute kernels averaged over multiple trials. Saves the
% kernels as well as the corresponding figures
%
% run extractKernels.m on all selected trials, save data, save figures
%
% UPDATED:
% 9/27/20 - HHY
datPath = '/Users/hyang/Dropbox (HMS)/EphysAnalysis-Helen/AnalyzedData/... |
4ef12d1ca1dc7484f6d2c49147293dcbeb75af71f5161a235e6255021150acc2 | MATLAB | 2,948 | 87 | function [dat,baseline] = ft_preproc_baselinecorrect(dat, begsample, endsample)
% FT_PREPROC_BASELINECORRECT performs a baseline correction, e.g. using the
% prestimulus interval of the data or using the complete data
%
% Use as
% [dat] = ft_preproc_baselinecorrect(dat, begin, end)
% where
% dat data matrix... |
15602106cc0d94b2ccadb632529d927e867354e5613fef9194ab96d564dc3fe8 | MATLAB | 2,949 | 105 | function SimTrx2WingTracking(expdir,intrxfile,expdir0,varargin)
[dataloc_params,analysis_protocol,settingsdir] = ...
myparse(varargin,'dataloc_params',[],...
'analysis_protocol','current',...
'settingsdir','/groups/branson/bransonlab/projects/olympiad/FlyBowlAnalysis/settings');
if isempty(dataloc_params),
dat... |
35223c17229f02a6100f78ef90aa7daa315fe4efe961f9846759b33247786e1f | MATLAB | 2,949 | 86 | % invfirwsord() - Estimate windowed sinc FIR filter transition band width
% depending on filter order and window type
%
% Usage:
% >> [df, dev] = invfirwsord(wtype, fs, m);
% >> df = invfirwsord('kaiser', fs, m, dev);
%
% Inputs:
% wtype - char array window type. 'rectangular', 'bartlett', 'hann'... |
6be72de6d281aab03cdecaa8cf490ddbb4634bcc9cb34ed8b68968efac522d30 | MATLAB | 2,950 | 63 | function mltp_slice_nvt_to_slice_fnvt(obj, session)
if obj.isVerbose()
fprintf('Fixing the sliced data (if it has problems).\n');
end
% Get the sliced nvt files
regStr = '^(slice_)\d+(_nvt.mat)$';
nvtFilenames = ml_dir_regexp_files... |
8efc2826710b8576714026dec17be293e64894a878b54bff8b1b56cff68d950f | MATLAB | 2,950 | 110 | %
% Generate the category tabular environment.
%
% PARAMETERS
% $NETWORKS
%
% INPUT FILES
% uni/meta.$network
% dat/statistic.{format,weights}.$network
%
% for all $network in $networks
%
% OUTPUT FILES
% tex/category-tabular.tex
%
networks = getenv('networks')
networks = regexp(networks, '[a-zA-Z0-9_-]+', 'match'... |
af404bd2b175d98d44b1fbeb370da03e0dd9447e8d5bb150070cdcc25f28642a | MATLAB | 2,950 | 90 | classdef Device < types.core.NWBContainer & types.untyped.GroupClass
% DEVICE Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
% OPTIONAL PROPERTIES
properties
description; % (char) Description of the device (e.g., model, firmware version, processing software version, etc.... |
622dd89b76c132dfb851852bb2716f8d51a6724fbc0b76ffd388665eb462d98e | MATLAB | 2,951 | 82 | % this script create a 3-D scatter plot showing different pattern of the
% dynamics, including ON-ON, OFF-ON, OFF-OFF and ON-OFF
% 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z)
rootFolder = "figure_Iattn_0.02_2d_4000/";
% ON-ON
data = readFilename(rootFolder+"agree/*_*_*_*_*_*.png",'%f_%f_%f_%f_%f_%f');
data( ... |
7a0c95fabbbbf59614d9c6f089330682bbb3856f0c3f935bb4d10100e4c5133f | MATLAB | 2,951 | 91 | function [full_events,full_onsets,event_starts,onset_starts,endings,doubles,peaks]= find_onsets(pop_signal,peaks,widths,heights,proms,t)
%% MAKE VARIABLES
full_events=cell(length(peaks),1);
full_onsets=cell(length(peaks),1);
endings=nan(1,length(peaks));
event_starts=nan(1,length(peaks));
onset_starts=nan(1,length... |
dced4dceef43225a496446fdc517c3044adf7ff478926c8612a11cdabb0d5040 | MATLAB | 2,951 | 74 | % nonInteractGetLegReversals.m
%
% Function for getting max and min in leg positions, when leg reverses
% direction
% Unlike interactGetLegReversals(), is not interactive. Returns max and min
% given input parameters
%
% AS OF 6/21/23, OUTDATED: replaced by getLegReversals() - uses MATLAB's
% findpeak() instead of f... |
7e2a2195c3e1ea0707e18260eac8dca81cb29457bf29455cbc6919bd4a981ce2 | MATLAB | 2,953 | 76 | function ButtonMotionFcn(hObject, eventdata, handles)
%UNTITLED2 ´Ë´¦ÏÔʾÓйش˺¯ÊýµÄÕªÒª
% ´Ë´¦ÏÔʾÏêϸ˵Ã÷
clc
set(gcf,'Pointer','hand');
global passdata;
passdata.mouseSign=1;
if passdata.mouseSign==1 && passdata.singalclick==1 && ~isempty(passdata.MarkIndex)
if passdata.currentmode==1 && isfield(passdata... |
7f90e92d9f64e2f0cf5cbf69008e07fb0503cbddfa7b484e7274666621fbee59 | MATLAB | 2,955 | 112 | % loadCFSfile.m
% generic CFS loading file
% 13.03.09: version 1, JGC
% requires MATCFS32.DLL AND CFS32.DLL
% CFS constants
% 1.04.09: transpose z
MATRIX=1;
SUBSIDIARY=2;
EQUALSPACED=0;
FILEVAR=0;
DSVAR=1;
READONLY=0;
if (exist('initcfsdir')==0)
initcfsdir='C:\'; % set default
end
c... |
8a6aadf370d4076e3515bba42991b50abcaec8a79b281bae0724fbf3418a9446 | MATLAB | 2,956 | 113 | function [sim_out,shuf_results,res_results,varargout] = run_sim_compare_shuf_res(simOpt)
%run_sim_compare_shuf_res.m
%creates a simulated spike train
%and creates uncorrected/shuffling/residuals output
%"comp" refers to shuffling "compensation"
% get param settings
len = simOpt.len;
pbase = simOpt.pbase;
nr = simOpt.n... |
db4f8587d5c6caa17a8cde02b83154bbc0bee2d3b873138f600f819ec043a6b0 | MATLAB | 2,956 | 82 | function tsq = read_tdt_tsq(filename, begblock, endblock)
% READ_TDT_TSQ reads the headers from a Tucker_Davis_technologies TSQ file
%
% tsq file is a heap of event headers, which is ?40 byte each,
% ordered strictly by time
%
% Use as
% tsq = read_tdt_tsq(filename, begblock, endblock)
% Copyright (C) 2010, Robert ... |
55f6b1dadad49d81ebbd906ecb73ffb9a77457d67d64ed935d928f6a6ee21a4e | MATLAB | 2,960 | 78 | % This script creates the mesh (both CAD surface mesh and a computational
% wire grid) for a MagVenture figure eight planar coil with 1 A of total
% current
% The output is saved in the binary file coil.mat and includes:
% strcoil.Pwire(:, 3) - set of nodes for all wires
% strcoil.Ewire(:, 2) - set of... |
bddd500c9984bd980db6b1623f737681e6e73b149b472478fa4658f45297c112 | MATLAB | 2,960 | 90 | function mltp_plot_across_within_0_180_similarity(obj, session)
% Load the data
matFilename = fullfile(session.analysisFolder, obj.config.canon_rect_placemaps_folder, 'best_fit_orientations_0_180_per_cell.mat');
if ~isfile(matFilename)
error('The data file (%s) does not exist. Make sure it has been... |
5f7cf02b5da724ae922514c15a028a10313d5c5c922c7fa472b0d9e24904690a | MATLAB | 2,961 | 93 | function R = randmio_und_connected(R, ITER)
%RANDMIO_UND_CONNECTED Random graph with preserved degree distribution
%
% R = randmio_und_connected(A,ITER);
%
% This function randomizes an undirected network, while preserving the
% degree distribution. The function does not preserve the strength
% distributi... |
36f6b194d50a1c3acb2c4f584e82c1f93dbef46cedee7ebd222677e09753490a | MATLAB | 2,965 | 61 | function freq_psf = psf_fft(vol_sz, psf, varargin)
% scan_img = scan_volume(neur_vol, psf, varargin)
%
% Scan a 3D volume with a given point-spread function. This function takes
% in a neural volume (as generated by "simulate_neural_vol_v*.m"), a
% point-spread function, and a number of other optional scanning paramet... |
323540191e564fb52065d1a555495aca3517b1bd976fe25d44c602460b951dc3 | MATLAB | 2,966 | 80 | function [EBC BC]=edge_betweenness_wei(G)
%EDGE_BETWEENNESS_WEI Edge betweenness centrality
%
% EBC = edge_betweenness_wei(W);
% [EBC BC] = edge_betweenness_wei(W);
%
% Edge betweenness centrality is the fraction of all shortest paths in
% the network that contain a given edge. Edges with high values of
% ... |
4438d1189766bee326e3d2654d64f781dade7aa41630f95d5f02f37c0f3981bb | MATLAB | 2,969 | 120 | function write_ply(fn, pnt, tri, format)
% WRITE_PLY writes triangles, tetraheders or hexaheders to a Stanford *.ply format file
%
% Use as
% write_ply(filename, vertex, element)
%
% Documentation is provided on
% http://paulbourke.net/dataformats/ply/
% http://en.wikipedia.org/wiki/PLY_(file_format)
%
% See als... |
376586632086a0fa10aac1d0b95112f46a56ebb69466f3505d49fa013687af1f | MATLAB | 2,970 | 93 | function [xy, conf] = coordinate(color)
% UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
if length(color) == 87
answer = questdlg('Choose the used layout', ...
'Layout', '60MEA','4QMEA','4QMEA');
% Handle response
switch answer
case '60MEA'
conf ... |
8cc58cc0b29bfb4104408d300d6bc128a1ec20262b4115026f3274ce7de187cf | MATLAB | 2,970 | 62 | function test_calib_chamber_detect()
script_folder_name = fileparts(mfilename('fullpath')) ;
flytracker_folder_path = fileparts(script_folder_name) ;
flytracker_parent_folder_path = fileparts(flytracker_folder_path) ;
flytracker_test_files_folder_path = fullfile(flytracker_parent_folder_path, 'flytrack... |
8913690693db821b47b89e665ae08c0c417cc42b55ae7b6bd0deb01d513a783d | MATLAB | 2,971 | 87 | function [inside] = bounding_mesh(pos, pnt, tri)
% BOUNDING_MESH determines if a point is inside/outside a triangle mesh
% whereby the bounding triangle mesh should be closed.
%
% [inside] = bounding_mesh(pos, pnt, tri)
%
% where
% pos position of point of interest (can be 1x3 or Nx3)
% pnt bounding mesh ... |
e3421629a8dc0e1105e1063b493afa52968aefedaac109ed283a22379e7c686f | MATLAB | 2,971 | 110 |
function input_info = cnn_layer_dagnn_wrapper_backward(input_info, layer, work_info_batch, output_info)
group_idx=work_info_batch.ref.net_run_current_group_idx;
group_info=get_current_work_group_idx(work_info_batch);
net=group_info.dag_net;
output_num=length(layer.output_var_names);
if output_info.is_group_data
... |
f3471fa0441e5c9b37f7019bb6157e01b9adb45bdb6d9fb9b443c49bdf33fe79 | MATLAB | 2,971 | 87 | function [inside] = bounding_mesh(pos, pnt, tri)
% BOUNDING_MESH determines if a point is inside/outside a triangle mesh
% whereby the bounding triangle mesh should be closed.
%
% [inside] = bounding_mesh(pos, pnt, tri)
%
% where
% pos position of point of interest (can be 1x3 or Nx3)
% pnt bounding mesh ... |
a2bb297b4e38f507c948cfcbf23321702100e9a880f47eb6c03bcfaa69642997 | MATLAB | 2,972 | 110 | classdef My_concat_layer < dagnn.ElementWise
%SUM DagNN sum layer
% The SUM layer takes the sum of all its inputs and store the result
% as its only output.
properties (Transient)
numInputs=[];
end
properties
use_gradient_scale_factor=true;
end
methods(Static)
end
... |
8ea5ba51dcf9fe68d79ae7ddad2be5ed0c04d18a72f3f4676fce09700afd4c47 | MATLAB | 2,974 | 74 | function [probe] = getSpatialMultiplexingGroups(probe)
%GETSPATIALMULTIPLEXINGGROUPS Assign active sources to spatial groups
% Results in a Nx5 matrix, where N is number of active sources and the
% five columns refer to
% [sourceX, sourceY, moduleID, sourceID, SpatialMultiplexingGroupID].
% Each source within... |
f9129dacddb694bc32fda82f3819eaaabe60e318502e775101ef6b297934beb7 | MATLAB | 2,975 | 115 | function [x1,p1,x2,p2,x_all,p_all,deltak,touch_idx,FR,deltak_norm,FR_prev,whisker,spikes]=Tcurve_touches_dk(touches,touches_whisker,psth,k_c1,k_c2,do_plot,NpointsTcurve,subplot_idx,percentile_1,percentile_2)
%this code assumes that the input is dk1 and dk2
counter=1;
k_hor(:,:,1)=k_c1;
k_hor(:,:,2)=k_c2;
window=100;
up... |
19cd11e040dc13fca799df4ef01813b31a06f9e582a204b91373d7e98603eeb2 | MATLAB | 2,978 | 90 | %% Set up
clear;clc;
% open Excel File
excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max.xlsx';
%excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max (Akira).xlsx';
expmt_table = readtable(excelFile);
ExpmtDataFolder = 'D:\My Drive\Expm... |
7d995db61778ea474d9cf3eb5b30e40a3a436786497e07cff80397c48b6c3b92 | MATLAB | 2,979 | 106 | % mglValidateScreenParams.m
%
% $Id:$
% usage: mglValidateScreenParams()
% by: justin gardner
% date: 07/23/09
% purpose: Validates a screenParams structure to make sure that it
% has all necessary fields
%
% screenParams = mglDefaultScreenParams;
% screenParams = mglValidateS... |
b6f2f1b245c43606bb427ca2b592011d7fd5d4169e55c3e5ad522f081cc9062a | MATLAB | 2,980 | 54 | function result = zipAndPost(folder, cfg, micID, source, varargin)
% Zip a folder's preview files, upload them and clean up; never throws
%
% function result = webupload.zipAndPost(folder, cfg, micID, source, ...
% 'ConnectTimeout', 5, 'ResponseTimeout', 10, ...
... |
3c659f56411e2a7ab3186b8021e7b7b1eba1ce34b5b230863bae110dc8c767b8 | MATLAB | 2,981 | 82 | function ml_sim_tetrode_data_plot(simDataFolder)
tmp = load(fullfile(simDataFolder, 'dataMatrix.mat'));
dataMatrix = tmp.dataMatrix;
clear tmp
tFiles = dir(fullfile(simDataFolder, '*.t'));
numTFiles = length(tFiles);
cellSpikes = cell(numTFiles,1);
for iFile = 1:numTFiles
f = tFiles... |
62c8cde379ec0144a85ed73594b0f9fd3120271cc794e7556f650c9769d8f70f | MATLAB | 2,983 | 73 | function [embedding, scaled_eigval] = diffusion_mapping(data, n_components, alpha, diffusion_time, random_state)
% DIFFUSION_MAPPING Diffusion mapping decomposition of input matrix.
% embedding = DIFFUSION_MAPPING(data,n_components,alpha,diffusion_time)
% computes the first n_components diffusion components of ma... |
18d00beccd02d83aef451575e2639ea730803b0b410858444a5326c87c543582 | MATLAB | 2,985 | 97 | %{
Identify chromosome territory inliers based on spatial density.
Please note that the inlier labels in the published datatable may vary
slightly compared to the output of this script, as those labels were
assigned using this script on an earlier and slighly less curated
version of the datatable.
%}
%Read the data
... |
602e936c3824e7786f16a4642b311fd950b2a50ea5c7c0438d68b7cb8d7965a0 | MATLAB | 2,986 | 100 | % TDLM analysis for EEG-fMRI-replay data
% 2024, @BNU
clc
clear
close all
%% Set Environment
% Define paths for utilities, data, and results
pathroot = fileparts(which('step1_replay_analysis'));
pathUtils = fullfile(pathroot,'utils');
pathData = fullfile(pathroot,'EEG_state_probs');
pathResults = fullfile(pathroot,... |
cbd5f8e4bd4bc64c51c13cd2038b37c17ac77dbb6644334c65d6e75e05b128ea | MATLAB | 2,988 | 80 | % addTrace - initializes task for stimuli programs
%
% usage: [ task myscreen ] = addTraces( task, myscreen, tracename, [tracename,] [location]);
% $Id: $
% by: eric dewitt
% date: 2009-01-25
% copyright: (c) 2009 Eric DeWitt (GPL see mgl/COPYING)
% inputs: task, myscreen, tracename(s)
% ... |
71567d0e6d0f4bb5798d8c7d6bb76db5d88956b0071095be021fa1b0d5d12a45 | MATLAB | 2,989 | 107 | function [] = Fig05_SongTypeRespDiffHist()
% Code for plotting the histogram of the mean difference in ΔF/F between pulse and sine song during song-type transitions for the voxels which changed ΔF/F depending on song type in Fig. 5d,f.
GT = 'fruD'; % Fig. 5d
% GT = 'fru'; % Fig. 5f
%% parameters
Thre_SongType = 0.001... |
dcbe6af8d735d789a61899d4fc50a22645c16f53c5fa918b2c347a67d117f97d | MATLAB | 2,990 | 101 | % fir_filterdcpadded() - Pad data with DC constant and filter
%
% Usage:
% >> data = fir_filterdcpadded(b, a, data, causal);
%
% Inputs:
% b - vector of filter coefficients
% a - 1
% data - raw data (times x chans)
% causal - boolean perform causal filtering {default 0}... |
385203a892b821ce81260d9e55139b056be47b8683f7e14c5e1e5e9a20849c64 | MATLAB | 2,991 | 89 | function output = pomdp_observer_exp_memory(stimulus_sequence,sigma,alpha_pos,alpha_neg,...
softmax_temperature,memory_strength_positive,memory_decay_positive,...
memory_strength_negative,memory_decay_negative,value_init)
% reward storage
reward = zeros(length(stimulus_sequence),1);
% response storage
respons... |
a290ca990138d6ec654507709efb7f2752b1e2680e0bc5e4b979e400770b28f3 | MATLAB | 2,992 | 130 |
function init_model_from_cache(train_opts, net_config, net_config_cached)
train_opts.net_init_do_conv_layer_init_only=false;
train_opts.net_init_do_layer_check=true;
do_update_group_info(net_config, net_config_cached, train_opts);
end
function do_update_group_info(net_config, net_config_cached, train_opts)
a... |
db7d30569dfbcd2312692dbdb3f02b7c874bb8226bbdae0dd027ab7cbe517b0e | MATLAB | 2,992 | 75 | function averageGroup(results, name, opt)
all_participants = fieldnames(results);
experiments = opt.experiments;
for experiment = experiments
experiment = experiment{1};
aoi_names = opt.aois.(matlab.lang.makeValidName(experiment)).names;
nb_aois = length(aoi_names.voronoi) + le... |
a6631845280c198527c56d33c9b9cc6806d492430e980288c64a7fd9b467efeb | MATLAB | 2,993 | 73 | % RIDGEFREQ - Calculates a ridge frequency image
%
% Function to estimate the fingerprint ridge frequency across a
% fingerprint image. This is done by considering blocks of the image and
% determining a ridgecount within each block by a call to FREQEST.
%
% Usage:
% [freqim, medianfreq] = ridgefreq(im, mask, orienti... |
0cb63d0e7b586a102ec0438b05985bcdb63aa13b77a0aea4d1469476eb455619 | MATLAB | 2,996 | 93 | function cfg_artifacts=st_artifact_segment_to_continuous(cfg_artifacts)
%---input checks and defaults----
ft_checkconfig(cfg_artifacts,'required',{'data'});
ft_checkconfig(cfg_artifacts.artifacts,'required',{'grid'});
cfg_grid=cfg_artifacts.artifacts.grid;
segmentLength=cfg_grid.segment_length;
chanLabels... |
3ad492b54e8308b578c1bb6ce1b1a0ceae113bbfafdfb9330a899dd8c6ea5353 | MATLAB | 2,996 | 126 | function [f, ssinfo]=createwdata(varargin)
% CREATEWDATA Distribution parameter struct constructor
%
% CALL: f=createwdata(list)
%
% f = struct with the following fields
% name: 'WAFO data object'
% type: 'data'
% data: []
% dataCI: []
% args: {}
% ... |
42f4c49e21c8ae1d2089caaea47606a334eddd056ecd841342b57aeb9babd3cf | MATLAB | 2,996 | 82 | % getCorrelationEphysFwdAccYawVel_cond_all.m
%
% Wrapper function for getCorrelationEphysFwdAccYawVel_cond_fly() that
% takes in pData files from multiple flies (either through GUI or input),
% parses them into separate flies, generates output file name, and feeds
% them into the single cell function (called sing... |
c10711299d5405d41d4edeafba49b0c1e7b483cd4bf8ee8cf222b08f718ae894 | MATLAB | 2,996 | 92 | function bubblepie(xlist,ylist,slist,graph_data,graph_labels,graph_legend,xlab,ylab,lab)
% A Bubble Plot, Pie Chart Combination
% bubblepie(xlist,ylist,slist,graph_data,graph_labels,graph_legend,xlab,ylab,lab)
%
% Creates a plot with pie charts at (xlist, ylist) using graph_data, having
% size of the pie scaled by sli... |
6078faae252b4ae01f5c351b24e42a3d3582226119252831f9f3cbf42521cde7 | MATLAB | 2,999 | 71 | classdef MLBehaviourWriterH5 < handle
%MLBehaviourWriterH5 Writes arrays to an h5 file.
% Writes basic behaviour data from arrays to an h5 file.
methods (Static)
function write(filename, positionX, positionY, speed, headDirection, timestampsMs)
arrayLength = length(positionX);
... |
67ed0fe52be8dab30b5d1df9f6ef7f81a756466f6dea7a5197fecfab1c8d1f14 | MATLAB | 2,999 | 95 | function write_neuralynx_ncs(filename, ncs);
% WRITE_NEURALYNX_NCS writes continuous data to a NCS file
% The input data should be scaled in uV.
%
% Use as
% write_neuralynx_ncs(filename, ncs)
%
% See also READ_NEURALYNX_NCS
% Copyright (C) 2005-2007, Robert Oostenveld
%
% This file is part of FieldTrip, see http:/... |
b3e9f0b03a6e91198c4721dcb64b6f9766dc750b7be989b6d46e5bde815f928c | MATLAB | 2,999 | 97 | function s = read_curry(filename)
% READ_CURRY reads and parses Curry V2 and V4 ascii files and returns the
% content in a structure that is similar to the block-structured layout of
% the file. This function does not interpret the content of the file, but
% is intended as a helper function for READ_CURRY_XXX function... |
3f99b867da95339f25f49e9a06748c5f5fed39d8dd53fb6ce467248776a5cadc | MATLAB | 3,001 | 83 | % getSlideWinEphysFwdAccYawVel_cond_all.m
%
% Wrapper function for getSlideWinEphysFwdAccYawVel_cond_fly() that
% takes in pData files from multiple flies (either through GUI or input),
% parses them into separate flies, generates output file name, and feeds
% them into the single cell function (called single fly... |
47bd6528e21f6f45b4bf7b2821cd5407a0f39cac9d11db85ae39fbf8af11fbda | MATLAB | 3,001 | 71 |
%% Setting
Center_x = 0;
Center_y = 0;
Maze_radius = 8600;
RZ_Inner = 6500;
RZ_Outer = 8000;
PositionofTrialStart.x=X(Index_TrialStart);
PositionofTrialStart.y=Y(Index_TrialStart);
HeadDirection.Start=CenterMonitorDirection(Index_TrialStart) + 9;
ArrowLength=4000;
% High-value zone boundary
arch_inner1... |
bf57392749d012acd3a4cb98e72ba0251b263444269bde3f72901597a15d48e8 | MATLAB | 3,001 | 97 | function srf = readBESAsrf(filename)
% This method reads surface files from BESA Research/MRI. For more
% information on the srf file format also see the file format description
% provided by the BrainVoyager support site:
% http://support.brainvoyager.com
%
% Parameters:
% [filename]
% In the case that th... |
35fbe2e8900fec75080d230547281d25436c5ba6f0b4dc387b56fde0ec4f825c | MATLAB | 3,005 | 124 | function r = save_mgh(vol, fname, M, mr_parms);
%
% save_mgh(vol,fname, M, <mr_parms>);
%
% M is the 4x4 vox2ras transform such that
% y(i1,i2,i3), xyz = M*[i1 i2 i3 1] where the
% indicies are 0-based
%
% mr_parms = [tr flipangle te ti]
%
% See also: load_mgh, vox2ras_0to1
%
%
%
% save_mgh.m
%
% Original Author: Bru... |
0acb803c9c44a0d7bb15505a0c36997e7b32c36196b1f2a7a5cf5034ffbed389 | MATLAB | 3,008 | 106 | function [] = Fig04_SongTypeRespDiffHist()
% Code for plotting the histogram of the mean difference in ΔF/F between pulse and sine song during song-type transitions for the voxels which changed ΔF/F depending on song type in Fig. 4e,g.
GT = 'nsybD'; % Fig. 4e
% GT = 'nsyb'; % Fig. 4g
%% parameters
Thre_SongType = 0.0... |
916c5532626784a698f4762e994a41fec077af8fdd520aec283359ac219234bd | MATLAB | 3,008 | 103 | % plotSpikesStepComboPhase.m
%
% Function to plot timing of spikes relative to leg phase, at different
% time offsets between ephys and behavior. I.e., plots the output of
% getSpikesStepPhase_cell(), but combining multiple flies.
% One figure per delay; 6 subplots, 1 for each leg per figure
%
% INPUTS:
% datDir - ... |
a81c0a9f071b78c7271e5cfd7aac2e993bc7f2342c69361394c4372ff30d7ae5 | MATLAB | 3,008 | 56 | %% Demonstrate anomaly in FMM3d for Laplacian interaction library
disp("Demonstrate anomaly in FMM3d for Laplacian interaction library.");
disp("Run this script once on Windows using the precompiled lfmm3d mexa shipped with BEM-FMM (included here) and once on a Linux-based OS using a fresh compilation (without FAST_KER... |
0eace619a9e53097e826e0bf109a07ed7a020c513afbd6cb834e664e733f456f | MATLAB | 3,009 | 103 | function J = vl_imarraysc(A, varargin)
% VL_IMARRAYSC Scale and flattens image array
% J=VL_IMARRAYSC(A) constructs an image mosaic similar to
% J=VL_IMARRAY(A), but it rescales the range of each image in the
% array. If A is an array of grayscale images, J will index all the
% colors in the current colormap; ... |
38fa083538d8bc3a32543c1ad546df794b72dd498aa6ba0452b321114f14acd5 | MATLAB | 3,011 | 83 | % mglFLush: Commit a frame of drawing commands and wait for the next frame.
%
% usage: [info, results] = mglInfo(socketInfo)
% by: justin gardner
% date: 01/26/2023 ... |
b2e5ebded7a9eee3f74845522c2637dff89d3346e38ce458eff1122d5ea5477a | MATLAB | 3,012 | 95 | function [A] = spm_matrix(P, order)
% returns an affine transformation matrix
% FORMAT [A] = spm_matrix(P, order)
% P(1) - x translation
% P(2) - y translation
% P(3) - z translation
% P(4) - x rotation about - {pitch} (radians)
% P(5) - y rotation about - {roll} (radians)
% P(6) - z rotation about - {yaw} (ra... |
db80ceee103a8034f053205ce94e95474c77c6ecf032a03541f66291a666ad54 | MATLAB | 3,012 | 78 | function [I Q F]=motif3funct_wei(W)
%MOTIF3FUNCT_WEI Intensity and coherence of functional class-3 motifs
%
% [I Q F] = motif3funct_wei(W);
%
% Functional motifs are subsets of connection patterns embedded within
% anatomical motifs. Motif frequency is the frequency of occurrence of
% motifs around a no... |
e51e0bbd71170d6667c304a774231e6519a71a91d7457311c264d9ada2d3be8d | MATLAB | 3,013 | 96 | % mglGetScreenParams.m
%
% $Id:$
% usage: mglGetScreenParams()
% by: justin gardner
% date: 07/17/09
% purpose: just returns the screenParams
%
function [screenParams screenParamsFilename] = mglGetScreenParams(convertDigFields)
% check arguments
if ~any(nargin == [0 1])
help mglGetScree... |
43054fbc31c7d39f4bd084eace9cdb87a34a26a007055eb26b2e2928968985a0 | MATLAB | 3,014 | 112 | %% Analyze simulation results
clear
restoredefaultpath
filePath = matlab.desktop.editor.getActiveFilename;
root0 = fileparts(filePath);
addpath(genpath(fullfile(root0,'lib')));
root = fullfile(root0,'data');
%% Karger model fitting
load(fullfile(root,'simulation_results_fix_tex.mat'));
tex_fit = zeros(2,1);
K0_fit =... |
07a9bdd798622a401ae740177757d5af83f8647a19d1f3fb1512f5bbbb1293ca | MATLAB | 3,015 | 123 | function [f,d] = vl_ubcread(file, varargin)
% SIFTREAD Read Lowe's SIFT implementation data files
% [F,D] = VL_UBCREAD(FILE) reads the frames F and the descriptors D
% from FILE in UBC (Lowe's original implementation of SIFT) format
% and returns F and D as defined by VL_SIFT().
%
% VL_UBCREAD(FILE, 'FORMAT', '... |
534cfd469e952089ec8c9d9c0282fcae36cb6d37e5842e99d83e4c6361dc7c5d | MATLAB | 3,015 | 85 | function two_contexts_tetrode_init(referenceFolder)
projectType = 'two_contexts_tetrode';
fprintf('Select the project instance folder (the project scripts will be saved in it)...\n');
instanceFolder = uigetdir(pwd, 'Select project instance folder');
if ~exist(instanceFolder, 'dir')
fprintf('Creating instance fold... |
5fbae0db4eca352ccfc197789f87fcb287c8885543b2cc437fc9b1f8c43433e9 | MATLAB | 3,015 | 84 | function subj_variablity_response_correctVSwrong(sn,iterN)
% post-response variance for correct and incorrect trials, subsampling
% correct trials (iterN) to match the number of trials for incorrect
% condition
rng shuffle
load('subs.mat');
subname = subs.name{sn};
set_name = fullfile(Dir.prepro,[subname,'... |
b1e6c3d6912e31e0a0a70f836cccef87a641a92224233ca5f7bfab24b55451dc | MATLAB | 3,016 | 122 | function [hit,hit3,fa,fa2,fa3]=Detection_test(Data,total_psth,varargin)
%aim: compare detectability of latter touches with dectectability of
idx=ones(size(total_psth,1),1)>0;
if nargin==3
idx=varargin{1};
end
% evaluate histogram of spike counts
k=0:1:21;
nk=numel(k)-1;
hit=nan(1,nk);
fa=nan(1,nk);
hit3=nan(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.