sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1f92a5aeddee1a6d7a2147aac0f365002838884b997dc1b35d8948ecfc98ff70
MATLAB
1,602
49
function run_analysis_step1(data_folder,analysis_folder,animal_folder_listing) af_name = animal_folder_listing(ii).name; af_path = fullfile(data_folder,af_name); fprintf('Animal: %s\n',af_path); % CREATES AN ANIMAL FOLDER IN THE ANALYSIS DIRECTORY (analysis_af) analysis_af_name = fullfile(analysis_folder,af_name); if...
79dbef876b96eb972f5ccbed521eead60e5c2a55ef5437eee174fd0e6980b1ad
MATLAB
1,605
57
%% Add path addpath(genpath('../Ionnic Channel'),genpath('../Tools'), genpath('../Synapses'), genpath('../Datas')); %% Import data from neuron (FS) dt = 0.01; Vmem = -90:dt:60; l_V = length(Vmem); %% Anonymous function qinf_simp = @(v) ((0.000297*v +0.5059)*tanh(3.74...
be0da42902752aa648ea84fd6b59dc75447ee49d2fafa94e7d33cfbd2b05f0f0
MATLAB
1,607
65
function [cs,reps] = plot_fibers(fc,c,lw,ind,reps) if ~exist('ind','var') ind = []; end if ~exist('lw','var') lw = .1; end % reps is a repitition of each index - allows you to colour fibers % according to their density for example in group analyses if exist('reps','var') limits = reps./max(reps); end if...
0cc9c2d1781230291fa0b744e6a02104ae303053e276f620911093889ab90892
MATLAB
1,608
47
% function [sigma,shrinkage] = covshrink_oas(data) % % Function to calculate Oracle approximating shrinkage (OAS) according to % Chen et al (2012). See % http://tbayes.eecs.umich.edu/_media/yilun/covestimation/chen_icassp1_09.pdf % % Shrinkage target is the identity matrix. % % INPUT: % data (n_samples x p...
fd2bcea711383fd55678f11354bcdbb3189568c542eff1d7cf65b76e907ff8f2
MATLAB
1,608
63
function [NormFactor,D,V,VScore,Vlatent,VVarExp,VPC,VPC_Stm] = doDiffPCA(X,Stm,normalization,demean,useAllMd) % X: input % nStm x T x nClu; % Stm: stimulus matrix % normalization: 1 = normalize to s.d.; 0 = none; % VPC: % nClu/nPC x (T*nStm) % VPC_Stm: % nClu/nPC x T x nStm verbose = 0; ...
92da2724674f841003c05d3871ddf2678c8fb84693907f7e6cd5cad424f42e48
MATLAB
1,609
59
function [xf] = generate_decay_rotating_wave( image_size, dt, T, ... frequency, lambda, sigma, varargin ) % *WAVE* % % GENERATE DECAY TARGET WAVE TEST DATA generates a simple test dataset for % use with the functions in WAVE % % ...
00e65b3357405225e1f985cd46ad27672c466e5dbecb27274492da6379bb24af
MATLAB
1,610
52
load('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\Noise\Analysis\DataStimulus\Ai148_AAV-Grm6Cre_121418_1_11.mat'); OUT = DG_OUT; Grid = OUT.Grids; %% % 60 (main) 870 880 882 pageid = 882; figure; imagesc(squeeze(Grid(:, :, pageid))'); colorbar colormap(gray); axis off box off %% SaveFolder = '\...
a07ffd36bfe8bfc4f80ba18482f1cbf2a242ff9f5e75b76332e832bb35de4b17
MATLAB
1,610
56
function varargout = pickle2mat(varargin) % This function will convert a serialised python object (a pickle) into % a MATLAB .mat file. It calls python commands from MATLAB, to first % load the pickle, then resave it using scipy's savemat. If the .mat file % already exists, this function will only reconvert and overwr...
db2752a05b704d06862dc6774a6913ab07afd46fdc37d09d97d2ea6ed33c011d
MATLAB
1,610
41
function [t,x,ie] = simDP(K,params,x_0,T,dt,shift,sigma_noise) %SIMDP K, params, x_0, T, dt, shift, sigma_noise % Simulates coupled populations of N Destexhe-Paré neuron models. % K coupling matrix (N x N non-negative matrix) % params model parameters (structure) % x_0 initial condit...
029ec1d5a2fc81b527d34e91b4cd331d4c6671ee07936c8ce2a6c913a7bcb2ff
MATLAB
1,613
57
%% Add path addpath(genpath('../Ionnic Channel'),genpath('../Tools'), genpath('../Synapses'), genpath('../Datas')); %% Import data from neuron (FS) dt = 0.01; Vmem = -90:dt:60; l_V = length(Vmem); %% Anonymous function rinf_simp = @(v) ((-0.000396*v - 0.5129)*tanh(1....
d5045da6c4752284429a3e89a0f3f77897a7f49ecbd89de541614c115b2860a5
MATLAB
1,613
74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % Frequency calculator % % Authors : KHOYRATEE Farad % Date : 11/10/2017 % Update by : KHOYRATEE Farad % Update : 24/04/2017 % % Version : V1.1 % % Descritption: Mesure the spike frequency. Every spike % must have t...
57ed7e376b7bdbfa4267739c4ca8ae211551ce51603b12d41b4b5d2fc80c51f7
MATLAB
1,614
68
function [filt] = normfilt(n, fwhm, d) % Gaussian (Normal) filter of specified width, FWHM, and dimension. % % Usage: % % [FILT] = NORMFILT(N, FWHM, D) % % Returns a Gaussian filter FILT with N samples and a Full-Width % Half Max of FWHM samples. D is the number of dimensions of the % filter; either 1, 2, or 3 dimens...
aef929f7622faaa2d0eb29ff65acaf5be4f005b049e73d07c325848499124c97
MATLAB
1,616
51
function toggleLinesAxesSDG_ButtonDownFcn(hObject, ~, handles) % This function is called when the user clicks directly on one of the measurement % lines in the SDG axes global maingui; SD = maingui.dataTree.currElem.GetSDG('2D'); ch = maingui.dataTree.currElem.GetMeasList(); iWl_gui = GetWl(handles); mouseeven...
18b75ea2edfae331672316616f37d009e4cbfad3aecaf094f6495ee73e214e8f
MATLAB
1,617
37
% function [ranks,ind] = eget(cfg,external,i_step) % Feature selection subfunction using external ranking scheme. For example, % features can be weighted based on an independent localizer run and the % according t-values. As another example, an F-test can be applied to each % training set independently, in that w...
57f5e9e52cba9a9343a888f6a3790c231bf900669539589776a99df1961b6dd7
MATLAB
1,617
57
% ConvertBasler2Whl - Convert Basler data to whl file format % % USAGE % % ConvertBasler2Whl(videoFile,digitalSig,<options>) % % videoFile path to Basler video file % digitalSig path to dat file containing the syn TTLs % <options> optional list of property-value pairs (see table below) % % ...
631eb39d38af4c6f8d765b27ebf0b406a78752e25ba28320a43873fdbd54ca9f
MATLAB
1,618
60
function [varargout] = stack_mean_im(varargin) num_planes = 1; if ~isempty(varargin) num_planes = varargin{1}; end % Load stack and split d = uigetdir('Select stack directory'); f = dir([d filesep '*.tif']); f = {f(:).name}; stack = ImReader(d); stack = split_stack(stack,num_planes); %% Registratio...
88b5cfccb1f2ae49d959421cba513b6d195f648e4877853f37ac47059a4e5494
MATLAB
1,619
43
%This script stitches images aquired at different z depths 2gezer %OCT Data OCTVolumesFolder = [s3SubjectPath('01') 'OCTVolumes/']; dispersionQuadraticTerm = []; %Use default that is specified in ini probe file focusSigma = 20; %When stitching along Z axis (multiple focus points), what is the size of each focus...
a977fe56bc157d16d1d1b4ee13b6f36990d068958e3da75d7b3507eedd23f5f5
MATLAB
1,619
53
function display_displacement_grid(displacement,figNo,title,varargin) % DISPLAY_DISPLACEMENT_GRID Displays the deformed grid % % display_displacement_grid(displacement,figNo,title) % % INPUT ARGUMENTS % displacement - Displacement field to display % figNo - Figure number to use % title - Figure title %...
e3a0ed9c351150fae8fa66670008db0058442a05d258773f72a22f899fa6e382
MATLAB
1,622
75
function [pf,x1,x2] = PlaceFieldsCont(S,X,Y,epoch,varargin); % Place-Field for continuous values % USAGE % [pf,xb,xb] = PlaceFieldCont(S,X,Y,epoch,...); % % Input: % S: a tsd % X,Y: tsd od spatial position % epoch: intervalset on which place field is computed % % by default, the number of bins in the 2 d...
fd31693f7cc0e7da03f8f253940199973568afab8c752693dd28f8e8bc74c0ce
MATLAB
1,622
60
function [nn_corr,nn_sig] = NnCorrFunction(data1, data2,... raster_params, bin_sz, varargin) DIRECTIONS = 0:45:315; PROBABILIES = [25,75]; OUTCOMES = [0,1]; p = inputParser; defaultShiftControl = false; defaultSeperateByPrev = false; addOptional(p,'shiftControl',defaultShiftControl,@islogical); addOptional(p,'sep...
15f4de6461ab7971ae81793539d1b09e2df831a7fa99a51f83a2bfcc8022308d
MATLAB
1,623
40
function [p_sil_vs_ee, p_ava_vs_ee, ave_p_silence, ave_p_ava, h_vals] = computeProbSilenceAvalanche(eta_list_ultra, eps_list_ultra, N_Neur, num_draws) % Calculates the probability of silence for values of eta and epsilon in % provided list, for N_Neur neurons and num_draws draws of J_i coupling % values. Uses that to c...
218221370faf508fc867772449f66b8f116bf0a1883c3f120837a19e47cdf1a0
MATLAB
1,623
67
function epochs = find_amplitude_epochs( amp, threshold ) % *WAVE* % % FIND AMPLITUDE EPOCHS locate epochs in a logical datacube, as with % find_epochs() % % INPUT % amp - input datacube (r,c,t) % threshold - thresholding value, to produce a logical array (sc) % % OUTPUT % epochs - st...
9cd4fda965f4f4432fd5905a436fdbf2e862ee31f67c7b6ce8c6fd83140df7a7
MATLAB
1,623
62
function MakeSpikeData_FromKlusters(varargin) % MakeSpikeData_FromKlusters(filebasname) % construct a tsdArray of spike timing from the Neurosuite feils and save it in Analysis/SpikeData.mat % % INPUTS: % filebasename (optional): file base name (folder name is default) % Adrien Pey...
ab8014bb91b7fa94b863992c4db0aafd30f6c8112c67add4044f13e43019d753
MATLAB
1,623
59
% RDK-vMMM: behavioral analysis % _ % This script reproduces the analysis pipeline from Töpfer et al. % (in review at JoV) and creates figures presented in the paper. % % written by Felix Töpfer <felix.toepfer@bccn-berlin.de>, ca. 2020 % finalized by Joram Soch <joram.soch@bccn-berlin.de>, 08/07/2022, 16:01 clear clo...
f571951647742afaf674bc60d698bc9b25a76d23a44ee68bca338a939f4fc530
MATLAB
1,623
47
%% Plot V4 MI Firing Rate sensitivity and bias split at cued and cue-opposite locations for superficial and deep layers (moving window plots locked to cue onset/offset) %% Code loc = ["cued","opp"]; loc_flag = 1;%input('neural data at cued location or cue-opposite location: 1-cued, 2-opp: '); % loc_flag = 1 for Fig 4...
28ef51669d8090c19687753290e57d9b12241231991357ed8121bec9367bf98b
MATLAB
1,624
62
function MakeSpikeData_FromKlusters(varargin) % MakeSpikeData_FromKlusters(filebasname) % construct a tsdArray of spike timing from the Neurosuite feils and save it in Analysis/SpikeData.mat % % INPUTS: % filebasename (optional): file base name (folder name is default) % Adrien Pey...
c2824dae2298d118b85a7cbef344d976648b4451c583bc067abe5a7b1af902f5
MATLAB
1,624
44
function [CI,sig_from_0] = compute_CI(data,nb_bootstrap,alpha_sig,consecutive_points) %INPUTS: data, data matrix dim trials x time % num_bouts, number of bootstrap % sig_alpha, significance threshold for CI % min_duration, consecutive bins required to register as significantly different to zero [...
42759b847111220219de2a3759422786f7bca70d8c0cbf786295ff49255710e2
MATLAB
1,625
48
function map = bv_readstathdr(fid) % map = bv_readstathdr(fid) % % :description % % A utility function that reads the stat map header, % common to vmp (version 2) and smp files. Used by bv_readsmp and bv_readvmp. % % :inputs % % fid file id of file already opened for reading % % :outputs % % map map...
4b636cd3a168cc9f89e82086be8dcbcdf2b6d572c33f81f2df56d0a1030cbcba
MATLAB
1,625
46
% Wm = vsh_modified_out_fast(theta,phi,l,m,p0) % % Vector spherical harmonic funtion modified from Hill's function % W_lm for quantum numbers l and m. Angles theta and phi should be % given in radians. p0 contains the values of the Legendre polynomial. % function Wm = vsh_modified_out_fast(theta,phi,l,m,p0) % Copyrigh...
6dc84d5e2169c5a50552097a789e0abb33b054166b87e8d846bc6d9ac0ac59f6
MATLAB
1,625
58
%--------------------------------------------------- % F-value calculation function F = fvalue(varargin) % This function runs several one factor ANOVAs in parallel. % It is a great lot faster than the function provided by Matlab % and may save considerable time depending on the number of necessary % F-value cal...
8754ba18011719a3bc252d1465832a752a935be4732f2f7062fa985ad302ac53
MATLAB
1,625
65
function [returnVar,msg] = Process_ChangeDatChannelOrder(fname,nbChan,ch_old,ch_new) % USAGE: % Process_ChangeDatChannelOrder(fname,nbChan,ch_old,ch_new) % This function changes the order of a dat file % INPUTS: % fname: dat file name % nbChan: number of channels % ch_old: original channel order (s...
8a072ff3696cc74031d4fd90f5fb1223f7b2ef04d8e80aa6c3af76852a3d65c3
MATLAB
1,626
49
function [net_test, lim, Weights, Biases] = fun_Initializeweight(net, ver, stdfac) # adopted from Baek et al., 2021 net_test = net; net_tmp = net_test.saveobj; rand_layers_ind = [2, 6, 10, 12, 14, 17, 20, 23]; Weights = cell(1,length(rand_layers_ind)); Biases = cell(1,length(rand_layers_ind)); for ind_tl = 1:length(ra...
8d21b4d613ce8bfd30cf4babd2b22ca98bb0faf892f9fd505cf9810d7ee67bb9
MATLAB
1,627
50
function [AvTraj] = Av_Traj(Traj) % Create an average trajectory for the different types of trajectories % and calculate the standard deviation % (from interpol200) %Traj = Data.selectRtR_interpol200; numTraj = size(Traj,1); if numTraj == 0 AvTraj = []; else for i = 1:numTraj AllX(...
daa7f73ba530d0a203ded83a5ae849de93c6935f4c2aebd064cfbbfe69abdc87
MATLAB
1,627
65
function [names isgroup] = find_group_single(subj,objtype,name,varargin) % Lets you know whether you have an objname or groupname % % [NAMES ISGROUP] = FIND_GROUP_SINGLE(SUBJ,OBJTYPE,NAME,...) % % REPMAT_TIMES (optional, default = 1). By default, this % will return just a single cell containing the name of the object ...
dbfd80a0d597f2d5baf1ad9cf64038a3a825a18fb47ab8469abdab4327154479
MATLAB
1,627
55
% DFTFILT digital filtering using FFT % % call [ Y FR ] = DFTFILT( X, FS, FLP, FHP, BAND ) % % gets X matrix, signals in columns % Fs sampling frequency % FLP lowpass cutoff % FHP highpass cutoff % ...
a9110957aa5a19dcfe6b2cfff8fb0594242906409d4f3999b1b5668e85f0f14c
MATLAB
1,630
42
function result = conv3(signal, kernel, region_of_interest) % CONV3 % % Perform convolution (actually correlation, see note 3 below) in up to % 4 dimensions. The signal may be complex but the kernel must be real. % % Call: % result = conv3(signal, kernel) % or % result = conv3(signal, kernel, region_of_interest) % %...
af8d7bcaf73ff766132e572d817e48bfcd36920f354d337ba3137a4a91dee5a1
MATLAB
1,632
45
function [tt, thABc, pp, thABj] = ME_vMMM_trl(y, r_est, k_est) % _ % Trial-Wise Analysis for a von Mises Mixture Model % FORMAT [tt, thABc, pp, thABj] = ME_vMMM_trl(y, r_est, k_est) % % y - an N x 1 vector of response deviations % r_est - a 1 x K vector of estimated frequencies % k_est - a 1 x K vect...
3857f73cedd060a5b5d93fed7b83e97c6a5ee8b401ce8ef56ed9501bf7bd035a
MATLAB
1,633
51
function [h, hdata] = mlphess(net, x, t, hdata) %MLPHESS Evaluate the Hessian matrix for a multi-layer perceptron network. % % Description % H = MLPHESS(NET, X, T) takes an MLP network data structure NET, a % matrix X of input values, and a matrix T of target values and returns % the full Hessian matrix H corresponding...
5da281829b340af86bcc787763ccbc6d0689e600b3167477690df7407be00851
MATLAB
1,633
68
function [h,B,mu,h0] = HeadDirectionField(tsa,ang,GoodRanges,varargin) % USAGE % [h,d,mu,p,kappa] = HeadDirectionField(tsa,ang,GoodRanges) % % Inputs: % tsa: a ts object (typically a cell!) % ang: a tsd object of head orientation % GoodRanges: an intervalSet object defining the time of valid p...
87b6e1b53b6af5ca079af3e58b9171046ea42a051e871495d5507850857bab9d
MATLAB
1,633
52
function [] = write_out_censor_from_sel(subj, selname, varargin) % [] = WRITE_OUT_CENSOR_FROM_SEL(SUBJ, SELNAME, ...) % % Takes in a selector object/group, and writes each out to a % .1d censor file. Only SEL==1 counts as 1 in the censor % file, i.e. this is designed for writing out training % selectors. % % CENSOR_1D...
29864a52a18a5f7720c8c70d4ba98f3c718862bd5814a557d435ef93d5857f51
MATLAB
1,638
69
function py = madc_pcont_table(d, c, mt) %% generate contingency table response probabilities given d and c vector % % Sridhar Devarajan, Sep 2016 % sridhar@cns.iisc.ernet.in % % d and c should be mx1 each % mt is model type: 'u' for unequal sensitivities and 'e' for equal sensitivities if length(d) ~= length(c) ...
4bb901118c3978aeb956321211e8fdff54db41cefbb107b27384590d5845f2a1
MATLAB
1,638
59
function gfcd_hemi(subj, varargin) hcp1=cifti_read('HCP2016FreeSurferSubcortical_dparc.dlabel.nii'); ind=find(hcp1.cdata==0); datt=cifti_read(filename='space-fsLR32k_sulc.dscalar.nii'); datt.cdata(ind)=0; ind=find(datt.cdata~=0); sss=64984; dire='/abcd_collection3165/derivatives/abcd-hcp-pipeline/'; cifti=cifti_read...
5e94bdfa7d83f47bd1fd2880bc0c18457560e27a2b0e3f32eb6c8ee91f1f1c72
MATLAB
1,639
53
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to validate the specificity of CCA mode % % Jin % 7/25/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% set the file path current_path = pwd; working_path = current_path...
7c644ddc89463488d828607f8ba06d7de5d6e0b46e2cd2008fe2db8d89b1072f
MATLAB
1,641
50
function [t] = getIOdata(file) ss=load('D:\Morphys\Data\Electrophysiology\SetupSettings\Setupsettings_INF.mat'); ss=ss.obj; load(file); if exist('a', 'var') sweep=a.getchannel.getin('signal', 'primary').getsweep; elseif exist('a1', 'var') sweep1 = a1.getchannel.getin('signal','p...
622b36a1360eaaf35d9bd8e6bc6281cdd1862a46b5ca7426ee5463550e5a536c
MATLAB
1,642
32
function obj = setupSystemObjects(MinSize,MaxSize,bkgProb,vid) % Initialize Video I/O % Create objects for reading a video from a file, drawing the tracked % objects in each frame, and playing the video. % Create a video reader. obj.reader = VideoReader(vid); % Create t...
4314e1f8c4246a364f29bc1914b0369c25a74257ec6744d994340f4db6517c3e
MATLAB
1,644
33
function [hF_freq_eye, hF_filters, hF_step, hF_sine] = plotPostLearning(... I, K1, K2, K0, RR_data) % Helper function to create a bunch of plots after running VOR model learning % Get frequency response after learning freqs = RR_data.freqs; % Use frequencies from Ramachandran & Lisberger 2005 % freqs = logspace(...
6fae3dfd8c1b65104417df94a78dd06eea015d43cffac783414571868591748d
MATLAB
1,644
50
function output = deformation(input, displacementField, interpolation) % DEFORMATION Deforms an image according to the given displacement field % % output = deformation(input, displacementField, interpolation) % % INPUT ARGUMENTS % input - Data to deform % displacementField - Displacement field % in...
368125709f63543c5e1e085728cbed57d99b10a594cf0c7093072ab6fe8d2d0d
MATLAB
1,645
68
function [h X Y] = hist3(Data, XBins, YBins, ZBins) % out = hist2(Data, XBins, YBins) % % Makes a 3d histogram of the data. % XBins and YBins are optional arguments % which give the number of grid segments. % - default is 50. if length(XBins) == 1 MinX = min(Data(:,1)); MaxX = max(Data(:,1)); else MinX = X...
da522c742ed74c84dc5dc7ff60e191c6b47bc61a62dd46b13fa8823995f4ba45
MATLAB
1,646
70
function [h,B,mu,p,kappa,h0] = HeadDirectionField(spk,ang,GoodRanges,varargin) % USAGE % [h,d,mu,p,kappa] = HeadDirectionField(tsa,ang,GoodRanges) % % Inputs: % tsa: a ts object (typically a cell!) % ang: a tsd object of head orientation % GoodRanges: an intervalSet object defining the time of...
0d3d224478a4435794ec973ed12478a6f0b6edd139ed0e97de6ca50dee788ebb
MATLAB
1,648
54
function midRip = findRipplesMid(eeg,epoch) % findRipplesMid finds ripples peaks in hippocampal signals. % USAGE: % midRip = findRipplesMid(eeg,epoch) % input: % eeg: tsd of unfiltered eeg signal % epoch: intervalset on which ripples have to be searched (typically: SWS epochs). % output: % midRip: a tsd of r...
8207eb39d2b3c8ba5beb03286548b5e8debcb3bf91d082a471dd3d187ef01952
MATLAB
1,648
71
% Mat = Accumulate(Index, Value, Size); % % This function does something MATLAB really should have built in. % % it performs a matrix accumulation. i.e. for each Index, it adds % the corresponding Value to that element of a matrix. % % this is using sparse and converting back to a full matrix. % % inputs: Index: n by ...
e5c9c4c3a51dc5e3c02aa38a65e065b6409051ce80dd97ffe5b81ab5d524bc27
MATLAB
1,648
78
function [u,v] = fftalign(A,B,plotting) % based on work of Dario Ringach % https://scanbox.org/2014/03/20/recursive-image-alignment-and-statistics/ % N = min(size(A)); % size(A) % yidx = round(size(A,1)/2)-N/2 + 1 : round(size(A,1)/2)+ N/2; % xidx = round(size(A,2)/2)-N/2 + 1 : round(size(A,2)/2)+ N/2; % % [yidx(1)...
b24940209e2035fa74486b56a926e18c4d3fabe1c1905c9b8a347db4bfd9605d
MATLAB
1,649
54
%WheelSplit %For very large files that need to be split down clear all; close all; handle = uigetfile('*.csv','Select data'); %identify data file wheelTable = readtable(handle); %load data into table %wheel parameters numWheels = 6; %create matrix with all wheel data minus headers for processing %thi...
28e15cfc0a7a26b527d4d3b07c67cd3ecf3bbb3c6277389e043cb9e5731a8f69
MATLAB
1,650
49
function InitGuiControls(handles) global maingui maingui.buttonVals = struct(... 'RAW',1, ... 'RAW_HRF',2, ... 'OD',4, ... 'OD_HRF',8, ... 'CONC',16, ... 'CONC_HRF',32 ... ); maingui.axesSDG = InitAxesSDG(handles); maingui.axesData = InitAxesData(handles, maingui.axesSDG); maingui.sclConc ...
f6c51e785ddfa48ffe8e610bd1980056b323478823a1a258bb0f63b53c21012a
MATLAB
1,650
59
function output = wildcard2regexp(input) % This replaces a wildcard search by a regular expression. This is little % smarter than regexptranslate for normal users and also works for Matlab % versions without regexptranslate. % % Example: The search 'myfilename*.img' will lead to '^myfilename.*\.img$'; % % by M...
0aead95ddcc72d2c1157ebdae095aa2f093220a14bcaac02303ed7f14e489859
MATLAB
1,651
57
function In = ClusterPoints(Data, IfPlot) %function In = ClusterPoints(Data, IfPlot) % Data is two column matrix of coordinates, IfPlot =1 if you want Data to % be ploted by this function (0, if they are plotter already in current % axes). % starts clustering manual interface like in klusters % - left click - new line...
467c15701463b3917464f65c11550bee307b3c08b2d86079713126c173cf64a6
MATLAB
1,652
51
function n2 = mdndist2(mixparams, t) %MDNDIST2 Calculates squared distance between centres of Gaussian kernels and data % % Description % N2 = MDNDIST2(MIXPARAMS, T) takes takes the centres of the Gaussian % contained in MIXPARAMS and the target data matrix, T, and computes % the squared Euclidean distance between th...
214b2b3a27216351ba2c53188a6a7b7e8f4137eca8ecffb1f69847e89a38bc92
MATLAB
1,654
61
function [res, fmt] = detMag(actigraphy, epoch, varargin) %DETMAG do magnitude analysis and fit results % % [RES, FMT] = DETMAG(ACTIGRAPHY, EPOCH, REGION, FILENAME, STARTTIME, FILEPATH, QUALITY) % performs magnitude analysis on ACTIGRAPHY of epoch % length EPOCH second and fits the results in reg...
f3f4689c00c41e1999e8d9e5950982945b177e1296bad8e02ebaa0cda45282b6
MATLAB
1,655
52
% unit test of mv_stat_wilcoxon_signrank rng(42) tol = 10e-10; % example X with duplicates for debugging: % X = [10 -4 ; 1 10; 40 4; 10, -20; 0 -2; -30 20; 40 2; -10 10] %% [X is a vector] check whether yields the same p-value as matlab's signrank X = randn(100,1)*10 + 2; p1 = signrank(X, 0, 'method','approximate')...
f9aedc0fdd197e0c913050c1ae3571c2a375b605a10e5a1a57e6b168026c7f05
MATLAB
1,655
64
function MatNew = transSegGap(MatOld, Length) %TRANSSEGGAP Transform a matrix of segment/gap to a matrix of gap/segment % % Length specifies the total points of the corresponding signal % % $Author: Peng Li, Ph.D. % MBP, Div Sleep Med, BWH &HMS % $Date: May 4, 2016 % $Modif.: Feb 28, 2017 % ...
66fe015ff8985c9573561b592407260a521001709b0c02ccc86abcd35d6d4f1a
MATLAB
1,656
50
function [ia ib vol] = get_relative_index(subj, patname, maskname) % Returns an index into a mask of the voxels in a pattern xxx % % [IDX] = GET_RELATIVE_INDEX(SUBJ, PATNAME, MASKNAME) % % Returns an index of the items in the pattern PATNAME as masked by % the mask MASKNAME. This is necessary to apply any mask, store...
88b2ea0ab4ea833ff42725e694f019ed5bf831219400fcfdce058a4b278a76fe
MATLAB
1,656
41
clear batch job1{1}.spm.meeg.source.headmodel.D = {fullfile(D)}; job1{1}.spm.meeg.source.headmodel.val = 1; job1{1}.spm.meeg.source.headmodel.comment = ''; job1{1}.spm.meeg.source.headmodel.meshing.meshres = 2; job1{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(1).fidname ...
beb6fe9c62cef8757ae9d10bc75940cd4a11fcb6f08516f163eedfa08454549d
MATLAB
1,656
60
%% Add path addpath(genpath('../../Ionnic Channel'),genpath('../../Tools'), genpath('../../Synapses'), genpath('../../Datas')); %% Import data from neuron (FS) dt = 0.01; Vmem = -90:dt:60; l_V = length(Vmem); %% Anonymous function hinf_simp = @(v) -0.4991*tanh(4.146+...
0fbb8a9e0924c19305388637d367cf9e7a26ebfe6588216d25c5f9bfb4778867
MATLAB
1,657
44
function DistributionSingleCell(histExportFolder, histDataFilename, relMat, diffIm, magMat, angMat, dataBinWidth, relThresh) %% Calculate Histogram Data % Set mainFlowMask mainFlowMask = ... double(relMat > 0).* ... % Where the relMat is > 0 double(diffIm > 0).* ... % Where the diffIm is > 0 double(mag...
298a23dd81dc8f5c480577d39540cd26d5766cb058babb107188b7055ec45d5d
MATLAB
1,657
49
function isUseSection = pickNRandomSections(st,cap,additionalFilter) % This section takes st data structure and picks sections at random. % Will try to get as much diversity as possible. % INPUTS: % st - st data structure % cap - how many files to get % additionalFilter - vector to filter. Sections will be ...
f166140bdafc715a240247297a49d7599af44a61f4b581b73c990f4d796765e9
MATLAB
1,659
55
function perf = cross_entropy(e, x, pp) % Cross-entropy error measure % % [D] = CROSS_ENTROPY(CODE, E, X, PERF, PP) % % Feed this in with class_args to train_bp to change from the % default mean squared error % % See http://www.cse.unsw.edu.au/~billw/cs9444/crossentropy.html % for more information on what it is. % % R...
12156938081a2cac36b2bc79e4796e1743552dc13d1fbb37607cdf2574af012b
MATLAB
1,660
43
function plot_time_comp_nopad_210511(spon_areas_table_ff,stim_areas_table_ff,spon_areas_table_fb,stim_areas_table_fb,subregion) [pre_ff,post_ff]=pre_post_time_comp_nopad_210511(spon_areas_table_ff,stim_areas_table_ff); [pre_fb,post_fb]=pre_post_time_comp_nopad_210511(spon_areas_table_fb,stim_areas_table_fb); p1=line([...
d3418fd8a77f789663f3d2b7fa98cc0a80a8034a5c48a66e614ee4c22a135bd5
MATLAB
1,661
49
function [R,EX,EY,EZ,CH_NAMES] = fiff_getpos_ctf(file,coord_system) % Copyright (c) 2016, Elekta Oy % --------------------------------------- % % Redistribution and use of the Software in source and binary forms, with or without % modification, are permitted for non-commercial use. % % The Software is provided "as i...
1a17c27a056cc63cd1f465e3c35828e5723a781c8a813642e7ca5b1404a1957e
MATLAB
1,663
54
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to validate the specificity of CCA modes % % Jin % 12/4/2023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% set the file path current_path = pwd; working_path = current_pat...
4df0282497679ed96da92dc973b4695aec859046629f23b21be631855348d131
MATLAB
1,663
55
function [a, z, n2] = rbffwd(net, x) %RBFFWD Forward propagation through RBF network with linear outputs. % % Description % A = RBFFWD(NET, X) takes a network data structure NET and a matrix X % of input vectors and forward propagates the inputs through the % network to generate a matrix A of output vectors. Each row o...
7f98e5106c84c510252669f3ff6eead2fa9fe353b0562621acf9aa1bc8b98ce2
MATLAB
1,663
64
function [made_progress] = progress(cur,total,nWaypoints) % Display a text-based progress counter % % [MADE_PROGRESS] = PROGRESS(CUR,TOTAL,[NWAYPOINTS]) % % Displays a progress counter that spits out an 'x%' marker % every 100/nWaypoints of the way through a big loop. By default % then, it will print out every 10%. % ...
c0e6ca42f9cb82b939f6d5e5865e5941d4c2bd9d9a2f155da6d78becac9d5f2e
MATLAB
1,663
59
ndip = 20; snr = [0.6];% 0.5]; snr2 = 0.8;%[0.5 0.8]; amp = [0.4 0.5 0.6];%[0 0.2 0.3 0.4 0.5 0.6 0.7 0.8]; %phs = 2.*pi.*[0 1/17 2/17 4/17 8/17]; patchsigma = 0; N = [50 150];%100; state = rng(1,'twister'); %state = output.state; %list = reshape(1:100,[10 10])'; list = reshape(1:100,[5 20])'; % for now, hav...
7587e94d331f784b20bd48769b2a96024c74adbce0572c1a32c4d8a9653dd76c
MATLAB
1,665
49
function singlePlaneFit = spfCreateFromFiducialLines(f,pixelSize_um) %This function computes a single plane fit using Fiducial Lines. %INPUTS: % f - Fiducial lines structure array % pixelSize_um - optional, pixel size at the Flourecent Image - this will % allow us to cmpute % shrinkage %% Input checks...
c0612f78339aa851efeeeb07ef612158fc9087633b32ba8d95c7520a886af3d0
MATLAB
1,666
84
function info=parse_filename(f,user) if strcmp(user,'Anna_01') info = parse_anna_01_filenames(f); end if strcmp(user,'Anna_02') info = parse_anna_02_filenames(f); end if strcmp(user,'Roman') info = parse_roman_filenames(f); end if strcmp(user,'Lola_01'...
a4f3f2cd4795c78d18e53dd36b03722d2728a6bb0eedaf2b16a4b1ee4bc761ae
MATLAB
1,667
43
% function output = transres_confusion_matrix(decoding_out, chancelevel, varargin) % % Get a matrix of how often each label has been confused by other labels. % This function will calculate the per-class accuracy, i.e. balanced for % the number of occurrences of each label. The output will be percentage % of appearan...
271a1ef968e3b6526da885a41032cc2447aeca048c10ac5d55b883365e072cb3
MATLAB
1,669
64
function meanWaveF = Make_MeanWaveF(fbasename,varargin) % meanWaveF = Make_MeanWaveF(fbasename,option) % Computes average waveform from spk files % % options: % 'spk' (default) | 'dat': reads spike from the spk file of from the dat file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
0e438846a567ecb15857416418000710d21a9dc0727d48bb8e9ccad05f53ed6e
MATLAB
1,670
39
% Got to directory where behavioural data are homeDir = '/export/home/vman/iowa/behav/' datDir = [homeDir]; % Define list of subjects to process subList = {'567','585'}; blockLabels = {{'044','046'},{'060','063'}}; for s=1:length(subList) subID = subList{s}; % Get the number of blocks blockList = {dir([dat...
097c2afb3cd9b70a5b74511ebd9b703b2f8417d603e7c8e47dddaafd89e8d50e
MATLAB
1,671
60
function h = hesschek(net, x, t) %HESSCHEK Use central differences to confirm correct evaluation of Hessian matrix. % % Description % % HESSCHEK(NET, X, T) takes a network data structure NET, together with % input and target data matrices X and T, and compares the evaluation % of the Hessian matrix using the function N...
9ca7f296b42c5252a4fe5f808949d88b17191b32efb31e29c2d57c7a62aa0c13
MATLAB
1,672
55
function net = som(nin, map_size) %SOM Creates a Self-Organising Map. % % Description % NET = SOM(NIN, MAP_SIZE) creates a SOM NET with input dimension (i.e. % data dimension) NIN and map dimensions MAP_SIZE. Only two- % dimensional maps are currently implemented. % % The fields in NET are % type = 'som' % nin = n...
9bb54b1cb52b89111be0c03a2305aa52c95a082532f60ba80ae13d741f305b99
MATLAB
1,674
39
function fw_modelcomp(dir,exp,models) fprintf('\nModel comparison\n') for i = 1:length(models) load(fullfile(dir.dir_fits,strcat('fit-',models{i},'-',exp,'.mat')),'results') fit(i) = results; end bms_results = mfit_bms(fit,0); %Laplace-informed priors % bms_results = mfit_bms(fit,1); %BIC-informed priors ...
957eda339f22bdd953ad4b116ef54d096bf56e91b4cf7fd71026af1db776b8ee
MATLAB
1,676
44
function y=fProcess2(targetdata,targetpath,savepath,calendar,resultShortsatSave) realsavepath=savepath; realtargetpath = targetpath; realtargetdata = targetdata; saveonoff=1; % Save processed dataset as .mat file for cnt=1:length(realtargetdata) data1 = realtargetdata(cnt).name; cd([realsavepath '\' da...
b97133e2f7c2d53321f6caae611aa2eb2e9146b240d9755555061027cf9d4f91
MATLAB
1,676
61
function [acts scratchpad] = test_logreg(testpats,testtargs,scratchpad) % Generates predictions using a trained logistic regression model % % [ACTS SCRATCHPAD] = TEST_RIDGE(TESTPATS,TESTTARGS,SCRATCHPAD) % % License: %===================================================================== % % This is part of the Princet...
e9c71ca99b5d87523c63635b5294ae2497259a0afb730017f2d94b5e6af6b1c0
MATLAB
1,678
52
function [var, U, lambda] = ppca(x, ppca_dim) %PPCA Probabilistic Principal Components Analysis % % Description % [VAR, U, LAMBDA] = PPCA(X, PPCA_DIM) computes the principal % component subspace U of dimension PPCA_DIM using a centred covariance % matrix X. The variable VAR contains the off-subspace variance (which %...
b78b8eb858b66f7615ee315b0538ccd3839d6a7c141940b32865233375f13a60
MATLAB
1,680
52
function [net, options, varargout] = netopt(net, options, x, t, alg); %NETOPT Optimize the weights in a network model. % % Description % % NETOPT is a helper function which facilitates the training of % networks using the general purpose optimizers as well as sampling % from the posterior distribution of parameters us...
9d908e3b5a7e45e21d8f6678dd11b8e2f82b425a7bf530d87c7d9bdce92ac9dc
MATLAB
1,681
74
% this script plots example trials for Jacobs E1. clear all; close all; %% which jobs to complete? job=[]; job.concatGFX= 1; job.plotPFX=1; job.plotGFX=1; %% set up some directories. % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop\tracking-CFS'; homedir='/Users/matthewda...
0f537a1f057682109c768b1ff7e15c32bd627f292ccd070c67ec007d8e0f2e4f
MATLAB
1,683
50
% if trials var already filtered out trials by condition/locations, then % just filter out movieIdx to same criteria. % for fNIRS only % For sbj 08 and 10 function [trials,varargout] = keepCorrectTrials_Single_Special(sbjNum,trials,behFN,numClasses,movieIdx) load(behFN,'responsesV','responsesA','correctRespV','cor...
4f972dd9888b707bab11f9a766f6ecb8a1b006e65fd2f18b623d19e52bc6015e
MATLAB
1,684
58
function [subj] = create_balanced_xvalid_selectors(subj,regsname,old_selname,varargin) % [SUBJ] = CREATE_BALANCED_XVALID_SELECTORS(SUBJ,REGSNAME,OLD_SELNAME, ...) % % Run this after CREATE_XVALID_INDICES. This takes in the % selector group OLD_SELNAME consisting of training and testing % selectors, and balances the co...
be741f6ddb42834e92eb56d6b6a0659e200f7d2e1e3c0c37aed61b8c9c2bc423
MATLAB
1,686
42
function [t,x,ie] = simML(K,params,x_0,T,dt,shift,sigma_noise) %SIMML K, params, x_0, T, dt, shift, sigma_noise % Simulates coupled populations of N Morris-Lecar neurons. % K coupling matrix (N x N non-negative matrix) % params model parameters (structure) % x_0 initial conditions (v...
96ed7274336607272c3b6569b9334f63f043a3004148d23544a7ef091f0cf78f
MATLAB
1,688
49
function field = field_exponentiation(field) % FIELD_EXPONENTIATION Performs a field exponentiation on the provided field. % % field = field_exponentiation(field) % % field - Field to exponentiate %{ Copyright © 2011 by Université catholique de Louvain. Permission is hereby granted, free of charge, to any pe...
0bc1be88c49f46cf5d8af92bf1ad97b8b59bdf4be10482418d8e99283bbebc0c
MATLAB
1,689
36
%Organizes electrode contact labels by depth electrode. %05/27/2021: check that this works for new Emory electrode nomenclature %(i.e. "A'1" for example). %2024/02/25 function clinLFP_contacts=extract_clinLFP_labels(labels_array) %remove micro contacts if there are any: labels_array(contains(labels_array,'Micr...
3acf1e9edbce5c7c221190b339584d143e05fe2988ad37537d4e600790b5ffb5
MATLAB
1,690
43
function corr_mtx_r = compute_temporal_closeness(train_model_fname, test_model_fname, test_data_fname) %% ----------------------------------------------------------------- % This script is used for matching states from different BSDS models. % A trained model was applied on the test data to compute posterior probabili...
c412d08e2de94130df83267bbe1d636c2b779ec3837d1b1f663b65e4c6444ec0
MATLAB
1,691
53
%{ Copyright (C) 2023 N. Suhas Jagannathan This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed i...
3ae3f00f27d647cdda4290f270eaa504e64b7aa1e92a8865c26ac9f11d8e9488
MATLAB
1,692
54
function [scratchpad] = train_smlr(trainpats,traintargs,in_args,cv_args) % Trains sparse multinomial logistic regression (SMLR) to predict your regressors % % [SCRATCHPAD] = TRAIN_SMLR(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS) % % Trains a Sparse Multinomial Logistic Regression (SMLR) algorithm % to predict regressors of i...
e707e041ac3d013097a014c77fe1a383baeff6b02d95dba4f54436aabd2d3ea3
MATLAB
1,692
51
%% Import data from text file % Script for importing data from the following text file: % % filename: /dagher/dagher11/filip/Obesity_maps/Final_results/PLS1_catWeights_BMI_DBM_Cammoun_LHRH.csv % % Auto-generated by MATLAB on 14-Mar-2023 10:47:42 close all %% Set up the Import Options and import the data opts = delim...
5ce5d5d32bd2106f6609489b73106a6eca871796dd97e082183af82570e00d83
MATLAB
1,696
63
function [returnVar,msg] = RemoveDCfromDat(fname,nbChan) % USAGE: % RemoveDCfromDat(fbasename,shankIx,chanIx) % This function removes DC from dat files by computing the average of % the first 1e6 samples (or less if file is smaller) % INPUTS: % fname: dat file name % nbChan: total number of channel...
8c36909aaf11cb640b8f0e05e3cde77a06c7b53bba5ad1f7097e0cc0e64ea45d
MATLAB
1,699
67
% SYNTAX: % y2 = hmrR_BandpassFilt_Nirs( y, fs, hpf, lpf ) % % UI NAME: % Bandpass_Filter % % DESCRIPTION: % Perform a bandpass filter % % INPUT: % y - data to filter #time points x #channels of data % fs - sample frequency (Hz). If length(fs)>1 then this is assumed to be a time % vector from which fs is estimated...
251026be194a51a3239f5559aa10c541a3a5a696970356913ea4c25217a61a9d
MATLAB
1,700
74
function [X,Y,GoodRanges,wstruct] = LoadPosition_Wrapper(fbasename,epoch) % loads position and speed from a position file file (ending in .whl) % % USAGE % [X,Y,V,GoodRanges,wstruct] = HeadDirectionWhl(fbasename) % % INPUT: % fbasename: session file basename % % OUTPUT: % X: a tsd object of x positio...
364b40c1b69bfb11881d1ed806bb973b6e3cb73e62619a7f8377dc7d770953f4
MATLAB
1,701
52
function NMI_Cluster_Combination_211115(folder_address,if_cw,parent_dir,length_rec_sec) cd(folder_address) times_dir=dir('times_*.mat'); times_name=string({times_dir.name}); fprintf('Calculating NMI...\n') compute_NMI_210726(folder_address,parent_dir,if_cw) load('matching_table_wNMI.mat') % Loads matching table (as...
c7ed21e04755dcd5c6ee559fa23a2f23155558b4aa601173bf247998a51959ac
MATLAB
1,701
64
function smp = bv_readsmp(fname) % smp = bv_readsmp(fname) % % :description % % Reads in a version 2 (BV 2000) or 3 (BrainVoyager QX) SMP file. % % :inputs % % fname file to read, e.g. 'myflatstats.smp' % % :outputs % % smp smp structure. List this function to see the field % ...
fb3dbef7ff31c26bddaca7546cd50bdeda466aee2e1faefacc19cba24e2b1beb
MATLAB
1,701
74
function photo_plots(params, data, plotname) if strcmp(plotname,'deinterleaved signals') fig=figure(); title('deinterleaved s') hold on plot(data.time,data.iso,'m') plot(data.time,data.physio,'b') legend({'iso', 'physio'}) smart_save_figures(fig, params.figur...