sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b5cef4551410826ab6e7041e8382835bedfcfe0913a703508a551d3ad5392fb3
MATLAB
2,556
104
% helpforexe() - Write help files for exe version % % Usage: % histtoexe( mfile, folder) % % Inputs: % mfile - [cell of string] Matlab files with help message % folder - [string] Output folder % % Output: % text files name help_"mfile".m % % Author: Arnaud Delorme, 2006 % % See also: eeglab() % Copyright (C)...
decb408046af26e84fe4222e518d50669791fd469c5623a26d9b20b087db7489
MATLAB
2,556
100
%RunBatch - Run a batch job. This should *not* be called directly. % % Run a batch job. This function is called automatically by the % batch timer upon expiration of the required delay. % % USAGE % % RunBatch(timer,event,b) % % timer Matlab timer object % event Matlab timer event type % b...
ec053e0f7436aa448e17b5b5e7828b7cdd108c25ad85e27b8c153ca1a878ebd1
MATLAB
2,556
85
function [epochs, P_r, ts] = ThetaEpochs(self, window, window_inc) % Determines epochs where theta/delta power ratio is above criteria % % Returns continuous theta/delta power ratio using instantaneous power from % Hilbert transform (P_r). moving window average of each instant. power. vector. % Note that the first wi...
9b4503c2e99d39474a2dc3bdae4ad67b3a3e1d479c060596a7897b0d610fd653
MATLAB
2,558
83
function c = convFft(a,b,shape) %CONVFFT Convolve two vectors using FFT multiplication % % Convolution using traditional overlapping methods can be slow for very % long signals. A more efficient method is to multiply the FFTs of the % signals and take the inverse FFT of the result. However, this comes at % a c...
7183f04a0dd35701e76e040cd99518265898753d096bd417767ac7db65ea24ad
MATLAB
2,561
88
function [Ygreen, Yred] = makeStacks5D(folder, pctUpdate) % This function will make 4-dimensional stacks from 5-dimensional data. % 5D data: x, y, z, t, c % Volume imaging time series with two color channels. if(nargin<2) pctUpdate = []; flag = false; else flag = true; end...
ff374082c9ad6d133d59a7a950949b0ce3813658fd179f0b451e598d62bc5b05
MATLAB
2,562
88
function [x,t] = istft(s,nfft,hop,fs) %ISTFT Calculate the Inverse Short-Time Fourier Transform % % X = IOSR.DSP.ISTFT(S) calculates the inverse short-time Fourier % transform (ISTFT), from the 1024-point one-sided FFTs in each column of % S, using the overlap-add method. It is assumed that FFTs are calculated...
6f8e6e6fc4fc8b47edf08ca0a875b8a94e09506eb1da4ba7f5f954b6dd2b4076
MATLAB
2,566
77
function varargout = palm_yeojohnson(varargin) % Find the lambda parameter and compute the Yeo-Johnson transformation. % % Usage: % [Y,L] = palm_yeojohnson(X) % Y = palm_yeojohnson(X,L) % % X : Input data. % Y : Transformed data. % L : Lambda parameter. % % Reference: % Yeo IK and Johnson RA. A new family of power...
fd6582e1669c0c9800a24efe5bacbd2caed8d590ef95a02d8f27a0143b5a6e20
MATLAB
2,566
78
addpath (genpath('eeglab2022.1/')); eeglab load("dataset_ds005284.mat"); selected_channels = {'C3','C4','CZ','PZ'}; eeg_segments = cell(1, length(data)); for subi=1:length(data) EEG = data{subi}; EEG = pop_select(EEG, 'channel', selected_channels); fs = 250; EEG = pop_resample(EEG, fs); ...
58faf292cc23998584ea7830bf76beb657b734427cafe9c7d4f71946c416bfbb
MATLAB
2,569
81
function ea_update_data(varargin) % update lead data updurl = 'https://www.lead-dbs.org/release/download.php'; if nargin if strcmp(varargin{1},'full') id = 'data_pcloud'; else id = 'updates_data'; end else id = 'updates_data'; end earoot = ea_getearoot; if strcmp(id, 'updates_data') ...
4dc779ed6789c63bda41776b5a43dea151a4fe777608a8449c37ec2e1d1d2a7e
MATLAB
2,570
69
function dirlist = regexpdir(rootdir, expstr, recursive) % REGEXPDIR Gives a directory listing based on a regular expression % REGEXPDIR(ROOTDIR, REGEXP) gives a directory listing of the directory % ROOTDIR based on the pattern specified by the regular expression % REGEXP. % % REGEXPDIR(ROOTDIR, REGEXP, REC...
fc93a3f9e777f3d45acafa1fff8c0a5e60cdee032febb0b9354ccc8a631cd592
MATLAB
2,576
84
%%********************************************************** %% cheby0: %% %% minimize || p(d) ||_infty %% p = polynomial of degree <= m such that p(0) = 1. %% %% Here d = n-vector %%---------------------------------------------------------- %% [blk,Avec,C,b,X0,y0,Z0,objval,p] = cheby0(d,m,solve); %% %% d ...
f5169913b877fc544265357a535bfaefd5085b46278ed81b9e32becf656d399c
MATLAB
2,577
74
%%********************************************************************* %% sortA: sort columns of At{p} in ascending order according to the %% number of nonzero elements. %% %% [At,C,b,X0,Z0,permA,permZ] = sortA(blk,At,C,b,X0,Z0); %% %% SDPT3: version 3.1 %% Copyright (c) 1997 by %% K.C. Toh, M.J. Todd, R.H. Tut...
5823b4f8a7d0fdabded250cfae7654e83e88f5d2748a872631a37e3436de5a5f
MATLAB
2,578
36
% Chapter 8: Geometric problems % % separate_pt_poly.m - Section 8.1.1: Separating a point from a polyhedron % separate_poly_2D.m - Section 8.2.2: Separating polyhedra in 2D % analytic_center.m - Section 8.5.3: Analytic center of a set of linear inequalities % svm_1.m ...
bb7cea2fd17708a0145fe1733527c9617fd3759b75489b57849ed08455cfed59
MATLAB
2,578
85
%% ======================= step 01-00 for disposal all data % input all the basic data %% set parameters % input parameters FileName_CellType1 = ['CellType_2025PlosB_glasser360_NN.mat']; FileName_CellType2 = ['CellType_2022Nature_glasser360_NN.mat']; FileName_CellType3 = ['CellType_2019Nature_glasser360_NN.mat']; % ...
1f3a29d772339cf556a9d4535fc0373a772a1c9aca016b6a5432aba113fc41ef
MATLAB
2,579
57
classdef CBIG_hMRF_unit_test < matlab.unittest.TestCase % Written by Xiaoxuan Yan and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md methods (Test) function test_example(testCase) % create output folder CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); load(fullfi...
f9caf965ba1bef5b818a6b0c09050cac1d6c409d016282f497ac41065db861f4
MATLAB
2,582
58
% % % Format: The prep_6 script extracts signature responses and saves them. % These fields contain data tables: % DAT.SIGNATURES.(signaturename).(data scaling).(similarity metric).by_condition % DAT.SIGNATURES.(signaturename).(data scaling).(similarity metric).contrasts % % signaturenames is any of those from load_ima...
289fc5ede00a5e7389b5afafc19a430f41aa92bd0da489c2f5c588bb17305fd8
MATLAB
2,583
54
function CBIG_MMLDA_behavior_to_zscore_create_refpara(behavior_bl, ind_CN_bl_behavior, regressor_bl_behavior, zscore_method, output) % CBIG_MMLDA_behavior_to_zscore_create_refpara(behavior_bl, ind_CN_bl_behavior, regressor_bl_behavior, zscore_method, output) % % Create a mat file which contains reference parameters for...
28c7d56175138b2486b84f88c8722ea2ad49ed6c113b82cfe2ab4d65e50d3bba
MATLAB
2,583
87
% icaact() - compute ICA activation waveforms = weights*sphere*(data-meandata) % % Usage: >> [activations] = icaact(data,weights,datamean); % % Inputs: % data = input data (chans,frames) % weights = unmixing matrix (runica() weights*sphere) % datamean = 0 or mean(data') (default 0); % % Note: If da...
606aa56cc18503c0f30e787aec430e37f2264464f5c174fd82f6bab68d884fca
MATLAB
2,583
82
function percent = parfor_progress(N) %PARFOR_PROGRESS Progress monitor (progress bar) that works with parfor. % PARFOR_PROGRESS works by creating a file called parfor_progress.txt in % your working directory, and then keeping track of the parfor loop's % progress within that file. This workaround is necessary be...
268b2a44e3085cc7f69307304d1ba37d029b9b48229662c8d6cd041693331275
MATLAB
2,584
75
% FDLA and FMMC solutions for an 8-node, 13-edge graph % S. Boyd, et. al., "Convex Optimization of Graph Laplacian Eigenvalues" % ICM'06 talk examples (www.stanford.edu/~boyd/cvx_opt_graph_lapl_eigs.html) % Written for CVX by Almir Mutapcic 08/29/06 % (figures are generated) % % In this example we consider a graph desc...
c7c9d9eb80a452e05e84367e2bc7743fd450558d2d3da7feeb296ee8836fd2d3
MATLAB
2,584
94
function [node,elem]=binsurface(img,nface) % % [node,elem]=binsurface(img,nface) % % fast isosurface extraction from 3D binary images % % author: Qianqian Fang, <q.fang at neu.edu> % % input: % img: a 3D binary image % nface: nface=3 or ignored - for triangular faces, % nface=4 - square faces % ...
3e0446be7c7164f1ab29a8949525375e336a7f758fda91ce577f31b9c540ed90
MATLAB
2,585
71
function colors=ea_color_wes(set, colnum) % source: http://opencolor.tools/palettes/wesanderson/ % similar or same palettes found in R here: https://github.com/karthik/wesanderson % different sets here https://prafter.com/color/ sets={'lifeaquatic','budapest','moonrisekingdom','royaltenenbaums','fantasticmrfox','darjee...
cf69717b3b461775cb74b9396bd2a60109500118ac0a51f9efa1dada34a81b4d
MATLAB
2,585
113
function fit = mrelnet(x,is_sparse,irs,pcs,y,weights,offset,parm,nobs,nvars,... jd,vp,cl,ne,nx,nlam,flmin,ulam,thresh,isd,jsd,intr,maxit,family) nr = size(y, 2); wym = wtmean(y, weights); nulldev = sum(wtmean(bsxfun(@minus,y,wym).^2,weights)*sum(weights)); if isempty(offset) offset = y * 0; is_offset = f...
38931b88e3e976b07eb3ca14ce935ebbb47a6060326db7c7bcb63d9d9252a6a6
MATLAB
2,586
63
function [waveformDuration_peakTrough, halfWidth, peakTroughRatio, firstPeakTroughRatio,... nPeaks, nTroughs, isSomatic] = computeWaveformProp(templateWaveforms, ... thisUnit, maxChannel, param, channelPositions) % all waveform metrics based on template and not mean raw waveform for now % get waveform, wavef...
8940502b972ba74f5e426beab1e815cae0b83428a83ee58ec61f4d223bbc8954
MATLAB
2,586
66
function Sp_vect = myPLS_permutations(X,Y,U,grouping,pls_opts) % This function computed permutation testing over singular values obtained % with PLS. Rows (subjects) of Y are permuted in each iteration. % % Inputs: % - X : N x M matrix, N is #subjects, M is #imaging variables, % imaging data (...
b526b45a180bbab830e958be25abf65b9152883ea32861138deb8ae33b5f8853
MATLAB
2,586
89
function cvx_optval = sum_largest( x, k, dim ) %SUM_LARGEST Sum of the largest k values of a vector. % For a real vector X and an integer k between 1 and length(X) inclusive, % y = SUM_LARGEST(X,k) is the sum of the k largest elements of X; e.g., % temp = sort( x ) % y = sum( temp( 1 : k ) ) % If k=1...
7302e9daac9bd4b5ab66e092ef48b7ec89a7f660a44fbefe691dce1f43e03076
MATLAB
2,587
99
function res = dynamicgustmodel % Model Parameters % generate two stable wind directions % initialWD = 0; % finalWD = 0; % % wd = [initialWD*ones(7500,1);finalWD*ones(7500,1)]; % dirs = randi([-90 90],1,6); % dirs = [50 -80 35 75 -20]; % dirs = [50 -65 25 -30 45]; dirs = [0 0 0 0 0]; wd = [zeros(1800,...
15220b016da7afbe18bc2e1f5ceac236805d227ad71a1049d7870dc64a263c00
MATLAB
2,590
79
function res = plugin_urlsize(urlChar,method,params) %URLREAD Returns the contents of a URL as a string. % S = URLREAD('URL') reads the content at a URL into a string, S. If the % server returns binary data, the string will contain garbage. % % S = URLREAD('URL','method',PARAMS) passes information to the server ...
e10c55efa5c3be8266ce19e89cc2eeddedf2a7d307dcf118ebeee998b570def5
MATLAB
2,590
86
function status = IsInZone(positions,zone) %IsInZone - Test when the animal is in a given zone. % % Test when the animal is in a given zone of the experimental setup (typically the % firing field of a place cell). % % USAGE % % status = IsInZone(positions,zone) % % positions position samples (normalized be...
fa6518b17b5e6a1240eff63fd2acd35d6fb085f1643b91dec9936a353a9af4ed
MATLAB
2,590
84
function [node,elem]=meshgrid5(varargin) % % [node,elem]=meshgrid5(v1,v2,v3,...) % % mesh an ND rectangular lattice by splitting % each hypercube into 5 tetrahedra % % author: Qianqian Fang, <q.fang at neu.edu> % inspired by John D'Errico % URL: http://www.mathworks.com/matlabcentral/newsreader/view_thread/10...
5ce2ffafdf33279cfd999dc4a5c7556c65cab9ea20ce91eb575a6060683f2cc3
MATLAB
2,591
73
% pop_averef() - Convert an EEG dataset to average reference. % This function is obsolete. See pop_reref() instead. % % Usage: % >> EEGOUT = pop_averef( EEG ); % % Author: Arnaud Delorme, CNL / Salk Institute, 22 March 2002 % % See also: eeglab(), reref(), averef() % Copyright (C) 22 March 2002 Ar...
40cf10a37225ab26ad5a3fbe6d5066c09d2bbf2b08ea3918e8c0dc00028489d9
MATLAB
2,593
65
function ClincFreq_CalCentNum(outdirCent,OutCentdir,SetUpPara,Para,AtlasTempU) IndirCent = [outdirCent,'CentNum',filesep]; [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(IndirCent); D(isnan(D)) = 0; D(isinf(D)) = 0; % D = D>0; % Dvol = sum(D)'; % Dvole = sum(D,2); % IgV = Para.IgP; % indexs = find(Dvole>=(...
71415cf38011f0b3ac03bdfe4c17d583575518c3b085b5ae694b5a5c5ad163e7
MATLAB
2,594
89
%% Spatial specificity: Correlations between NPS contrasts and global gray, white, CSF if isfield(DAT, 'gray_white_csf_contrasts') || isempty(DAT.gray_white_csf_contrasts) printhdr('Correlations between NPS and global gray, white, CSF'); disp('Systematic non-zero values indicate global signal contaminatio...
f335ba8c19640152a59ea7da1a95b10685aa8283044eacdf5c2934cf1c84bc69
MATLAB
2,595
60
function handles = call_autoBAP_filt(handles) minF = 0; if ~isempty(handles.spine_filt) spID = handles.spine_title; if isempty(handles.spine_trace_BAPremoval) ... || isempty(handles.spine_BAPremoval_coef) ... || isempty(handles.spine_BAP_current) trace_BAPremoval = []; BAPremoval...
e766f5570aa82b82e0adee7723723935f6deccb4f292c409b61e9424ddd55070
MATLAB
2,596
62
function Y_ds = downsample_data(Y,direction,tsub,ssub,nrm) % downsampling for 2d or 3d imaging data (already loaded in memory) % INPUTS % Y: input dataset in 2D+T or 3D+T format % direction: direction of downsampling: 'space','time','spacetime' % tsub: degree of downsampling in time % s...
5bd95abcccb0de49754525d5cf7745cceeebe4826e8659962cb68be37edacf50
MATLAB
2,599
44
function outinfo = cifti_diminfo_dense_get_volume_structure_info(diminfo, structure, cropped) %function outinfo = cifti_diminfo_dense_get_volume_structure_info(diminfo, structure, cropped) % Get information on how to map cifti indices from one volume structure to voxels. % The volsform1 field is adjuste...
ab723db3481a1a0549c6e283f130998fc2e4bd503026ba1f7fad084d721bfc10
MATLAB
2,599
106
function x=editMask1(x,im) % Usage ... x=editMask1(x,im) % % same as editmask but will let you edit labeled images % by selection wait_flag=0; if exist('im'), if iscell(im), im_overlay4(im{1},x,256); elseif size(im,3)>1, im_overlay4(im(:,:,1),x,256); else, im_overlay4(im,x,256); end...
4c1356fcd5b705e68a289a686157644456d13f7fa853a4cb94deb594bdbcb3f3
MATLAB
2,601
71
function str = ea_gencode_substruct(subs, name) % GENCODE_SUBSTRUCT String representation of subscript structure. % Generate MATLAB code equivalent to subscript structure subs. See help % on SUBSTRUCT, SUBSASGN and SUBSREF for details how subscript structures % are used. % % str = gencode_substruct(subs, name) % Inpu...
6c7d3ab4f9ffa8e62daf85e7bd0706c5c12efbdff3778d338a31c11a1432d28b
MATLAB
2,601
88
% gauss3d() - generate a 3-dimensional gaussian matrix % % Usage: % >> [ gaussmatrix ] = gauss2d( nX, nY, nZ); % >> [ gaussmatrix ] = gauss2d( nX, nY, nZ, ... % sigmaX, sigmaY, sigmaZ, ... % centerX, centerY, centerZ, mask) % % Example: % >> gauss3d(3,3,3)...
d147d435ce4fb5be485276cc07e1e965ff2d9068f67a901a377d219bc27b4a90
MATLAB
2,601
82
function currentfluor=rmmotion(currentfluor,currentred, thresholdstd,framerate) %should this do something different if it's shaped differently? Like if it %is taken in as a cell? axall=[]; figteststd=figure('Position',[1 1 1920 237]); hold on; redstd=[]; directions=fieldnames(currentred); for p=1:5 %allred=[cu...
294d6796bedee358a95565dccd5ee8f6dd9c3bb911df762d011711df2945ac53
MATLAB
2,603
107
function sim = cpc_type2_SDT_sim(d, noise, c, Nratings, Ntrials) % Type 2 SDT simulation with variable noise % sim = type2_SDT_sim(d, noise, c, c1, c2, Ntrials) % % INPUTS % d - type 1 dprime % noise - standard deviation of noise to be added to type 1 internal % response for type 2 judgment. If noise is a 1 x 2 vector ...
567ce4cb64786157d6e8f8ee967bd8f3e304d522d95b2facd780d9741e52d86f
MATLAB
2,604
63
% CircStat Toolbox % Toolbox for circular statistics with Matlab % % Descriptive Statistics. % circ_mean - Mean direction of a sample of circular data % circ_median - Median direction of a sample of circular data % circ_r - Resultant vector length % circ_var - Circular variance % c...
6824bf2db0928b6d7306bdd6f17985f3d18128601686da08faa1575a046a48b7
MATLAB
2,604
86
function [ h ] = lineWithGaps( varargin ) %lineWithGaps Plots a single low-level line with gaps between columns in %the XYZ data % % lineWithGaps(X,Y,[Z], parameters ...) % % Parameters: % ----------- % Handle - Line handle to reuse instead of creating a new line % % Delimeter - Delimeter to use between columns. Defau...
e777014ab1a1ab7736ae9c7b9ac1f6105289bf2bd51f398a6454229065925efe
MATLAB
2,604
84
function []= fill_legend(obj,title_text,legend_text,legend_type,legend_color,legend_marker,legend_linestyle,legend_line_size,legend_point_size) legend_y_step=1; legend_y_additional_step=0.5; obj.legend_text_handles=[obj.legend_text_handles... text(1,obj.legend_y,title_text,... 'FontWeight','bold',... 'Int...
3b861b718c0033b141ceedac811ff6202875f1121f4874e75f56a6800c467fe8
MATLAB
2,605
83
function [h] = headcoordinates(nas, lpa, rpa, flag); % HEADCOORDINATES returns the homogenous coordinate transformation matrix % that converts the specified fiducials in any coordinate system (e.g. MRI) % into the rotated and translated headccordinate system. % % [h] = headcoordinates(nas, lpa, rpa, flag) or % [h] = h...
eed0575023bdb63b7020eb6beb65785125ca6fcedcd34a3f5d1e2d47e63fc053
MATLAB
2,605
59
clear; clc; close all; addpath(genpath('../functions/')); CBIG_plotSetup; %% Assemble rid_prob and rid_ICVOverGM r = dir('../../lda/postprocess/188blAD/k3/r*'); %----------------- bl subInfo = csvread('../../subInfo/rid_sex_mDoB_yDoB_mExam_yExam_ageExam_dx_icv_bl.csv'); rid_gmVol_icv = csvread('../../vbm_810bl/gmVo...
adde499d9f9fc583bc215c7a972049d4c89c3c8bb8d2a1df84f2940e93b46729
MATLAB
2,606
82
function currentfluor=rmmotion_cell(currentfluor,currentred, thresholdstd,framerate) %should this do something different if it's shaped differently? Like if it %is taken in as a cell? axall=[]; figteststd=figure('Position',[1 1 1920 237]); hold on; redstd=[]; directions=fieldnames(currentred); for p=1:5 %allre...
fa632acbe7c598032fba9d659da9c60110cbfe9d41c355d3965f22286f815ebc
MATLAB
2,606
163
% % all_shortest_paths % load ../graphs/clr-26-1.mat floyd_warshall_all_sp(A); % % astar_search % load ../graphs/bgl_cities.mat goal = 11; % Binghamton start = 9; % Buffalo % Use the euclidean distance to the goal as the heuristic h = @(u) norm(xy(u,:) - xy(goal,:)); % Setup a routine to stop when we find the goal e...
161c943eb499d8a120ccead1691a87881bb73f3a00fa9b4c50d91fbace0f5743
MATLAB
2,608
83
function array = display_matrix(A, resize_factor, num_column, figure_on) % This function display the columns of A in an image where each rectangle % of the image represents the column of A % A: may represent the connections between two populations; % resizeFactor: the factor for a higher resolution % numColumns: # of...
2949a6914c99f7db5d44df1ea3bde1bca66859273cafd3eaa2e3084349917082
MATLAB
2,608
79
function [x, y, bodyline, sqr] = FindFly(chunk, sqrsize) %FINDFLY % % Usage: % [x, y, bodyline, sqr] = FindFly(chunk, sqrsize) % % This function takes in a single image matrix (chunk) and finds the fly. % First, it finds the brightest pixel in the image, then grabs a square % of size 2*sqrsize pixels aro...
d6a204b128f2db1521f8e0310d33ec832a25f4557f1aba6132ac7a68979a4ca7
MATLAB
2,608
83
%MAT_INTO_HDR The old versions of SPM (any version before SPM5) store % an affine matrix of the SPM Reoriented image into a matlab file % (.mat extension). The file name of this SPM matlab file is the % same as the SPM Reoriented image file (.img/.hdr extension). % % This program will convert the ANALYZE 7.5 SPM Reor...
ec70b414588f2e469dbd5b45adbf0d119a548aeac8706ce7065c7cce12a87858
MATLAB
2,608
73
function ea_checkOSSDBSInstallv2(env) % Check conda installation if ~ea_conda.is_installed ea_cprintf('*Comments', 'Initializing conda...\n'); ea_conda.install; ea_cprintf('*Comments', 'Done...\n'); end if ~exist('env', 'var') env = ea_conda_env('OSS-DBSv2'); end % Install/Update OSS-DBS v2 conda env...
245524b4e35ef3bc17d574efbe0ac392a2ff65b7c6bd8aa4030d05215fbda447
MATLAB
2,609
79
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% CPC METACOGNITION TUTORIAL 2019: PLOT TYPE2ROC %%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function to plot type2 ROC curve from observed ± estimated data fit %%%%%%%%%%%%%%%%%%%%...
49db9de9ded6ee4b057e20a6f7d46ed04b72a399cbed6f824ce79c3372ad779e
MATLAB
2,609
64
function cifti = cifti_struct_dense_replace_volume_all_data(cifti, data, cropped, dimension) %function cifti = cifti_struct_dense_replace_volume_all_data(cifti, newdata, cropped, dimension) % Replace the data in all cifti volume structures, taking a 4D array as input. % For a single-map cifti, the input...
15f32f28e739eb5682d887511289ac9c465e77c07dae387258cbbe2a20855f82
MATLAB
2,610
54
%% sleepDanalyzer montage. % Montage scripts provide a conveinient way to control how the data looks % when sleep scoring. % chanList. A list of channel names and (optionally) channel coordinates. % This should be an EEGLAB chanlocs struct. Alternatively you can read in a % .txt file using the readlocs function (EE...
c1d85597a08aa7de7450f826b784716b204ad131a773e3aa8860d15a3cca48aa
MATLAB
2,610
87
function CBIG_ASDf_plotCmp(A, xlimCmd, isSex, output_name) % CBIG_ASDf_plotCmp(A, xlimCmd, isSex, output_name) % % This function plots GLM results (estimated difference between factors and % standard error). If output_name is specified, the plot will be saved. % % Input: % - A: % Outputs from hypothesis ...
37f18840e503dda8d4142c3ac366f7d7065d2b6272da7ece80143d3e8d6ab850
MATLAB
2,611
51
plugin_find_master_script_directory; %% CHECK DEPENDENCIES AND SET DEFAULT VARIABLES % Load and print summary of study from study_info.json and contrast info % ------------------------------------------------------------------------- scriptname = which(fullfile(masterscriptdir, 'a2_second_level_toolbox_check_dependen...
4baf8da76da5a35aedd908ade432abcf421af2abf90d8c284de844079f4fb3f5
MATLAB
2,611
91
function swave=smoothwavelet(wave,dt,period,dj,scale) % Smoothing as in the appendix of Torrence and Webster "Inter decadal changes in the ENSO-Monsoon System" 1998 % % used in wavelet coherence calculations % % % Only applicable for the Morlet wavelet. % % (C) Aslak Grinsted 2002-2005 % % --------------...
6f6c5148f6205f2854f50e12eaefa4e7a4f4d062c1dee79e54bb81faeb8141c6
MATLAB
2,612
70
function d=edit_distance_weighted(s,t,weight_delete,weight_insert,weight_replace) % Calculate a weighted string distance. If the weights are 1,1,1, then % the calculated distance is equal to the Levenshtein distance. % % @author B. Schauerte <schauerte@ieee.org> % @date 2010 % Copyright 2010 B. Schauerte...
9e8b56993134aa40978c2e813293d271fec4593d9f09648475ae34117609899f
MATLAB
2,612
100
function [adfreq, n, ts, fn, d] = nex_cont(filename, varname) % nex_cont(filename, varname): Read continuous variable from a .nex file % % [adfreq, n, ts, fn, d] = nex_cont(filename, varname) % % INPUT: % filename - if empty string, will use File Open dialog % varname - variable name % % continuo...
ac9fe5b48062013f9db711f6a99db54706effe5cd2aa42c7733832fd675379c1
MATLAB
2,612
66
% written by Yiyuan Han, Essex BCI-NE Lab, 12/03/2020 % use coherences to measure the cross-frequency coupling % Input: % - data: The input data for analysis, which is channel-by-time-by-trial % - bin: the length of each bin for calculating the CFC across bins in the % unit of Hz. % - band1: The range of the firs...
000378e958bd67d4e97a1c4b96e9754f49b234cc11dc20cc9b533568f8a8f52e
MATLAB
2,613
82
% Example script that extracts pre-transcription apical areas for NB vs % non-NB analysis shown in Figure 3 % Inputs are MasterMatAreaABSOLUTE, MasterMatLengthBondABSOLUTE and % IntensitiesPerFrameMatrix .mats obtained from GetSizeAndBondTables.m close all clear all movie_number = '3'; window_number = '1'; if str...
59e2b3dd9f8f95ca54b362db62b07b77e0fe368ffd4a70e08c22096bc64cf166
MATLAB
2,615
86
%% Add all folders to path addpath(genpath(pwd)); %% Load raw data data = data_IFNAGRKO_raw(); k = 1000; % scaling factor alpha = 0.01; % filtering parameter %% Process all NSC counts and fractions proc = process_NSC_frac_data(data, k, alpha); %% Define scenarios for comparison ...
0d896ad7143d881785eb982f5205767f61273ac74c5b1448a3ea002c7c01050a
MATLAB
2,616
120
function [p,t,df,slope1,slope2,sem1,sem2] = CompareSlopes(x1,y1,x2,y2) %CompareSlopes - Perform linear regression y = ax on two groups and compare slopes. % % USAGE % % % To compare two slopes: % [p,t,df,slope1,slope2,sem1,sem2] = CompareSlopes(x1,y1,x2,y2) % % % To compare a slope to a theoretical value: % ...
a0d798bb15987d40612f40af91c1d85adad71d0ae2b7d9dd6c4054b11068bb14
MATLAB
2,617
96
function varargout = ConfineTspOutput(fbasename,outputfilename,varargin) % USAGE: % ConfineTspOutput(fbasename,varargin) % % Keep only LED points detected within the user-specified polygon (ie home % cage). % >Assumes you will either enter inputs to specify shape of polygon, or that % .mpg file is in same directo...
f32ac619b86573edc10f957085197355ac76be06b28271c53113f27424cc8c85
MATLAB
2,617
97
function [DF]= sim_computeGeneralizedLV_Derivatives(t,F,struct) % 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 relevant behaviors of the ecosystems. % Copyright (C) ...
febbd05218ce5d47418c70622e472376736f9272aa2edd10efb54053a51f25a9
MATLAB
2,617
69
function progressBar(progressFraction, updateEvery, infoString) %PROGRESSBAR Improved progress indicator. % PROGRESSBAR(FRACTION, UPDATEEVERY, INFOSTRING) modifies Matlab's % waitbar functionality to allow the indicator to decrease, automate % creation/deletion and restrict updates so the indicator is only ...
71697afa973223f3705a876f39c4959ce71d190e2cfd0ff518f053953f494892
MATLAB
2,618
67
function tp = maxstep(dx,x,auxx,K) % tp = maxstep(dx,x,auxx,K) % % MAXSTEP Computes maximal step length to the boundary of the cone K. % % ********** INTERNAL FUNCTION OF SEDUMI ********** % % See also sedumi % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster Universi...
a4215592ee8ab9293269a4eadb5e2e1cde4c7810ccb4cdd1e5023a86f0a10964
MATLAB
2,618
94
function edgenb=edgeneighbors(t,opt) % % edgenb=edgeneighbors(t,opt) % % to find neighboring triangular elements in a triangule surface % % author: Qianqian Fang, <q.fang at neu.edu> % % input: % t: a triangular surface element list, 3 columns of integers % opt: if opt='general', return the edge neighbors for a...
ef357fd52c8dfc8c8a2e5183b3acb64d7041b847429d4903d154ad698cb4eb52
MATLAB
2,619
89
function varargout = dtype(varargin) % FORMAT varargout = dtype(varargin) % For getting the value % dat = dtype(obj) % % For setting the value % obj = dtype(obj,dat) %__________________________________________________________________________ % Copyright (C) 2005-2013 Wellcome Trust Centre for Neuroimaging % % $Id: dty...
7372a20922fb3537411ff9d30cd76ee3e50894ff7df1c33e3bbc6bc0815b744b
MATLAB
2,620
131
function [idx,dist]=rangesearch(c,r,X,mode) % RANGESEARCH Range Search to find all points within a range. % [index,distance]=rangesearch(c,r,X,mode) returns all points,x of X which % are in the range of ||x-c||<r. % Inputs: % c: 1 x d the query vector % r: scalar defines the range % X: n x d array of all searc...
743b0eff3ef2dd8326de2f1de3334a7e78abc48ab8b9edd00e80e3bfa95833b7
MATLAB
2,620
85
%% Add all folders to path addpath(genpath(pwd)); %% Load raw data data = data_WT_raw(); k = 1000; % scaling factor alpha = 0.01; % filtering parameter %% Process all NSC counts and fractions proc = process_NSC_frac_data(data, k, alpha); %% Define scenarios for comparison scenar...
767466b33cfb7e1d8e64a54d11c1e5dd94fcac5dfcdad5eb73500f0aba0802a0
MATLAB
2,621
129
f1 = create_figure('tsplot'); % x predictor, y time, z data tlen = 5; % Bottom h1 = drawbox(0, 1, 0, tlen, 'k'); % Top h2 = drawbox(0, 1, 0, tlen, 'k'); set(h2, 'Zdata', [1 1 1 1], 'FaceColor', 'k', 'FaceAlpha', 0) % Back vertical h3 = fill3([0 0 0 0], [0 0 tlen tlen], [0 1 1 0], 'g'); set(h3, 'FaceColor', [.9 .9 1...
e2dad78da0822d395611f05b88021fed776049c2ac59e28d3275d9cd5ed94c5b
MATLAB
2,621
99
function b = InitBatch(bfile) %InitBatch - Initialize a new batch job. % % USAGE % % b = InitBatch(bfile) % % bfile batch file listing the parameters for each iteration % % SEE % % See also StartBatch, ShowBatch % % Copyright (C) 2007-2013 by Michaël Zugaro % % This program is free software; you c...
f0268ccdbc0f4b9f510f990f865d085c74ca27bb6305b88c6c3e7849352d07ee
MATLAB
2,622
78
% High-Low Synchrony Heatmap Analysis clear; % Clear workspace variables % Load dataset 'HLsync.mat' containing matrices 'gaba' and 'nongaba' load('HLsync.mat'); % --- Process gaba matrix --- for i = 1 : length(gaba(1,:)) % Loop through each column (cell) in gaba % Count how many entries in rows 4 to 7 are...
03567a2729db98384ee14ec9777d126d3a20224ea34cb511b506860827acd565
MATLAB
2,623
60
function handles = call_autoBAP(handles) minF = 0; if ~isempty(handles.spine_dff) spID = handles.spine_title; if isempty(handles.spine_trace_BAPremoval) ... || isempty(handles.spine_BAPremoval_coef) ... || isempty(handles.spine_BAP_current) trace_BAPremoval = []; BAPremoval_coef ...
ac02fa64ad473f6585e6c776a4ca1471c2524caaa1855866964e2918918dd418
MATLAB
2,625
71
function database = DBCreate(database) %DBCreate - Create database. % % Create database with figure and variable tables. Use this function % if you have admin rights to the database server. Otherwise ask % the DBA to create an empty database with the appropriate access % rights, and then use <a href="matlab:help DBCre...
37b30bee8bf0a587e33b24eed221cc0b88f93dddeb5c537f12ebaf7e751bd8cd
MATLAB
2,626
101
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')); end %% ======================= step 1 ...
200a605d1e4b4d48757172c612172778a3c94048a6352412611e76e242c116f1
MATLAB
2,627
86
%% Regular Spiking (RS) Izhikevich Model Neuron % Produces simulated data for a simple model of a regular spiking neuron % from Izhikevich 2007, page 274. % % Syntax: [mv,spkCt,spkLoc] = simpleModel_RS(vInput,T,tau,PLOT,nzInput) % % Input: % vInput (1 by number of time steps double vector) - the current input to % ...
28350c0e4daa6db212406b150e69f1dfe4f7b19b3db1501deb67e9f442b50835
MATLAB
2,628
80
% averef() - convert common-reference EEG data to average reference % Note that this old function is not being used in EEGLAB. The % function used by EEGLAB is reref(). % % Usage: % >> data = averef(data); % >> [data_out W_out S_out meandata] = averef(data,W); % % Inputs: % data - 2D data ma...
659aa8b2a4dff7101e46cfc992c7ccdd391af5774a501c0b0898be4a5bb77735
MATLAB
2,628
87
function [v, smoothwin] = prep_filt(handles) v = 0; smoothwin = handles.defaultPara.Denoise.movingaverage; % smoothwin = 5; mainfig_pos = get(handles.mainfigure, 'Position'); scrsz = handles.scrsz; pos = mainfig_pos; pos(1) = pos(1)+100; pos(3) = 300; pos(4) = 300; hplot...
e53552cdab7d152a09c63b135f61610d35e17cb52350c91885fe9392c01c761d
MATLAB
2,628
56
function [coords,trajvector,trajectory,tramat]=ea_reconstruct(options,side,lnii) % This function is the heart of Lead-DBS, reconstructing the electrode % lead trajectory for one side (left/right) of the MR-data. It reads two MR % images from a folder called 'patientname' and iteratively reconstructs a % line in 3D-spac...
438d4058e15a4b3f6b14a1a91bd58e26226b00aebc8babcdd18e87d19ebbfdb6
MATLAB
2,629
102
function obj = Empty( varargin ) %uix.Empty Create an empty space % % obj = uix.Empty() creates an empty space that can be used to add gaps % between elements in layouts. % % obj = uix.Empty(param,value,...) also sets one or more property % values. % % See the <a href="matlab:doc uix.Empty">documentation</a>...
9d6a8d58594abdec952e575aea59b81c57a7fcfd1d31400a31e1a16bf3ee6f4e
MATLAB
2,629
58
function Lsd = sdfactor(L,Lden, dense,DAt, d,v,y, At,c,K,R,y0,pars) %#ok % [Lsd,Rscl] = sdfactor(L,Lden, dense,DAt, d,v,y, At,K,R,y0,pars) % % SDFACTOR Factor self-dual embedding % % ******************** INTERNAL FUNCTION OF SEDUMI ******************** % % See also sedumi % This file is part of SeDuMi 1.1 by Imre Pol...
8902abc92e96fced891059e8e80d20cd1cf7a076db45bc41c04aadc759d8a282
MATLAB
2,630
62
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
bc758ed1161fbe4a613840d34db450ee8849ae9ad2d47d03c63b59a93cec4b5f
MATLAB
2,630
76
% pop_saveh() - save the EEGLAB session command history stored in ALLCOM % or in the 'history' field of the current dataset % % Usage: % >> pop_saveh( ALLCOM, filename, filepath); % >> pop_saveh( EEG.history, filename, filepath); % % Inputs: % ALLCOM - cell array of strings containing the EEGLA...
f591843f097e3da84cbe523dc1ddc93f674ee99b83d46a6876d51980cb183c92
MATLAB
2,631
59
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% CPC METACOGNITION TUTORIAL 2019: PLOT CONFIDENCE %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function to plot confidence scores from simulated and fit data %%%%%%%%%%%%%%%%%%%%%%%%%...
c2ac3cf15c7f07f7b2b38dd35ee939ada265bf3642b0b5f6d3547fe954b799df
MATLAB
2,633
97
% SOFA API - test script % Test some of the SOFA API functionality % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences % Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "License") % You may ...
04dc5d7008dc93a6cae4095e4e9b9e97d1600efa6b734443713448a0882c11f8
MATLAB
2,636
87
% script for interpolating 78-sample data to 129-sample data % using linear interpolation x = linspace(0,30,78); xq = linspace(0,30,115); for i = 1:length(flydata) for n = 1:size(flydata(i).fluordata,1) y = flydata(i).fluordata(n,:); yq1 = interp1(x,y,xq); flydata(i).fluordata_i(n,...
23cf7eadaf0e1e8f37f08d5f1972a3337f47e106c2ab81321cba36dc2b689ea0
MATLAB
2,636
92
function SaveEachChannel(animal,shank,data_dir) %Inputs: animal name, shank (1-8), and data_dir (directory containing raw %intan files with 1 minute chunks of data for all channels %Output: Matfiles with continuous raw data for each channel in the given %animal's analysis folder. Numbered 1-512 according to int...
bdac3d708f277c9ef6445865222cd459fa4354ded76d6a9b4b7e9f421b20cb01
MATLAB
2,636
97
function facenb=faceneighbors(t,opt) % % facenb=faceneighbors(t,opt) % % to find 4 face-neighboring elements of a tetrahedron % % author: Qianqian Fang, <q.fang at neu.edu> % % input: % t: tetrahedron element list, 4 columns of integers % opt: if opt='surface', return boundary triangle list % (should ...
08f2847e323eeef8c277c9007051010672be051ad4dc2062855c5abe90e13be3
MATLAB
2,637
75
function d=edit_distance_damerau_keylist(s,t) % Calculate the Damerau-Levenshtein edit distance for cell arrays of (string) % keys, e.g. % edit_distance_damerau_keylist({'the','quick','brown','fox'},{'the','lazy','dog'}) % % @author B. Schauerte <schauerte@ieee.org> % @date 2010 % Copyright 2010 B. ...
7fbf7746ca924597cebf094d45bd3abd1a8c4bed3c3753fd20f909c3a1c75aa1
MATLAB
2,637
52
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
55d6f0b69ea28a6ce58534e576689c2a6a68b0e239d18a849be09d48487f060e
MATLAB
2,639
69
function showclust(spikes, useassigns, show) % SHOWCLUST temporary utility to show clusters % SHOWCLUST(SPIKES, [USEASSIGNS], [SHOW]); if (nargin < 2) useassigns = spikes.hierarchy.assigns; end if (nargin < 3) show = unique(useassigns); end show = reshape(show, 1, []); smallWindow = 0.01; tmin = (size...
d1c8ea4e42d76ebbcda498f9de232b6d38d3443fe81088e3dec06451fdb4f58d
MATLAB
2,639
77
%%********************************************************************* %% sortA: sort columns of At{p} in ascending order according to the %% number of nonzero elements. %% %% [At,C,b,X0,Z0,permA,permZ] = sortA(blk,At,C,b,X0,Z0); %% %% SDPT3: version 3.1 %% Copyright (c) 1997 by %% K.C. Toh, M.J. Todd, R.H. Tut...
95107592a344fbd4a3dbbe5bc9bbb451656c698b7f16a34fe8c1dfbfc44c0164
MATLAB
2,640
64
%% function GibbsSamplerLDACOL %% % Runs the Gibbs sampler for the LDA-COL (Collocation) model. % % |[ WP,DP,WC,C,Z ] = % GibbsSamplerLDACOL( WS , DS , SI , WW , T , N , ALPHA , % BETA , GAMMA0, GAMMA1 , DELTA , SEED , OUTPUT % );| % %% % will run t...
da15231c29bc628fc89320a5b80c4f0b9eaa6220ee7d2798f09c8334847cdb8b
MATLAB
2,641
68
clear; %% load all modules %setenv('TZ','America/New_York') %addpath(genpath(pwd)) %addpath(genpath('/gpfs/data/basulab/SR/Scripts/MATLAB/Phoenix')) %path to CNMF %addpath(genpath('/gpfs/data/basulab/SR/Scripts/MATLAB/Phoenix/CNMF')) %path to CNMF %addpath(genpath('/gpfs/data/basulab/SR/Scripts/MATLAB/cvx')) %% load f...
4ca86e65c72acb415e43cdec683a408c7f29a62420fc479c2e76002dc73daf0e
MATLAB
2,642
77
% shortread() - Read matrix from short file. % % Usage: % >> A = shortread(filename,size,'format',offset) % % Inputs: % filename - Read matrix a from specified file while assuming four byte % short integers. % size - The vector SIZE determine the number of short elements to be % read...
b28d5f14c91ba40c179dacac1678ff86874a6303ca8ec6351c9cb0d76d5aac64
MATLAB
2,642
100
function b = ParseBatch(bfile) %ParseBatch - Parse batch file. % % USAGE % % b = ParseBatch(bfile) % % bfile batch file listing the parameters for each iteration % % SEE % % See also StartBatch, ShowBatch, InitBatch. % % Copyright (C) 2007-2013 by Michaël Zugaro % % This program is free software; ...
02a4795e551c9647fe692b005a0c349134c4c31920a374b1995daa35d7a2da83
MATLAB
2,643
70
function handles = Call_loadmovie(loadmovieflag, I1, Mem_max, w, f_wait, handles) tic if loadmovieflag if handles.datatype ~=3 %%%%% load movie in .tiff format%%%%%%%%%%%% imageinfo = handles.imageinfo; grad = handles.movieinputgrad; fext = handles.fext; mov = zeros([size(I1...