sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
ec9705366a374eeb99856eb533dcbfa31ff0b6c19b7278025ec124cba2b15486
MATLAB
4,697
144
% Name: Robert Kim % Date: 11-15-2023 % Email: robert.f.kim@gmail.com % plot_one_modality.m % Description: Render the 4x4 lesion-effect boxplot grid for the two-layer % one-modality (instr) RNNs (Fig. 6 / supplementary). Reads the per-lesion % .mat files written by one_modality_two_layer_lesion_across_models.m and % ru...
e06f1b68ebe7b02bf3725fc77af0976085b922a19a09487e62337c51712b5c66
MATLAB
4,699
110
function handles = plot_arrow( x1,y1,x2,y2,varargin ) % % plot_arrow - plots an arrow to the current plot % % format: handles = plot_arrow( x1,y1,x2,y2 [,options...] ) % % input: x1,y1 - starting point % x2,y2 - end point % options - come as pairs of "property","value" as defined fo...
ccc249a261f354639abcbc597e2832cb808882d7caedd742f5e7ce575b1dfaae
MATLAB
4,700
122
% pop_plottopo() - plot one or more concatenated multichannel data epochs % in a topographic array format using plottopo() % Usage: % >> pop_plottopo( EEG ); % pop-up % >> pop_plottopo( EEG, channels ); % >> pop_plottopo( EEG, channels, title, singletrials); % >> pop_plottopo( EEG, channels, t...
643b598a539009c412f69e9f9935fa0e28b578dd1369f8fd45eff9587b670a21
MATLAB
4,702
95
function [dS,t,f]=mtdspecgrampb(data,movingwin,phi,params) % Multi-taper derivatives of time-frequency spectrum - binned point process % % Usage: % % [dS,t,f]=mtdspecgrampb(data,movingwin,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E i...
99fe631e1da9ec13d8bf99399b10542b52e70094cd7488c068f5e886d8144381
MATLAB
4,704
94
function [dS,t,f]=mtdspecgramc(data,movingwin,phi,params) % Multi-taper derivative of the time-frequency spectrum - continuous process % % Usage: % % [dS,t,f]=mtdspecgramc(data,movingwin,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E is...
848723323fe89ba92ce378004f0680c9a87a052104bc7f375846a5b023d80211
MATLAB
4,705
86
function [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencyc(data1,data2,params) % Multi-taper coherency,cross-spectrum and individual spectra - continuous process % % Usage: % [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencyc(data1,data2,params) % Input: % Note units have to be consistent. See chronux.m for more informat...
8a9c827e367131d069a9466d13c4c169755f2ecf537ed9d765e575bfd0fa9fae
MATLAB
4,707
102
function [S,t,f,Serr]=mtspecgramc(data,movingwin,params) % Multi-taper time-frequency spectrum - continuous process % % Usage: % [S,t,f,Serr]=mtspecgramc(data,movingwin,params) % Input: % Note units have to be consistent. Thus, if movingwin is in seconds, Fs % has to be in Hz. see chronux.m for more information. % ...
a9c6a935fefe481412579e88f408c99b10747ecc8e53950da6f33d4ae0f5047a
MATLAB
4,708
261
% This function takes a problem in SeDuMi MATLAB format and writes it out % in SDPpack format. % % Usage: % % writesdp(fname,A,b,c,K) % % fname Name of SDPpack file, in quotes % A,b,c,K Problem in SeDuMi form % % Notes: % % Problems with complex data are not allowed. % % ...
e9bb3b148924cb3305a8ad540597751b43083a8f95a905269ae8f751792b5f57
MATLAB
4,708
164
% Tri-state bus sizing and topology design % Section 5.4, L. Vandenberghe, S. Boyd, and A. El Gamal % "Optimizing dominant time constant in RC circuits" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 11/27/05 % Modified by Michael Grant - 3/8/06 % % We optimize a tri-state bus connecting six node...
471fc29134c7fbeebe64fd5aaf7a9775b0a737894f0d6c78711469b22ac06180
MATLAB
4,711
131
function postprocess_write_file_for_parameters(filename_prefix, ... Theta, Theta_samples, bayes_factors, names) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers dynamical systems models from microbiome time-series datasets, and % predicts biologically re...
e605b300e4b7a6cb9208880f6f84b62151a1b921b95378f4cfca1454a78a5130
MATLAB
4,711
197
function out=test_benchmark % % David Gleich % Copyright, Stanford University, 2007 % % % 9 July 2007 % Initial version % %% History %% % 2008-10-07, Version 2.1, Matlab 2007b, boost 1.33.0, % g++-3.4 (lib), gcc-? (mex) % airfoil west cs-stan minneso tapir % large 0.223 s 0....
44e62f45b30a07b69aec749f30530957e1decc4dd2dbb6489f1423645bd52e7f
MATLAB
4,713
149
function [ redred, localred ] = DoubleRedundancyMMIDiscrete(varargin) %%DOUBLEREDUNDANCYMMIDISCRETE Compute the PhiID double-redundancy of discrete % input data using the MMI PID. It uses a plug-in MI estimator first to find % the MIB, and then uses a data-efficient quasi-Bayesian estimator to compute % the double-redu...
dff44cf1864deab1d91e209510ebb9512314046672a83798abdc7c98228c871c
MATLAB
4,713
132
function [dist,angles,stats] = PhaseDistribution(phases,varargin) %PhaseDistribution - Compute phase distribution. % % USAGE % % [dist,angles,stats] = PhaseDistribution(phases,<options>) % % phases phases % <options> optional list of property-value pairs (see table below) % % ================...
4bfbc74361ccb3dc9a753214c70c0db2e96c24ac0a3aacef154577c04b320f3c
MATLAB
4,714
131
function nii_deface(in) % Syntax: NII_DEFACE(in) % input can be a single anat 3D NIfTI, or BIDS folder containing sub-* folders. % If no input is provided, a file/folder dialog will pop up. % % NII_DEFACE removes face and neck structure from T1w/T2w NIfTI. % % How does this code deface? % 1. A xform matrix is est...
07bc601ee90e76606e63abacdca3d7995a22b793ec8864eb6162ddd5b39e7053
MATLAB
4,717
94
function [dS,t,f]=mtdspecgrampt(data,movingwin,phi,params) % Multi-taper derivative time-frequency spectrum - point process times % % Usage: % % [dS,t,f]=mtdspecgrampt(data,movingwin,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E is in secs, wi...
22a2563e71ca2d1c817470f7f255c62cdb8389ff740e9bcba3404dc4c27645f9
MATLAB
4,719
126
function ea_lcm_func(options) if strcmp(options.lcm.func.connectome,'No functional connectome found.') return end disp('Running functional connectivity...'); if iscell(options.lcm.seeds) if length(options.lcm.seeds)==1 options.lcm.seeds=options.lcm.seeds{1}; % supply as char end end try exportgmt...
c4a3bc5d5d1112cefb550fe310ff0b648aee6b8ac7291ccbb54241e60edd8552
MATLAB
4,719
99
function [dense,Adotdden] = getdense(At,Ablkjc,K,pars) % [dense,Adotdden] = getdense(At,Ablkjc,K,pars) % % GETDENSE Creates dense.{l,cols,q}. % Try to find small proportion of the cone primitives that appear % in a large proportion of the primal constraints. % % ******************** INTERNAL FUNCTION OF SEDUMI ***...
fc8d0b63092537a630ac43f0822cf833ebbb2365a5c7691b066500b2ad19f436
MATLAB
4,719
110
% %% Load data for 'P_replay' (Fig.4F) and '|Lseq|' (Fig.4G) % load('candidates_excluded.mat'); % candidates based on pupil width % load('result_replay_CA1.mat'); result_replay_CA1 = result_replay; % load('result_replay_VIS.mat'); result_replay_VIS = result_replay; % n_ses = size(result_replay_CA1,1); % n_candidat...
61102208afd06dc8913266bfa210b14ae863fffeaf477b8ceb213a310b445058
MATLAB
4,723
137
function [f, pp] = make_box_plot2_swarm_title(plot_an, plot_aw, colL, colR, titlename, markerSize, markerAlpha, jitterWidth, null99_an, null99_aw) % make_box_plot2 : swarmchartを使った簡易ヒゲなし箱ひげ図 % MATLABのswarmchart関数でデータをプロットし、Q1-Q3を太い線で表示、中央値を〇で表示します。 % null distributionの99%ラインを点線で表示します。 % ※ MATLAB R2020b以降が必要です %...
aeb499c80aab90989740b51f20c074337427c38c50bdb66c588b187a99034885
MATLAB
4,723
129
function [coeff,local] = CV(timestamps,varargin) %CV - Compute coefficient of variation for a point process. % % Three alternative measures can be computed: regular CV, CV in operational time % (Gestri and Petracchi, 1970; Nawrot et al., 2008) or CV2 (Holt et al., 2006). % % While the CV is typically computed for cons...
0f73cea496b730583bbf7a2bf6a06a044c956b7b2e6a5827d31f9ddf2911125d
MATLAB
4,739
119
function [map,stats] = FiringMap(positions,spikes,varargin) %FiringMap - Compute firing map (e.g. for a place cell). % % Compute firing map (e.g. for a place cell), as well as occupancy and spike % count maps. Optionnally, field statistics can also be computed, including % in-field peak and mean firing rates, firin...
7ee1dbbf41407ffe147d44f072bc1d662308ae37f23ed6efa6277dad2a99b884
MATLAB
4,742
157
typeArray = [allflies.trtype]; for i = 1:16 inds{i} = find(typeArray==i); end flyArray = [allflies.flyID]; for i = 1:max(flyArray) inds{i} = find(flyArray==i); end %% Left Turns % TO DO THIS, YOU NEED TO RUN THE CONTENT OF COMPUTETURNBOUTS2.M Lturns = {}; leftPB = []; rightPB = []; turnLdata =...
48a17b14b426d5c0bfe765e9483b8dffa2ae8bfffb966a7bb32813584b5bc9d9
MATLAB
4,743
153
classdef ( Hidden, Sealed ) PointerManager < handle %uix.PointerManager Pointer manager % Copyright 2016 The MathWorks, Inc. % $Revision: 1435 $ $Date: 2016-11-17 17:50:34 +0000 (Thu, 17 Nov 2016) $ properties( SetAccess = private ) Figure % figure end properties( Acces...
9e166acde9ad78bc64605e0a9aa0e672d70e8f9095685670ac1ffa7cfdfa7c57
MATLAB
4,744
88
function ClincFreq_AffVolStat(INDIR,OutAffVoldir,SetUpPara,Para,AtlasTempU) for i = 1:length(SetUpPara.ParaOut) LabName = SetUpPara.ParaOut(i).LabName; AffVoldir{i} = [OutAffVoldir,filesep,LabName,filesep]; if length(dir([AffVoldir{i},'ROIWise',filesep,AtlasTempU{1,3},filesep,'Group*AffVol...
b5ce535eb5fae97694eb298e51dcd0ef5f82e9332c545c96f9f8649d0e5f7e53
MATLAB
4,744
169
% THIS SCRIPT extracts region averages and local pattern expression in each % parcel of the Shen 2013 atlas % % - extracts local parcel means and all local pattern expression for all signatures. % - Preps file Parcellation_data.mat saved in "results" folder. % - Allow us to compare local pattern expression across pa...
5221c8535515345aac3c953a92f7c12674ed81b8f642750fb961e0f06fdafffe
MATLAB
4,745
146
% qqdiagram() - Empirical quantile-quantile diagram. % % Description: % The quantiles (percentiles) of the input distribution Y are plotted (Y-axis) % against the corresponding quantiles of the input distribution X. % If only X is given, the corresponding quantiles are plotted ...
62c95fb118bed6da4af2396e831244965c0a8e01a3a7b80e8cb4cc4cbd1ca04f
MATLAB
4,746
93
function data=rmlinesc(data,params,p,plt,f0) % removes significant sine waves from data (continuous data). % % Usage: data=rmlinesc(data,params,p,plt,f0) % % Inputs: % Note that units of Fs, fpass have to be consistent. % data (data in [N,C] i.e. time x channels/trials or a single vector) - required. % ...
996ff78c35ea3244b0cc865e11bc33d0158aefda543b82ea430d718a23a11717
MATLAB
4,747
129
function [n_cnt,con_mat,pval]=ea_NBSfdr(varargin) %NBSfdr Simes procedure to determine edges surviving a false discovery %rate (FDR) threshold. A p-value for each edge is determined using %permuted data that has been supplied as part of the structure STATS. % % [N_CNT,CON_MAT,PVAL]=NBSfdr(STATS) operates on th...
52370faf5c20c03bf97c77c6582a88337c02db33f0453dd4d7a9c39f7c456683
MATLAB
4,749
110
function [sm,dE2_mat] = get_shear_modulus_LE(Npts,P0,V,newC,gamma,ka) % GET_SHEAR_MODULUS_LE Compute the athermal (zero-temperature) shear % modulus of the tissue at a given strain, splitting it into affine and % non-affine contributions, under Lees-Edwards (sheared) periodic % boundary conditions. % % [sm, dE2_mat]...
fd63173d2e89e22ac6a3ef8f304b52b02736d03a9612b6d405a352c7c575c365
MATLAB
4,750
127
function upSetPlot(data, labels, figH, setSizeColor) % More info on UpSet plots in the original publication: % Alexander Lex, Nils Gehlenborg, Hendrik Strobelt, Romain Vuillemot, % Hanspeter Pfister. UpSet: Visualization of Intersecting Sets % IEEE Transactions on Visualization and Computer Graphics (InfoVis), % 20(12)...
5b6c3e601042d8e85484bb16d8cfe71fd113218c7750a42a194b01ee6e82763d
MATLAB
4,752
150
function output = ea_checkStimParams(stimFile) % Check if "S" is compatible with the latest format. Fix when necessary. % % Input can be stimparameters file or group analysis file. % Output will be "S" or "M" (with "M.S" updated). updated = 0; stimFile = GetFullPath(stimFile); vars = who('-file', stimFile); if ismemb...
65752ce5ed227c24da5ce2ac69e563ed7fa5fdfcd05d8d86e0ce7526c0a06cd5
MATLAB
4,754
142
function speedTable = cellSpeeds(compiledData, outputFolder, options) % CELLSPEEDS Calculate speed metrics for each tracked cell from % compiled tracking data produced by compileResultsCSV. % % For each cell track, computes average speed, cumulative speed, and % speed variance over the full period, as well as the firs...
47e8d6f695ea4bef270ccef7401aeee8473995dbec8a6bcd201ba02ecc05bb5a
MATLAB
4,755
180
figtitlebase = 'BucknerLab rsFMRI Cosine Similarity Wedge'; image_set_name = 'bucknerlab'; % keyword for named set to pass into load_image_set [mapset, netnames] = load_image_set(image_set_name); mycolors = seaborn_colors(length(netnames)); k = length(DAT.conditions); myfontsize = get_font_size(k); % This is a fu...
6789bafbdddb4516034e6106f45ffe0986e496da6f54818018c59f7c2f6fc928
MATLAB
4,761
142
function showMovie(data,subim,wl,pausetime,mycmap,do_write) % Usage ... showMovie(data,subIm,wl,pauseTime,cmap,writeims) % % data is a 3-dim variable with time images to show % when subIm is supplied, subtracted images will be showed % wl will fix the windowing to [min max] if specified % pauseTime will show the ...
787d9d53672a20579148e00ec108ebb2fddbbca369e30735fbeef67b2305f526
MATLAB
4,776
172
% Optimal interconnect wire sizing % Section 5.1, L. Vandenberghe, S. Boyd, and A. El Gamal % "Optimizing dominant time constant in RC circuits" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 11/25/05 % Modified by Michael Grant - 3/8/06 % % we consider the problem of sizing an interconnect wire t...
e4e87be5a475da2b2eaf6baaeeef0f06278af53fb28addeb1517a13a5c089995
MATLAB
4,776
121
%% Core numbers in MatlabBGL % This example illustrates the concept of the core number of a vertex. % Mathematically, the core number of a vertex v is the largest integer c % such that v has degree > 0 when all vertices of degree < c are removed. % Equivalently, the core number of vertex v is the largest integer c such...
0ebe59aae92d3b55017f185568b418ee98a922026432d1c0958a621b4fb4aa87
MATLAB
4,786
120
function settings = ea_switch2VATgrid(options, S, settings, side, outputPaths) % Change connectome fibers to a regular grid aligned with the electrode % (classic VAT). % For parameters, see ea_till_creategridforelectrode. % By Dembek, Butenko and Li, konstantinmgtu@gmail.com arguments options % Lead-DBS option...
e6af5f19a71d82bf6446b98248ed67fa24d7ca2d00b412f83000c215df4a5012
MATLAB
4,790
105
function [S,t,f,R,Serr]=mtspecgrampb(data,movingwin,params,fscorr) % Multi-taper time-frequency spectrum - binned point process % % Usage: % % [S,t,f,R,Serr]=mtspecgrampb(data,movingwin,params,fscorr) % Input: % data (in form samples x channels/trials or single vector) -- required % movingwin ...
a3c16749c91ffa2f5976fb3977089e64d58c2cb8de4f03552425485ddbb17417
MATLAB
4,791
86
function [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencyc(data1,data2,params) % Multi-taper coherency,cross-spectrum and individual spectra - continuous process % % Usage: % [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencyc(data1,data2,params) % Input: % Note units have to be consistent. See chronux.m for more in...
d6cb589d043328e3bc5198243e9c94dfca49cc62d6c9a1e5ba34267e7a015b62
MATLAB
4,791
116
function ivals = glmnetControl(pars) % DESCRIPTION: % View and/or change the factory default parameters in glmnet % % USAGE: % glmnetControl; (with no input or output arguments) % displays all inner parameters and their current values. % glmnetControl(pars); % sets the internal parameters that appear in the...
c7153ee35aa1b863739ad718a9620c55b9efc6e4ab93524f2048ec63610cf655
MATLAB
4,793
152
function [d, xd, bw] = kernelDensity(x, bins, h, kernel) %KERNELDENSITY Calculate the kernel density of a data set % % [D, XD] = IOSR.STATISTICS.KERNELDENSITY(X) calculate the kernel density % D of a dataset X for query points XD. The kernel density is calculated % for 100 query points equally spaced between t...
4096a8dcd070533f808b4f83538f03ed9d349e4bb8cddd4d3f0bdff1dd90060e
MATLAB
4,794
129
function [vertices, label, colortable] = read_annotation(filename) % [vertices, label, colortable] = Read_Brain_Annotation(annotfilename.annot) % % vertices expected to be simply from 0 to number of vertices - 1; % label is the vector of annotation % % colortable is empty struct if not embedded in .annot. Else, it will...
bfbfb48edd68d3c0401119bc80568144b7c0bca20e1fe2a6b9c0cb1b841d823c
MATLAB
4,800
129
function [vertices, label, colortable] = Read_Brain_Annotation(filename) % [vertices, label, colortable] = Read_Brain_Annotation(annotfilename.annot) % % vertices expected to be simply from 0 to number of vertices - 1; % label is the vector of annotation % % colortable is empty struct if not embedded in .annot. Else, i...
56a0ca549a4bc127ba90628fc81987c01debe6f4f09ba5847c0ab488a9cad77a
MATLAB
4,802
137
function CBIG_pMFM_step5_generate_STDFCD_correlation_main() % This function is used to generate the correlation between the empirical % and simualted SWSTD of timecourse. The results corresponds to the figure % 6A, 6B and 6C in the paper. % % There is no input for this function as it can automatically get the % output...
c03e3b7cb90b6aa4bc57be0750c903ec783f0fbd1f30d8ea035d1e55418fd397
MATLAB
4,809
102
function [S,t,f,Serr]=mtspecgramc(data,movingwin,params) % Multi-taper time-frequency spectrum - continuous process % % Usage: % [S,t,f,Serr]=mtspecgramc(data,movingwin,params) % Input: % Note units have to be consistent. Thus, if movingwin is in seconds, Fs % has to be in Hz. see chronux.m for more information...
417a8cd11fc55ad515d60b2db8d79bda88cb10697df598dfa6803a8e59e901f5
MATLAB
4,811
94
function [dS,t,f]=mtdspecgrampt(data,movingwin,phi,params) % Multi-taper derivative time-frequency spectrum - point process times % % Usage: % % [dS,t,f]=mtdspecgrampt(data,movingwin,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E is in ...
fdfc454ca1b1e2c5689b89d5bc755fe4730d1ab767fd327663ea54e8be97ad5f
MATLAB
4,813
148
function [maps,stats] = SurveyFiringMaps(units,varargin) %SurveyFiringMaps - Compute and plot firing maps for all subsessions. % % USAGE % % [maps,stats] = SurveyFiringMaps(units,<options>) % % units optional list of units, i.e. [electrode group, cluster] % pairs; set cluster to -1 to...
a81ad38a43a5b6465dd3fb4833de408d083eb9d59b14ae4644ac2714e1ae3af8
MATLAB
4,815
101
function [datafit,Amps,freqs,Fval,sig]=fitlinesc(data,params,p,plt,f0) % fits significant sine waves to data (continuous data). % % Usage: [datafit,Amps,freqs,Fval,sig]=fitlinesc(data,params,p,plt,f0) % % Inputs: % Note that units of Fs, fpass have to be consistent. % data (data in [N,C] i.e. time x cha...
88ebbee537d3240b1f1d2293b95719d3d099156ee7a79784b9282e4b7ddcc2c8
MATLAB
4,816
107
function [pamlist,FilesExist] = ea_discfibers_getpams(obj) % Return list of PAM results % always initialize with entries for mirrorred stims % mirror flag will be checked in ea_discfibers_calcvals_pam numPatient = length(obj.allpatients); pamlist = cell(numPatient*2,2); FilesExist = zeros(numPatient,2); % no sense to...
9cda1f61baa35743a56f15319b3ede983be1736589a42eaf4c1d27b82c9168ee
MATLAB
4,816
126
function mTrackChopped = simpleTrackChop(simpleTrack, m) % SIMPLETRACKCHOP : chops the simpleTrack into m tracklets and return the chopped tracklets. % % SYNOPSIS: mTrackChopped = simpleTrackChop(simpleTrack, m) % % INPUT: simpleTrack : (structure) contains 1 row (1 track) with fields % .t...
4b886bc1d221165af2cbe70a57dd279888fbd5c3cbbb1211f766a33056b6e88e
MATLAB
4,817
128
function [Temptrace, tempRoi, handles] = Segmentation_autoThresh(handles, disppara) if nargin<2 disppara=1; end scrsz = get(groot,'ScreenSize'); pos_seg = round([scrsz(3)*0.1 scrsz(4)*0.55 scrsz(3)*0.4 scrsz(4)/3]); mov = handles.mov; mov2d_filt = handles.mov2d_filt; %%%%%% setup parameters areathreshold = handles...
290c65f7e4188814d2eb85757ab47fe8340d8a09cace33ae3d919cf8714bb462
MATLAB
4,821
135
% pop_savestudy() - save a STUDY structure to a disk file % % Usage: % >> STUDY = pop_savestudy( STUDY, EEG ); % pop up and interactive window % >> STUDY = pop_savestudy( STUDY, EEG, 'key', 'val', ...); % no pop-up % % Inputs: % STUDY - STUDY structure. % EEG...
b53f80dd3f837c740a244872fdaab4cb5acf34788bf1c572b4437f751931ad8c
MATLAB
4,821
104
function [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Multi-taper time-frequency spectrum - point process times % % Usage: % % [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Input: % data (structure array of spike times with dimension channels/trials; % also ...
46866bfb52d12513ef120a578450555800d4b46571fefc592eb357df0427b834
MATLAB
4,822
95
function ClincFreq_CalHeatNum(INDIR,OutHeatdir,SetUpPara,Para,AtlasTempU,dbmask) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; for i = 1:length(SetUpPara.ParaOut) LabName = SetUpPara.ParaOut(i).LabName; HeatDir{i} = [OutHeatdir,filesep,LabName,filesep]; m...
4f56c2b93106602d7ea92a9cecf4e9cb947d36a60320b7bbb41eabcda3872023
MATLAB
4,822
113
% plotsphere() - This function is used to plot a sphere and % project them onto specific surfaces. This may % be used for plotting dipoles for instance. % % Usage: % >> handle = plotsphere(pos, rad, 'key', 'val') % % Inputs: % pos - [x y z] 3-D position of the sphere center % ...
ceb4b81b4a7f2467707b1627ef9d4523c80525bda71e71cd97168667a7354a09
MATLAB
4,825
126
% eegthresh() - reject trials with out-of-bounds channel values within a % specified epoch time range. % % Usage: % >> [Iin, Iout, newsignal, elec] = eegthresh( signal, frames, ... % elecs, negthresh, posthresh, timerange, starttime,endtime); % % Required inputs: % signal - 2-D da...
e3314200b3603edbaa69a6f9fc0f861ba8dd93d5a4ef0c521d0c6d8552abad29
MATLAB
4,827
120
% Name: Robert Kim % Date: 05-13-2023 % Email: robert.f.kim@gmail.com % one_modality_intact_across_models.m % Description: Evaluate the INTACT one-layer one-modality (instr) RNN models % across all 5 trained networks. Generates 400 random instruction-task trials % per network, scores anti-DMS / pro-DMS performance, and...
8fdceea4ad6b2cfca45f12e1f3949b2b5271a9e75a0b72c9e3230fa594ede3eb
MATLAB
4,829
133
%% Preprocess Data %Run one animal's data through this pipeline at a time %Input = directory containing full recording data from a single animal. %This should consist of raw intan files where each file contains one %minute of data from all channels. %Output = an experiment directory for this animal/recordi...
dcf34080a9cb449560370e6fd6dcf8e00b40189b81d1fcea4992d04732f46c0d
MATLAB
4,830
129
function varargout = save(tree, filename) % XMLTREE/SAVE Save an XML tree in an XML file % FORMAT varargout = save(tree,filename) % % tree - XMLTree % filename - XML output filename % varargout - XML string % % Convert an XML tree into a well-formed XML string and write it into % a file or return it as a string i...
ebf235b7bf01cdd8212278363d4b854467fcdae51572257ecd4fdce869cf219d
MATLAB
4,831
93
function data=rmlinesc(data,params,p,plt,f0) % removes significant sine waves from data (continuous data). % % Usage: data=rmlinesc(data,params,p,plt,f0) % % Inputs: % Note that units of Fs, fpass have to be consistent. % data (data in [N,C] i.e. time x channels/trials or a single vector) - requi...
b6daa48b164a164fb6f9bc744a2d7ce572d5bebb17bc5f96131c75a14c44cd94
MATLAB
4,832
124
function [TypeOfSpike,BurstStarts,BurstEnds,BurstDurations,NumSpikesInBursts,numberBursts] = BurstDetect(spikeTimes_msec, BurstThreshold_msec, TailThreshold_msec, minNoSpikes) TypeOfSpike = zeros(1,length(spikeTimes_msec)); if spikeTimes_msec(2) - spikeTimes_msec(1) < BurstThreshold_msec TypeOfSpike(1) = 1; % 1 fo...
e25b85412b0ab4dfde200f0fbcf61e92bb36d64d3944e25de2b37efbe03ce793
MATLAB
4,833
143
% pop_dipfit_gridsearch() - scan all ICA components with a single dipole % on a regular grid spanning the whole brain. Any dipoles that explains % a component with a too large relative residual variance is removed. % % Usage: % >> EEGOUT = pop_dipfit_gridsearch( EEGIN ); % pop up interactive window % >> EEGO...
236494c93140d842901e6076374c76eb1b2a2acd1359a228514bf6a42307d888
MATLAB
4,838
129
function varargout = save(tree, filename) % XMLTREE/SAVE Save an XML tree in an XML file % FORMAT varargout = save(tree,filename) % % tree - XMLTree % filename - XML output filename % varargout - XML string % % Convert an XML tree into a well-formed XML string and write it into % a file or return it as a string i...
843f4f7c89c9217e89beac06be9c80f90355fb3fb485e51d1c33348312290fa6
MATLAB
4,839
140
function [matched,only1,only2] = Match(list1,list2,varargin) %Match - Replace values in one list with closest values in a second list. % % USAGE % % [matched,only1,only2] = Match(list1,list2,<options>) % % list1 first list % list2 second list % <options> optional list of property-va...
313ae29fa83bb14dc66ed29b4bb2d487a6791375fb29badb7da1f43bc82dabe3
MATLAB
4,840
112
function ea_CaptureFigVid(ViewZ, FileName,OptionZ) % CaptureFigVid(ViewZ, FileName,OptionZ) % Captures a video of the 3D plot in the current axis as it rotates based % on ViewZ and saves it as 'FileName.mpg'. Option can be specified. % % ViewZ: N-rows with 2 columns, each row are the view angles in % ...
110c1061c9d2c92e22e80e579e6549b64388735030230b229fd226112529da5a
MATLAB
4,842
135
% Minimize order of a lowpass FIR filter (magnitude design) % "FIR Filter Design via Spectral Factorization and Convex Optimization" % by S.-P. Wu, S. Boyd, and L. Vandenberghe % (figures are generated) % % Designs an FIR lowpass filter using spectral factorization method where we: % - minimize the filter order % - hav...
ef93ea3768c015ee225abae2c3978b5a498d971496abf17c60ec74e9bb2d6819
MATLAB
4,843
108
function [stress_tensor, cell_stress] = get_viscous_qvm_stress(V, C, topo, KP, P0, KA, A0, strain, Fvx, Fvy) % GET_VISCOUS_QVM_STRESS Compute the tissue-level and per-cell stress % tensors, including the viscous (cell-cell adhesion) force contribution, % under Lees-Edwards (sheared) periodic boundary conditions. % % ...
e6f98645d0df3335fb2ef0a5538cce3cc5393c74027b6e739ce7a406b3580662
MATLAB
4,848
64
function para_default = defaultparameter % ------------------ edit with caution --------------------------------- %% movie denoise for feature detection (Don't change these parameters unless you are confident) para_default.GaussKernel = [4, 4, 2]; % movie denoise kernel (kernel size, kernel size, kernel SD) para_def...
c6df346186f808b0e66bcf08d1a70f28032fbf7b755056a7ef0c58a4fae9441f
MATLAB
4,849
43
%Admin functions (adminfunc folder): % <a href="matlab:helpwin abouteeglab">abouteeglab</a> - No help information % <a href="matlab:helpwin eeg_checkchanlocs">eeg_checkchanlocs</a> - Check the consistency of the channel locations structure... % <a href="matlab:helpwin eeg_checkset">eeg_checkset</a> ...
dc1e4b704067367a679e636c7d295f6534629fc5b756e8a15e9f03ccb7e90310
MATLAB
4,850
157
function [data,t] = SurveyCCG(units,varargin) %SurveyCCG - Compute and plot cross-correlograms (CCGs) for all subsessions. % % USAGE % % [data,t] = SurveyCCG(units,<options>) % % units optional list of units, i.e. [electrode group, cluster] % pairs; set cluster to -1 to process all cl...
f0d721e5ae9f009a2ae5deab348b607ce6ae90823d5a151ec6e1a4d8045d5121
MATLAB
4,857
174
function [t,amps,data,aux] = read_intan_data(filename) % [t,amps,data,aux] = read_intan_data % % Opens file selection GUI to select and then read data from an Intan % amplifier data file (*.int). % % t = time vector (in seconds) % amps = vector listing active amplifier channels % data = matrix of electrode-r...
3ff21b080efe6125eb5335bf42b8e7c02c3b7e9dd3e573437d46c0ad603e7179
MATLAB
4,864
173
function keep_con = bz_PlotMonoSyn(ccgR,sig_con,Pred,Bounds,completeIndex,binSize,duration) % Manual sorting %click to delete the ccg (turns pink) keep_con = sig_con; window =false(size(ccgR,1),1); window(ceil(length(window)/2) - round(.004/binSize): ceil(length(window)/2) + round(.004/binSize)) = true; halfBins =...
204a4fbf8a31520a3c80c45be5bad9c08704a5e02dbf466dc7923bd357763552
MATLAB
4,865
175
function [ SM ] = WriteTopicsMult( WPM , BETAM , WOM , K , E , M , FILENAME ) %% Function WriteTopicsMult %% % |[ SM ] = WriteTopicsMult( WPM , BETAM , WOM )| writes the most likely entities % (e.g. words, authors) per topic to a cell array of strings |SM|. The % difference with function WriteTopics is that for ea...
2b8e75bc3b23a98a9906eb0a41d9a551e733fa7732d173864951c10d83c3d0ac
MATLAB
4,869
178
function hpol = myPolar(theta,rho,maxrho,line_style) % this is same as polar, but you can set the maximum rho value. if nargin < 1 error('Requires 2 or 3 input arguments.') elseif nargin == 2 if isstr(rho) line_style = rho; rho = theta; [mr,nr] = size(rho); if mr == 1 ...
cb17c32da6d884885118a9f67c88a7cca4e5ad2f74e50d0e04e27a5aa564c664
MATLAB
4,874
128
function [colormap]=cbrewer(ctype, cname, ncol, interp_method) % % CBREWER - This function produces a colorbrewer table (rgb data) for a % given type, name and number of colors of the colorbrewer tables. % For more information on 'colorbrewer', please visit % http://colorbrewer2.org/ % % The tables were generated fr...
15c612ac9d80ea6f52212df68d3357137593286ce29dd99f01b21b16d8060d35
MATLAB
4,877
148
function [node,elem,face,success]=surf2mesh(v,f,p0,p1,keepratio,maxvol,regions,holes,forcebox) % % [node,elem,face]=surf2mesh(v,f,p0,p1,keepratio,maxvol,regions,holes,forcebox) % % create quality volumetric mesh from isosurface patches % % author: Qianqian Fang, <q.fang at neu.edu> % date: 2007/11/24 % % input paramete...
b2d573b84b95c07608e73e7aa8ca877f6a3d705e677ab403e16e8ca8ef48000a
MATLAB
4,878
138
% GETPROBLEM Script for locating, reading and convert to SeDuMi, a problem % with the name specified by the variable `pname'. You have to define the % variable 'pname' before using this script. % % Usage: pname = 'problemname'; getproblem % Problem returned in (At,b,c,K). % % IMPORTANT % 1. If you have an envi...
513d49e317af0ef1bac8ad9e052ae995193ad2be0beccbaf269547c5575c30d9
MATLAB
4,879
162
function mat_epochs = G_EpochTS( mat, events, seg, varargin) % Epoch time series into segments % % Input % mat, channel x samples % events, vector of events locations (in samples) % epoch_range, [lo_boundary, hi_boundary] relative to each event (in % samples) where a negative number m...
130114fc0f4b3cb42a751939bfc9f681a36624958dd99281a1222b67e6c24737
MATLAB
4,886
183
function D = ea_pdist2( X, Y, metric ) % Calculates the distance between sets of vectors. % % Let X be an m-by-p matrix representing m points in p-dimensional space % and Y be an n-by-p matrix representing another set of points in the same % space. This function computes the m-by-n distance matrix D where D(i,j) % is t...
b9391b1b94a437ff017b0fd54ee89965fda04113c0a185d57fef78296bdbc9e4
MATLAB
4,887
145
% ConvertBasler2pos - Convert Basler data to pos file format % % USAGE % % ConvertBasler2pos(filebasename,<options>) % % filebasename basename of the video file (should be filebasenmae.avi) % <options> optional list of property-value pairs (see table below) % % ======================================...
eaa528049e743f6a61ebea47b357699a618abf644b4d39afb6d86041231f6cc3
MATLAB
4,888
122
%% FORMATTOOL - converts simple data format to dataraster format % Organizes data from simple formats (e.g. voltage value vectors) to the % dataraster format for processing in the information analysis. For each % point in timelocks, data will be binned around the time lock point. One % bin will start for time values eq...
f8fb91ca7047a2e4247f009e01d6fb592b4051a733cc5683bb09f9cc39c70a5b
MATLAB
4,888
110
function linelabel(vectors) %LINELABEL Labels plotted lines. % LINELABEL(LIBRARY), allows the user to select points and labels each % with the row number of its closest (Euclidean) match among the rows of % the matrix LIBRARY. When the mouse is clicked in the axis, the % nearest point is selected and l...
515489e8b2d08889c83024cf00260a596ff0461ae38224751b5995244d401222
MATLAB
4,890
110
function cifti = cifti_struct_create_from_template(ciftitemplate, data, type, varargin) %function cifti = cifti_struct_create_from_template(ciftitemplate, newdata, type, ...) % Create a new cifti struct using an existing cifti as a template for the dense or % parcels dimension. % % The 'type' ...
45be163d3a4ccb5f04c64da6c659f672d55aba30b5eee9c17a26339437bc7a2f
MATLAB
4,893
104
function [S,t,f,R,Serr]=mtspecgrampb(data,movingwin,params,fscorr) % Multi-taper time-frequency spectrum - binned point process % % Usage: % % [S,t,f,R,Serr]=mtspecgrampb(data,movingwin,params,fscorr) % Input: % data (in form samples x channels/trials or single vector) -- required % movingwi...
2ebbd164d1c14efbbe1c622d19bb429de60d3d1955fc2c6311fb378c24a27b6d
MATLAB
4,896
131
function [database_train, database_train_noisy, params_train, sigma_mppca, bunique, Ndirs_per_Shell] = build_training_set(SANDIinput) % Builds the dataset for supervised training of the machine learning models % for SANDI fitting. % % Author: % Dr. Marco Palombo % Cardiff University Brain Research Imaging Centre (CUBR...
23e10098a80be538821cd9e0706eab1bb404adf4982bddfa282c45a6d48062f6
MATLAB
4,900
150
function obj=stat_boxplot(obj,varargin) %stat_boxplot() Create box and whiskers plots % % stat_boxplot() will create box and whisker plots of Y values for %unique values of X. The box is drawn between the 25 and 75 %percentiles, with a line indicating the median. The wiskers %extend above and below the box to the most ...
4d9dd51ad293c1094a46e7136a9f638158f4b7833a0697c4da3651ab92312b29
MATLAB
4,900
131
% this script reads all the spike timestamp and a/d info from a plx file into matlab % variables. % Open a plx file % this will bring up the file-open dialog StartingFileName = ''; %StartingFileName = 'c:\plexondata\NSSample.plx'; %StartingFileName = 'c:\plexondata\au101602a.plx'; [OpenedFileName, Version, Fre...
f702d8afb3098fb222ace628b3af80a47f799d788af9fe885a55f068178a23ba
MATLAB
4,903
162
function h = mArrow3(p1,p2,varargin) %mArrow3 - plot a 3D arrow as patch object (cylinder+cone) % % syntax: h = mArrow3(p1,p2) % h = mArrow3(p1,p2,'propertyName',propertyValue,...) % % with: p1: starting point % p2: end point % properties: 'color': color accordin...
4287e0e677b17409863fd2d0c5a2fa8eac4f0ff7610ee019ba009c6d34465d1d
MATLAB
4,905
140
%% LaBGAScore_pet_prep_1_dat_behavioral_data.m % % % *USAGE* % % This script sets up the DAT structure for second level analysis of PET % data using CANlab tools in a single PET session design % % % *OPTIONS* % % * behavioral_data_filename name of the .tsv file in BIDS/phenotype containing subject ratings, default '...
93c84fa74aa7927133d19472a9942e9db686d902a140de99f3b3b70f7fb46198
MATLAB
4,906
131
function [phaseamplitude] = bz_PhaseAmplitudeDist(lfp,phaserange,amprange,varargin) % [phaseamplitudemap,ampfreqs,phasecenters] = bz_PhaseAmplitudeDist(lfp,phaserange,amprange) %This function calculates the mean amplitude of multiple higher frequency bands at %a the phase for a single lower frequency band signal % %%IN...
05624d265f6b040d1f632e3110c820c998dd4dd296062efd84b0bceb60a2292e
MATLAB
4,907
86
function [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc(data1,data2,win,params) % Multi-taper coherency, cross-spectrum and individual spectra with segmenting - continuous process % computed by segmenting two univariate time series into chunks % % Usage: % [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc(data...
dc7145e6971decb8150fc0dd3bbf1d5a30069063eab97190b805e3cf6e0512a9
MATLAB
4,908
101
function [datafit,Amps,freqs,Fval,sig]=fitlinesc(data,params,p,plt,f0) % fits significant sine waves to data (continuous data). % % Usage: [datafit,Amps,freqs,Fval,sig]=fitlinesc(data,params,p,plt,f0) % % Inputs: % Note that units of Fs, fpass have to be consistent. % data (data in [N,C] i.e. tim...
5c3bd8844564027ef60aa203bf0b093f16eff59fc966942828593fe431a855d5
MATLAB
4,909
116
%% Step 2 Tiny Dancers: Epoching and artefact rejection clear all clc addpath 'C:\Users\tnguyen\OneDrive - Fondazione Istituto Italiano Tecnologia\Documenti\MATLAB\functions' addpath 'D:\MUSICOM_EEG/onsets' addpath('D:\MUSICOM_EEG/EEG/') addpath('C:/Users/tnguyen/OneDrive - Fondazione Istituto Italiano Tecnolog...
48c07a88d7b1c2394f26da16a9e51e8018b7e541c1f68835270ca3e238a696e1
MATLAB
4,919
143
function spikes = GetSpikeTimes(units,varargin) %GetSpikeTimes - Get spike timestamps. % % USAGE % % spikes = GetSpikeTimes(units,<options>) % % units optional list of units, i.e. [electrode group, cluster] pairs; % special conventions: % cluster = -1 all cluster...
2086f879d2cc22e1cb3cdd7194137cd266d6d2672a7b009844496278e35dd681
MATLAB
4,922
146
function [output,status] = urlwrite(urlChar,location,method,params) %URLWRITE Save the contents of a URL to a file. % URLWRITE(URL,FILENAME) saves the contents of a URL to a file. FILENAME % can specify the complete path to a file. If it is just the name, it will % be created in the current directory. % % F =...
a59f79dfd47572ee113059188676c5812e2e039b4f48de2cbb0776685ac78dd1
MATLAB
4,925
104
function [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Multi-taper time-frequency spectrum - point process times % % Usage: % % [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Input: % data (structure array of spike times with dimension channels/trials; % ...
753824419ad5fe106acccecd9a061e78af30a79640fdf6b3937bc5dc9fe98995
MATLAB
4,926
136
%% RUN_PERMUTATION_TESTS % The help file shows you how to run permutation tests for nonparametrical % significance testing for correlational data % More information can be found here: https://docs.google.com/document/d/e/2PACX-1vTPQTLiYvKNUBpVc3PlRHDyonNaVLu-IAyEqyD8-M3jqvhVTPwvDi8wKNOVthNc6BqGxrcefyqrJSET/pub % % by m...
775c45d75635f8fa15550ed7cdc4848f9051796622610b86d0bdfff28c161ac9
MATLAB
4,927
231
function rtf(plot_frq,flag_save) close all evalin('base','stop=0;'); %=========SET THE BASIC FIGURE================= fig = figure('Position',[500,500,800,600],... 'NumberTitle','off',... 'Name','Scope',... 'doublebuffer','on',... 'HandleVisibility','on',... 'KeyPressFcn', @k...
75ec0f88638690869fa02d58c262b4887b6a91c0e5dffae87ec4df92ba392f74
MATLAB
4,932
99
function obj=geom_line(obj,varargin) % geom_line Display data as lines % % This will add a layer that will display data as lines % If the data is not properly grouped/ordered things can look weird. p=inputParser; my_addParameter(p,'dodge',0); my_addParameter(p,'alpha',1); parse(p,varargin{:}); obj.geom=vertcat(obj.ge...
2870b6b219576f9cb1a956c854158aef525265f7dd6b6da235b92cd4688573f4
MATLAB
4,937
128
function [ccg,ic] = chXcorr2(hc_L,hc_R,fs,varargin) %CHXCORR2 Calculate cross-correlograms with a range of options. % % CCG = IOSR.AUDITORY.CHXCORR2(HC_L,HC_R,FS) cross-correlates the input % 2-D matrices HC_L and HC_R over 10ms frame with a maximum lag of 1ms. % It is assumed that the number of frequency channe...