sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
99c3c16d7facf6528c0cfe2762fc22ccc08dac5be2a77217e14e8f880e108eec
MATLAB
3,088
77
% run the inputmapping to get handles function SelectfeatureForVisual(handles) figure(1), clf('reset') hold on %%%% display rois and traces if ~isempty(handles.im_norm) %%%% show spine rois handles = get_spineROImask(handles); roi_mask = handles.roi_mask; % roi_mask = zeros(size(handles.roi_mask)); ...
e5fb98230225e52c729ade3e3b403dca9510c49f9450b44c418c0ea873413ad0
MATLAB
3,091
98
classdef ( Hidden, Sealed ) FigureObserver < handle %uix.FigureObserver Figure observer % % A figure observer raises an event FigureChanged when the figure % ancestor of a subject changes. % Copyright 2014-2015 The MathWorks, Inc. % $Revision: 1435 $ $Date: 2016-11-17 17:50:34 +0000 (T...
7e10c9eeeae0c7ca60866abe4fea7b14d627297e3cac2bbd17b5b687a6f9a8ee
MATLAB
3,092
71
% 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...
c9fdbe989017dea6ea7841c29b7e670e2800a97831b3cc8298fb52388f9d28ff
MATLAB
3,092
97
%% Add all folders to path addpath(genpath(pwd)); %% Load raw data data = data_WT_raw(); % or 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 scenari...
d7074605e3a37f6aece2b8ee861b06ed9f3d0465a1527dfe9ca5ac0f59306ade
MATLAB
3,092
63
function info = getinfo(vr) %INFO=GETINFO(VR) % Returns a structure whose fields contain information about the opened % video object. The (minimum) set of fields in the INFO structure is % shown below: % url String specifying the data source, in the format preferred % by the plugin being use...
2c97c2bf255cafb37e07e54c586797c818292d0d1d7686406fd8892472627e39
MATLAB
3,093
98
function PlotShortTimeCCG(data,varargin) %PlotShortTimeCCG - Plot time-varying auto/cross-correlograms of point processes. % % USAGE % % PlotShortTimeCCG(data,<options1>,<options2>) % % data data obtained using <a href="matlab:help ShortTimeCCG">ShortTimeCCG</a> % <options1> optional list of pr...
d064c87b38f519a4ff712cc2aa274c738607d44251419d76dc0db3469cc8806e
MATLAB
3,095
90
% data = Doric.load(filename) % Load Doric's hdf5 datafiles (.doric) using typical dataset locations % corresponding to time, and demodulated signals 1 and 2. % % datasets = {'01-LockIn/Time', '01-LockIn/Values', '02-LockIn/Values'}; % data = Doric.load(filename, datasets) % Same as before but provide the name o...
5e615b1ad299296cfa6cf62e862bda25c8f50c4974310d7ab9378e118fba90ac
MATLAB
3,097
90
function l = IsExtremum(samples,varargin) %IsExtremum - Identify local maxima or minima. % % Find the maxima (resp. minima) in a signal by smoothing the signal and then % finding the points where the derivative goes from positive to negative (resp. % from negative to positive). % % USAGE % % status = IsExtremum(sa...
b1a538197212b59550709624d329154c3a1e6175a871c51ed0bfb3064109c74d
MATLAB
3,099
90
%%*************************************************************************** %% sqlpu2lblk: decide whether to convert ublk to lblk %% %% SDPT3: version 3.1 %% Copyright (c) 1997 by %% K.C. Toh, M.J. Todd, R.H. Tutuncu %% Last Modified: 10 Jul 2007 %%*********************************************************************...
2acde59d5420367bc584befb3a237c88960164b740117275a4cca342292b215e
MATLAB
3,101
86
% mtimesx_sparse does sparse matrix multiply of two inputs %****************************************************************************** % % MATLAB (R) is a trademark of The Mathworks (R) Corporation % % Function: mtimesx_sparse % Filename: mtimesx_sparse.m % Programmer: James Tursa % Version: ...
aa8a2afadc6e31039ef2bd172c5498077527d2b3a2cd7b6ce03cf45be6d699af
MATLAB
3,101
75
function postprocess_write_file_for_trajectories(filename_prefix,traj,traj_high,... traj_low,traj_time,taxa_names,o_write_original_data, concentrations, c_times) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers dynamical systems models from microbiome ti...
e6bea04164598eb39dcceebb6400366d1ccd8164b5d424513636c4f9bcccb435
MATLAB
3,101
106
function X = make_design(time, Fs, stimvec, acc_reg, extra_regs, varargin) %MAKE_DESIGN Build GLM design matrix consistent with the main pipeline. % X = glmproc.make_design(time, Fs, stimvec, acc_reg, extra_regs, ...) % % Positional inputs: % time : T×1 (seconds). Pass [] to auto-construct from Fs. % ...
d0061beedb42fa3d150701830e9ce6e684437e6939b9e746afda411eaa4b1888
MATLAB
3,102
82
function [dist] = warp_error(M, input, target, varargin); % WARP_ERROR computes the mean distance after linear or non-linear warping % and can be used as the goalfunction in a 3D warping minimalisation % % Use as % [dist] = warp_error(M, input, target, 'method') % % It returns the mean Euclidian distance (residu) wh...
ae4f6707fd08c334f052830d955360accb7210d15a6f5db75a7fd7475eb1efdc
MATLAB
3,103
80
%% Recording algorithm behavior with MatlabBGL % In this example, we will write a simple visitor that outputs an % algorithm's behavior. The algorithm we will examine is dijkstra_sp. To % examine the runtime behavior we will use a visitor which outputs a string % every time a function is called. %% Setup % ...
42fd4b71e75c37e0c85647d1e130c00553e26f7e8150976663bb200fd1dec31d
MATLAB
3,105
86
% 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...
89e4493fad50a236e7657e41a5b7b32c38ec26ec263159623eba909007861614
MATLAB
3,105
71
function ubj=saveubjson(rootname,obj,varargin) % % ubj=saveubjson(obj) % or % ubj=saveubjson(rootname,obj,filename) % ubj=saveubjson(rootname,obj,opt) % ubj=saveubjson(rootname,obj,'param1',value1,'param2',value2,...) % % Convert a MATLAB object (cell, struct, array, table, map, handles ...) % into a Universal Bin...
09fedc6f48d3aa7208a78f116e4eec976d0e062a76ce086201780bb69e07ba9d
MATLAB
3,107
97
% ttest_cell() - compute paired t-test. Allow fast computation of % multiple t-test using matrix manipulation. % % Usage: % >> [F df] = ttest_cell( { a b } ); % >> [F df] = ttest_cell(a, b); % % Inputs: % a,b = data consisting of PAIRED arrays to be compared. The last % dime...
179d7a691831417c4c08206cf3efaf91053b534e18e7c24475e3f827ea1074ed
MATLAB
3,108
73
function ApparentPositionVector = SOFAcalculateAPV(Obj) %SOFAcalculateAPV % APV = SOFAcalculateAPV(Obj) calculates the apparent position vector % (APV) which represents the position of the source relative to the % listener's position and view. APV is in the format [azi ele radius] % with units [deg deg m]...
4155e853915ea51e0f763b065e57d93178bf0e4d473b2e1045fb6b7890d6b803
MATLAB
3,109
101
function importCellMaskOO(processOrMovieData,varargin) %importCellMask imports a previously-defined cell mask to movieData % %Khuloud Jaqaman, March 2015 % % Copyright (C) 2021, Jaqaman Lab - UTSouthwestern % % This file is part of conditionalColoc. % % conditionalColoc is free software: you can redistribute it and/o...
83e919fd48d164d26516816215eb56bb0005259c40a8444f7bbd973636c20b96
MATLAB
3,109
61
% 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...
f05302fdf0229f1de6dbcc0a0607d6e2bbbb0d2190708740afac762054158d6c
MATLAB
3,110
76
function [C, lags] = pxcorr(x, varargin) %PXCORR Efficient cross-correlation for point process data. % C = PXCORR(A,B,Fs) returns the cross-correlation between A and B at % sampling rate Fs for the point process whose times are given in the % length N(>1) vector A and the length M (>1) vector B. C wil...
0f15ca8be89d25280783f89be5d0d797c93da8c544383118d7f7bf9dadc325da
MATLAB
3,112
122
function AUC = bootstrapOOB_PLSDA(X, Y, C, opts) % bootstrapOOB_PLSDA Out-of-bag bootstrap AUC for one resample. % % AUC = bootstrapOOB_PLSDA(X, Y, C, opts) % % Draws one bootstrap sample of subjects WITH replacement, trains on it, and % evaluates on the out-of-bag subjects. Repeated by the caller nBoot times to...
f10861b1d631d3ec5e3c307c84d12abfae872d24676f3bdc584dbf6441a8d0b6
MATLAB
3,112
77
function ea_plot_fiber_state(varargin) % example % ea_plot_fiber_state('/home/forel/Documents/data/TWEEDMiniset/derivatives/leaddbs/sub-TWEED02/stimulations/MNI152NLin2009bAsym/tst/subthalamopallidal/PAM/sub-TWEED02_sim-fiberActivation_model-ossdbs_hemi-R_tract-gpe2stn_ass_right.mat') fiberActivationProb...
0b446a4ae44477293f7a3ade6daf86b430ba97e721a89840e0c782628546a564
MATLAB
3,113
118
function [pval, k, K] = circ_kuipertest(alpha1, alpha2, res, vis_on) % [pval, k, K] = circ_kuipertest(sample1, sample2, res, vis_on) % % The Kuiper two-sample test tests whether the two samples differ % significantly.The difference can be in any property, such as mean % location and dispersion. It is a circula...
de913004cf0b7847cf3043d344502be8b376a23f10344375b2517874c9c6864b
MATLAB
3,114
102
function H=subindex_extended(method, side) %SUBINDEX Label subplots with an index (e.g. a,b,c) % SUBINDEX labels subplots in the current figure with an index in % the top left corner. % % SUBINDEX(METHOD) labels subplots with an index defined by METHOD. % Options are: % METHOD = 'letter' : a, b, c, etc. (defa...
83544f74e7279bdcda5e60817db41ea8b8e628c85321b94b6cbf58313a90c203
MATLAB
3,115
74
function ea_postprocess_multisource_axonstates(axonStateFolder,options,settings) % Merge multisource axon states using logical disjunction. % IMPORTANT:this is a special case for multisource prob. PAM % By Butenko, konstantinmgtu@gmail.com arguments axonStateFolder % folder where axons states across samples a...
c1dfb535f90f9f104a85da7504f98ebdb046cf2df2ed97a26977109383ac3f02
MATLAB
3,115
74
function CBIG_MMLDA_brain_to_zscore_create_refpara(vol4D_bl, mask, ind_CN_bl_brain, regressor_bl_brain, zscore_method, output) % CBIG_MMLDA_brain_to_zscore_create_refpara(vol4D_bl, mask, ind_CN_bl_brain, regressor_bl_brain, zscore_method, output) % % Create a mat file which contains reference parameters for CBIG_MMLDA_...
fd4c2a4ef13ffe6047b707145c1a90c5bbef814a6a3071576f3ede58e6178f43
MATLAB
3,115
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 %modific...
27ef62ad59829232afe47bb4f39031a1b185a85214977598a13a2f52f5a58820
MATLAB
3,116
117
%% NAVIGATE TO `IMAGING METADATA` FOLDER clear alldates = {'250909','250911','250916','250917','250919'}; % alldates = {'250929','250930'}; % alldates = {'251017','251020'}; cd(alldates{5}) %% listing = dir('f1*'); %% alldata.expID = []; alldata.expdate = []; alldata.trial = []; alldata.leftstacks = [];...
a4662184215478253217dddb44fe7d2d1eabffc1734ce1149d63bc80a6602412
MATLAB
3,116
100
% Name: Robert Kim % Date: 05-10-2026 % export_instr_lesion_results_to_excel.m % Description: Export one-layer instruction lesion-result .mat files into a % single Excel workbook with one sheet per lesion file. Each sheet contains % three columns: % 1) trained model filename % 2) anti performance % 3) pro perform...
fee81fc8fcaa0b0031fd09a66bfe34e6d6fc2f7094bad95696ce5310d09b980c
MATLAB
3,117
110
function [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, varargin) % Kalman filter. % [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, ...) % % INPUTS: % y(:,t) - the observation at time t % A - the system matrix % C - the observation matrix % Q - the system covariance % R - the o...
ac678c41ddec165435ce9c84cfd1f95b28c47f9ee2bb4944ac7d447df5fee557
MATLAB
3,118
91
% eeg_point2lat() - convert latency in data points to latency in ms relative % to the time locking. Used in eeglab(). % Usage: % >> [newlat ] = eeg_point2lat( lat_array, [], srate); % >> [newlat ] = eeg_point2lat( lat_array, epoch_array,... % srate, timelimi...
00fc19124c48a78e89a3ec48ad654696a17376bbc297f80c052d9315be3128da
MATLAB
3,120
37
function SANDIinput = InitializeSANDIinput(ProjectMainFolder, Delta, smalldelta, SNR) SANDIinput = struct; % Initialize the variable containing all the SANDI analysis info %%%%%%%%%%%%%%%%%%%%%%%%%%% USER DEFINED INFO %%%%%%%%%%%%%%%%%%%%%%%%%%%%% SANDIinput.StudyMainFolder = ProjectMainFolder; % <---- USER DE...
25bec72b929a04f6808d2814f609258c76725e8b573c3c02dc33655d2534b19a
MATLAB
3,122
116
% Figures 6.21-6.23: Basis pursuit using Gabor functions % Section 6.5.4 % Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Argyris Zymnis - 11/27/2005 % % Here we find a sparse basis for a signal y out of % a set of Gabor functions. We do this by solving % minimize...
3c75abc33389e0c29d1362e8dae3f7ff58d4ce62aeb9d58714bbd91c11c27c2b
MATLAB
3,122
117
function browsePETHs(peths, grid, tPts) % browsePETHs - GUI for paging through batches of PETH plots % % Usage: % browsePETHs(peths, [rows, cols]) if nargin < 2 grid = [5, 8]; % default grid if not specified end batchSize = prod(grid); nPeths = length(peths); nPages = ceil(nPeths / b...
6cd80e3a9d299798ec3d68e09e1b8bbb60eb32a319231f60fb388e88f298ad4c
MATLAB
3,122
95
% std_uniformfiles() - Check uniform channel distribution accross data files % % Usage: % >> boolval = std_uniformfiles(STUDY, ALLEEG); % % Inputs: % STUDY - EEGLAB STUDY % % Outputs: % boolval - [-1|0|1] 0 if non uniform, 1 if uniform, -1 if error % % Authors: Arnaud Delorme, SCCN/UCSD, CERCO/CN...
a59bf43a26e4ca6c8650a6b4fe65f308e5b378b257939b9f15d2b76b3d750e7f
MATLAB
3,122
79
function ea_postprocess_multisource_pam(options,settings,side) % Merge multisource PAMs using logical disjunction. % IMPORTANT:fiberActivations here have the same pre-filtering with % Phi_vector_max. That is why they contain the same fibers and can be % merged directly % By Butenko, konstantinmgtu@gmail.com arguments...
4a1e50737a31bc82960a20eaf998ceb9c33dee8f7d3de539bd463cd174c6b8c0
MATLAB
3,125
99
% compute empirical p-vals under the null hypothesis that observed samples % come from a given surrogate distribution. P-values for Type I error in % rejecting the null hypothesis are obtained by finding the proportion of % samples in the distribution that % (a) are larger than the observed sample (one-sided test) % (b...
d696920d8ba1e7a47d13661f650beef391d2b80f2fb2ec65e72f3867819534f2
MATLAB
3,126
86
function smoothed = smooth3f(data, filt, sz, arg) %SMOOTH3F Smooth 3D data (fast version). % W = SMOOTH3F(V) smoothes input data V with a Gaussian kernel. The % smoothed data is returned in W. % % W = SMOOTH3F(V, 'filter') Filter can be 'gaussian' or 'box' (default) % and determines the convolution...
c8bb98e2bc9d888aaf0c9e0c8e6a76c2de3d9d86744e4a34d2d34ec5fd9619b4
MATLAB
3,127
87
function [scalingFactor_uV, channelMapImro, probeType] = readSpikeGLXMetaFile(param) % JF % read spikeGLX meta file and calculate scaling factor value to convert raw data to % microvolts % ------ % Inputs % ------ % metaFile: string, full path to meta file (should be a structure.oebin file) % ------ % Outputs % ------ ...
f767b55e03971574e5bc895690d1a492d85dc7bb3a037f6be1bba611eb3556e4
MATLAB
3,127
102
function cdata = loadIcon( filename, bgcol ) %loadIcon Load an icon and set the transparent color % % cdata = uix.loadIcon(filename) loads the icon from the specified % filename. For PNG files with transparency, the transparent pixels are % set to NaN. For other files, pixels that are pure green are set to % ...
09b426d1bc51322c64e0b30ffe084a002362fe7455da6f837a3d0480610db670
MATLAB
3,128
76
function [weights, anglebins] = anglehist(Z, bins) %ANGLEHIST Magnitude-weighted angle histogram of polar data. % WEIGHTS = ANGLEHIST(Z) histograms the angles of complex data Z into 10 % equally spaced bins around 2*pi, with each element in Z contributing % an amount equal to its magnitude to its correspo...
34876f5fc099207d0734e887f1cfe9c481fa77650678106c015b6b63534ee8c6
MATLAB
3,128
90
function ClincFreq_D2V(INDIR,OutD2Vdir,voxelsize,Ventricledir,Ventriclematdir) [Vven,Dven] = Dynamic_read_dir_NIFTI(Ventricledir); [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; load(Ventriclematdir); Dvens = reshape(Dven,Vven.dim); for i = 1:size(ROItab,1) indexs ...
0809205c135538b47ac556b3d740dfd4cfd919d79793a21872699ba4522ecb02
MATLAB
3,130
75
function [node,elem,face,regions]=vol2mesh(img,ix,iy,iz,opt,maxvol,dofix,method,isovalues) % % [node,elem,face,regions]=vol2mesh(img,ix,iy,iz,opt,maxvol,dofix,method,isovalues) % % convert a binary (or multi-valued) volume to tetrahedral mesh % % author: Qianqian Fang (fangq <at> nmr.mgh.harvard.edu) % % input: % img:...
4e86d0f7bccadbbb7660949f674832b376d01e7675149383a4d01059d1dbc7d3
MATLAB
3,130
97
function data = AFOFdata_struct10(inputdata, filenames) % USE THIS FOR EXP1+5 (CEM) % how it works: % fly = AFOFdata_struct(data,filenames) where data and filenames are % outputs from rotoball_importer() for e = 1:length(inputdata) for t = 1:size(inputdata{e}{1},1) trial.filename = filenames{e}; ...
88df462d85570514066a535fff6d18b83222f2e077c5050b31d833598f8b1537
MATLAB
3,130
97
function [strmodelshading, strfaces_colors, strfaceshading, strcolors,... nface_vertex_data_unique] = mesh_diffuse_colors(faces, points, face_vertex_data) % File: mesh_diffuse_colors.m % Author: Ioannis Filippidis, jfilippidis@gmail.com % Date: 2012.06.10- 2012.06.24 % Language: MATLAB R201...
b6071c071fcd56ae5a53e9aa4ffb2a21a3823f9d39a102eaed5849f25682408b
MATLAB
3,132
77
function []=v2structDemo2() % V2STRUCTDEMO2 is a usage example demo function for the function V2STRUCT. This demo % shows a suggestion for how to use v2struct in managing input to other functions with % improved usability. % %% Last update: % 30.06.2011, Adi N. fprintf(['Running usage demo function for vs2truct ...
24ff4350ba4d4821882b823bc82a8016b6916a44caa8266a6f18e286425fff2d
MATLAB
3,133
91
% questdlg2() - questdlg function clone with coloring and help for % eeglab(). % % Usage: same as questdlg() % % Warning: % Case of button text and result might be changed by the function % % Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 11 August 2002 % % See also: inputdlg2(), errordlg2(), s...
8576906c1d67f0014567069773b2f86985c315e3b72aa0e9c35cba3aa59d5636
MATLAB
3,135
80
function options = ea_prepare_dti_bids(options) % Copy DWI files from BIDS rawdata to derivatives with BIDS-compliant names directory = [options.root, options.patientname, filesep]; % Create preprocessing/dwi directory if needed derivDwiDir = fullfile(directory, 'preprocessing', 'dwi'); if ~isfolder(derivDwiDir) ...
e610aa59778df5208b94067d6366e6df0610832654b9b5c65c68f3a01ac2abaa
MATLAB
3,136
103
function data = balldata_struct(inputdata, filenames) % how it works: % fly = balldata_struct(data,filenames) where data and filenames are % outputs from rotoball_importer() for t = 1:length(inputdata{1}) trial.filename = filenames{1}{t}; trial.fps = round(1/mean(diff(inputdata{1}{t}(:,1)))); trial.wind_s...
0493b9fd78b54b5fef92c901b7b6c6c7250f00e9970259b6250ace20cb507c7a
MATLAB
3,138
77
%% a2_plot_TF % Plot time frequency % C. baratin, J. bastin, G. Becq 20260603 rois = ["PFCvm", "aIns"]; for iroi = 1: 2 plot_roi(rois(iroi)) end function plot_roi(roi) T1 = readtable(roi + "_h.csv"); T2 = readtable(roi + "_TF.csv"); T3 = readtable(roi + "_p.csv"); temp = table2arra...
0d9bb709fdc9ea4d09972d16d9fd50422c473debdc549c8fe67e5c08ae2a9522
MATLAB
3,139
70
function [proportionImg, imgMask, xBounds, yBounds] = makeProportionMap(binaryVals, valPositions, gridRes, xLimits, yLimits, smoothSD) % Computes a binned and smoothed image of bin proportions for % spatial location data with binary memberships % % This function bins the ROI cell positions, computes the ratio of % logi...
75958a864a1498eca313b12e4ad7ccb60155ecb50f36149e75ba4c4997f2d105
MATLAB
3,143
86
function [VD,error] = LCN_LOGAN(MIDSCANTIMES,C_MEASURED,CA_TIMES,CA,logan_start_time,figure_nr) % LCN_LOGAN.m % % calculates the slope of the Logan plot. The slope is the distribution % volume VD % % FORMAT [VD,error] = LCN_LOGAN(MIDSCANTIMES,C_MEASURED,CA_TIMES,CA,logan_start_time); % % INPUT VARIABLES %-------------...
a6950cce605b7ce3452f15b1f897d86cc8b1e4d959d261e3388116ad5dbdd5fb
MATLAB
3,143
96
function varargout = ea_explorer_stats_2sampleweightedlinreg(varargin) % Function to estimate a certain mass univariate test (see below) as used % in explorer apps. % - Expects valsin as V x N matrix where % V is the number of % voxels/streamlines...
f3a75561cb325d913c1cfc9b820565f37debb13ccdfcf901f4f2348d7b300732
MATLAB
3,145
97
% pop_firpmord() - Estimate Parks-McClellan filter order and weights % % Usage: % >> [m, wtpass, wtstop] = pop_firpmord(f, a); % pop-up window mode % >> [m, wtpass, wtstop] = pop_firpmord(f, a, dev); % >> [m, wtpass, wtstop] = pop_firpmord(f, a, dev, fs); % % Inputs: % f - vector frequency band edges % ...
0f284f51d94a61ee2e76bf6354117a340dcd3c9bad79246f9dde2e5ce090d7da
MATLAB
3,149
51
%----------------------------------------------------------------------- % Job saved on 11-Apr-2016 11:51:36 by cfg_util (rev $Rev: 6460 $) % spm SPM - SPM12 (6470) % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md %-------------------------------------------...
b66c8ceb57d6bcad12a36a5aad6d1480df3d39a295aabb78ae53f30b876e7223
MATLAB
3,149
51
%----------------------------------------------------------------------- % Job saved on 22-Apr-2016 17:56:02 by cfg_util (rev $Rev: 6460 $) % spm SPM - SPM12 (6470) % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md %-------------------------------------------...
a71c30b1e12a13160c00bfb8418a04248908638e685ec909a428b89196b1d121
MATLAB
3,150
66
% 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...
41c8e8c39edf3d2608661f512f3533270a99940741ded2117d690544acd89da5
MATLAB
3,151
100
% strmultiline() - format a long string as a multi-line string. % % Usage: % >> strout = strmultiline( strin, maxlen, delimiter); % % Inputs: % strin - one-line or several-line string % maxlen - maximum line length % delimiter - enter 10 here to separate lines with character 10. Default is % ...
df119dfcd2011b37c0fdf2e8940f712aceebf49228dc438ce79fd64186bbfc69
MATLAB
3,151
109
function varargout = palm_lowrank(varargin) % Do various tasks related to lowrank matrix completion. % % Usage: % U = palm_lowrank(G) % [Grec,mom] = palm_lowrank(G,U,nsel) % Grec = palm_lowrank(G,U,ysel) % % _____________________________________ % Anderson M. Winkler % FMRIB / University of Oxford % May/...
6267f0d582337fa82eaf3abfc9ce35e4f477bbce0a9298857586eba0b4b5fbca
MATLAB
3,153
58
function [corr_lasso,corr_select,corr_L2,rms_lasso,rms_select,rms_L2] = computeCdiffTrialTrajectories(T,trials,data_counts,BMD,intervene_matrix,intervene_matrix_filtered_merge,keep_species,experimentBlocks) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers ...
a44237f951e50419d4e66987ea18c9d795f4a715f6fa51aa6c3dee07c864df1a
MATLAB
3,154
77
%% 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...
adf43f558723383d2ab8a8e7b2ed8aaed7aa93c100cc52fd656e47d2b9253cdd
MATLAB
3,154
77
function ea_gentargetreport(M) thresh = inputdlg('Please enter threshold in mm:','Enter threshold...',1,{'0.5'}); if isempty(thresh) return end thresh=str2double(thresh{1}); conInd = arrayfun(@num2str, 1:max(M.S.numContacts), 'Uni', 0); rnames = [strcat('k', conInd, 'R'), strcat('k', conInd, 'L')]; for thr=0:1 ...
a3edd3fd8dcc0c1af3fae02949fe63b2a8edab2939b394dd17d61fc3f817a3f4
MATLAB
3,155
63
function info = getinfo(vr) %INFO=GETINFO(VR) % Returns a structure whose fields contain information about the opened % video object. The (minimum) set of fields in the INFO structure is % shown below: % url String specifying the data source, in the format preferred % by the plugin bei...
b5678ffaa3ef79ab801dcb8a0505f7404dcb69f8caeb7353fecc914f4af1d324
MATLAB
3,155
94
function [P, beta] = d2p(D, u, tol) %D2P Identifies appropriate sigma's to get kk NNs up to some tolerance % % [P, beta] = d2p(D, kk, tol) % % Identifies the required precision (= 1 / variance^2) to obtain a Gaussian % kernel with a certain uncertainty for every datapoint. The desired % uncertainty can be specified...
9a15a8eb69444e49a69d43855bdf8a17c99bfbe4b359df3ea91100ee449a9bff
MATLAB
3,156
88
% std_selcomp() - Helper function for std_erpplot(), std_specplot() % and std_erspplot() to select specific % components prior to plotting. % Usage: % >> std_selcomp( STUDY, data, cluster, setinds, compinds, comps) % % Inputs: % STUDY - EEGLAB STUDY structure. % data -...
e7ea9fe7c840dd07c0b0e58a3c8b7704c1ba5edd3ea5bb5084655a3e62455914
MATLAB
3,157
107
function [baseline, pVals] = CBIG_ASDf_hypoTest(betas, stats, numReg, k) % [baseline, pVals] = CBIG_ASDf_hypoTest(betas, stats, numReg, k) % % This function performs hypothesis test for GLM for two-, three- and % four-factor estimates. % % Input: % - betas: % betas output from MATLAB glmfit.m function %...
9f9baadc308013330edd8d5b8d2da2e0193aeadffef9a17e88e242ad278b8882
MATLAB
3,159
74
% eeglab_error() - generate an eeglab error. % % Usage: >> eeglab_error; % % Inputs: none, simply capture the last error generated. % % Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- % % see also: eeglab() % Copyright (C) 2006 Arnaud Delorme, Salk Institute, arno@salk.edu % % This program is free software; you can re...
bef97e58fca6ddf9b407642b8752157d539d8f04efff4f9ec5ede7256fca00bd
MATLAB
3,159
80
function yi = interp1qr(x,y,xi) %% Quicker 1D linear interpolation % Performs 1D linear interpolation of 'xi' points using 'x' and 'y', % resulting in 'yi', following the formula yi = y1 + (y2-y1)/(x2-x1)*(xi-x1). % Returns NaN for values of 'xi' out of range of 'x', and when 'xi' is NaN. % % 'x' is column vecto...
569b3b5f8473b311f0e4e350eee03359295e47e5bb168f532babb091be8eabf6
MATLAB
3,161
129
function sm_data = G_Smooth( data, dim, N, method) % Smooth along any dimension for N-d matrix % % Usage % data = G_SmoothD( data, dim, N); % data = G_SmoothD( vector, [], N); % data = G_SmoothD( data, dim, N, method); % % Input % data, N-d matrix, If data is a vector, the dim will omitted. % dim, alon...
60202f8f58d5d966545f38d0fd407588a65b65e604d108ab352f7fa6b04c5f68
MATLAB
3,164
108
function [ch] = getchannels_drift(animal, shank, set) %Get channel-brain region assignments depending on time period of recording - this is %done to help account for drift %Inputs = animal ID string, shank number (1-8), set %Other files needed within Matlab file path - 3 mat files with different sets of chan...
6c83353ce31263238f6641588ae806885771c56ce53d216dd93180ea6e23997b
MATLAB
3,166
131
function [nz, nan_count, off_set] = determine_rois_with_minimumNZ(CN_a2, bl_dir, n, Sa, t_result_dir) % Author: Betty Tijms 19.01.11 %% Extract the regions of interest according to 'template' bl_ind. % CN_a2 - list of the directories of the bl_ind --> the bl_ind with different off_sets % n - the dimensions of the cube...
23e1643f8fa584ec645b450368fa5381108b0de1cd199a4e02ee760aecef8800
MATLAB
3,169
87
% erpregout() - regress out the ERP from the data % % Usage: % newdata = erpregout(data); % [newdata erp factors] = erpregout(data, tlim, reglim); % % Inputs: % data - [float] 2-D data (times x trials) or 3-D data % (channels x times x trials). % % Optional inputs: % tlim - [min max...
6e12e936f928d0653c1012f33bc3fab057f1e025d0f669808d22c370e8a5c108
MATLAB
3,169
89
% floatwrite() - Write data matrix to float file. % % Usage: >> floatwrite(data,filename, 'format') % % Inputs: % data - write matrix data to specified file as four-byte floating point numbers. % filename - name of the file % 'format' - The option FORMAT argument specifies the storage format as % ...
0e72b53a7bf846f9a6864a57fd6f25bf9476dc4e301ba55a9cb7f98f0fe251e1
MATLAB
3,170
72
function Obj=SOFAconvertTUBerlinBRIR2SOFA(irs) % OBJ=SOFAconvertTUBerlin2SOFA(irs) converts the HRTFs described in irs % (see TU-Berlin HRTF format) to a SOFA object, using the MultiSpeakerBRIR % Convention. % % SOFA API - demo script % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of ...
07964b38ca7207169d0cb44ce00d0fb6a40b0d68d4460ecd6fb48fa91935cd7f
MATLAB
3,172
61
function checkAndConvertRawWaveforms(savePath, spikeTemplates, spikeClusters) rawWaveformFolderNew = dir(fullfile(savePath, 'templates._bc_rawWaveforms_kilosort_format.npy')); rawWaveformFolderOld = dir(fullfile(savePath, 'templates._bc_rawWaveforms.npy')); % Check if need to convert to new format. old format was alw...
6525cf718bec769f29d6b6f9260a46e876e3139ace0e6586aca38ac5768e5016
MATLAB
3,172
92
% eeglab %foldername = 'C:\Users\yh19218\OneDrive - University of Essex\PG Research\3_Data\Rename';%For Windows foldername = '/Users/yiyuan/OneDrive - University of Essex/PG Research/3_Data/Rename';%For MacOS fileDetail = dir(foldername); filename = {}; % Read al file names conteined in the targeted folder for r = 3:si...
fb94b18040ee83dd87069211b2d4a2f93fccee32c968a82abd0056150d647fa0
MATLAB
3,172
92
function plotgraph(A,xy,weights) % Plots a graph with each edge width proportional to its weight. % % Edges with positive weights are drawn in blue; negative weights in red. % % Input parameters: % A --- incidence matrix of the graph (size is n x m) % (n is the number of nodes and m is the number of e...
1808fbc849fded0163b2c0bf68324d49301d9f593b30d29afff61951b4da6f63
MATLAB
3,174
87
% Construct spherical harmonics basis matrix at specified points. % % SYNTAX: [basis] = construct_SH_basis(degree, sphere_points, dl, real_or_complex); % % INPUTS: % % degree - maximum degree of spherical harmonics; % sphere_points - n sample points on sphere; [nx3] % dl ...
9c1af197b1bb405f027608422a49df060a3fa2a0cd0c17fcca0ccb67c92c701c
MATLAB
3,176
136
function dacq_posSwitch(fname) %[root.scaleFactor, root.ts, root.x, root.y, root.headdir, root.epoch] = %dacq_pos(dataPath,prefix) % % Finds video file with the prefix "prefix" in folder "dataPath", and % returns relevant spatial information for a CMBobject % Bill 2012.06.20 %file information %file = strcat(prefix,'....
fad99ccdb6d8400d6dd4137e23b6d57a43d84d084a61d095f9e59ccea4721609
MATLAB
3,177
86
function [node,elem]=meshcheckrepair(node,elem,opt,varargin) % % [node,elem]=meshcheckrepair(node,elem,opt) % % check and repair a surface mesh % % author: Qianqian Fang, <q.fang at neu.edu> % date: 2008/10/10 % % input/output: % node: input/output, surface node list, dimension (nn,3) % elem: input/output, su...
21d21b82d5b4dd7ea028d722c454b5e33f68afc451f895a087fb0e2879988150
MATLAB
3,178
83
function distance = Distance(positions,reference,varargin) %Distance - Compute instantaneous distance to a reference point. % % USAGE % % distance = Distance(positions,reference,<options>) % % positions a list of position samples % reference reference point (same coordinates as positions) % <opt...
9d609a8d8114c0e9943f54c5532a64e736325e69516e248d19bf800ac957908c
MATLAB
3,178
114
function CFAT % clinic frequency analysis main function % Version 1: fisrt build in 02 Dec. 2021 % Updata on 11 Mar. 2022 % Qiang Xu, % Department of Radiology, Jinling hospital % Medical School of Nanjing University % fmrixuq@126.com %%========================================================================= % part ...
9cc258c691898cc75e408544b8362303c93d13f2e80c32c16d1c5f5057c47ac1
MATLAB
3,181
84
%%****************************************************************** %% dwd: distance weighted discrimination. %% %% [w,beta,residp,residn,totalviolation,X,y,Z] = ... %% dwd(Ap,An,penalty); %% %% You're given two matrices, A+ and A-, whose columns %% give points in R^n you want to separate "nicely" to allo...
abf8cfe8803624046ce1ea322bda3c6d30241208b3bd9894446f0a4ed10ff6a7
MATLAB
3,182
105
%% INVERSEFNOISE - generates 1/f^alpha noise % Generates noise with 1/f^alpha spectral power density over a specified % range of frequencies. % % Syntax: [noise] = inverseFNoise(n, alpha, Fs, varargin) % % Input: % n (integer) - the number of desired data points in the sample. % alpha (double) - the exponent of th...
b5cfd9ebf3a5b573b9a845eb32b81ddf940042296542780526da17a7c78ec754
MATLAB
3,182
79
% readneurodat() - read neuroscan location file (.dat) % % Usage: % >> [ CHANLOCS labels theta theta ] = readneurodat( filename ); % % Inputs: % filename - file name or matlab cell array { names x_coord y_coord } % % Outputs: % CHANLOCS - [structure] EEGLAB channel location data structure. See % ...
1863cbda1fab6549e9dba1333a030b61d5b391548c2047f5554abb7c83682c89
MATLAB
3,185
102
% Digital circuit sizing % Boyd, Kim, Vandenberghe, and Hassibi, "A Tutorial on Geometric Programming" % Written for CVX by Almir Mutapcic 02/08/06 % (a figure is generated) % % Solves the problem of choosing gate scale factors x_i to give % minimum ckt delay, subject to limits on the total area and power. % % minimi...
4bac23b917cec7dbcf3c29579dc74d012a1208ae287dfabb66fd2686765dfcb6
MATLAB
3,185
93
function ea_lg_exportstats(M, output) if ischar(M) if isfolder(M) % M is the group folder load(ea_getGroupAnalysisFile(M), 'M'); elseif isfile(M) % M is the path of the lead group file load(M, 'M'); end end if ~exist('output', 'var') output = strrep(ea_getGroupAnalysisFile(M.root), '.m...
751e1b324dae622a7e593c420d716a36add8c5e55e827809b84a5ae6f8e672d0
MATLAB
3,186
59
function [data_out,trial_count] = Trinh_automaticartefactdetect(data_in, method, sliding, threshold, window, channels,reject_method) %% function to automatically detect artefacts according to a sliding window approach % can be used for range or standard deviation % method is then either 'range' or 'stddev' % slidi...
f21b04b36c603818d4277dd30661d74858d88b8a0dc3724f9374245e3393b935
MATLAB
3,187
64
function CBIG_ArealMSHBM_generate_ini_params_Schaefer(seed_mesh, targ_mesh, resolution, out_dir) % CBIG_ArealMSHBM_generate_ini_params_Schaefer(seed_mesh, targ_mesh, resolution, out_dir) % % This script will generate initialization parameters which are initialized by Schaefer2018 % parcellations in a given surface sp...
8b2e170ae27a3bfeb8d6fd79ba3f29728f47d7e8d5454f54dacbcd2a44ea9fab
MATLAB
3,188
81
function EXPORT_SUCCESS = prairieView_ExportCoordFile(coord_path, xyz_loc) % SYNTAX: EXPORT_SUCCESS = prairieView_ExportCoordFile(coord_path, xyz_loc) % % METHOD: exports xyz coordinates to filesystem in format that can be % loaded by prairie view. % % INPUT: % coord_path [r, path]: string of full file path wh...
be0c5f9e43fab5507c305c0299dbbf334526bcc83d76f60e40ad2386ce47efa8
MATLAB
3,188
87
function str = mean2str(m,s,n,varargin) %mean2str - Convert mean or median and SEM (or confidence interval) to string. % % USAGE % % s = mean2str(m,s,n,<options>) % % m mean or median % s standard error (see <a href="matlab:help sem">sem</a> or <a href="matlab:help semedian">semedia...
6b29f08d873f30ac2e780a84e262ef1ca685d908b75fa7476da3b29bd252c173
MATLAB
3,191
83
function ea_get_native_Eproj(tractset,stim_ID) % Comptute E-field metrics on fibers warped into native space. % The results are stored as % patient_folder/miscellaneous/connnectomeName/stim_ID/E_peak.mat (values for all fibers in the connectome!) % By Butenko and Roediger, konstantinmgtu@gmail.com arguments tracts...
c750478b947aca3945171763b2a3eb9d2378f01938a7821f4799445f11da4738
MATLAB
3,193
135
function [adfreq, n, ts, fn, ad] = plx_ad(filename, ch) % plx_ad(filename, channel): Read a/d data from a .plx file % % [adfreq, n, ts, fn, ad] = plx_ad(filename, ch) % % INPUT: % filename - if empty string, will use File Open dialog % channel - 0 - based channel number % % a/d data come in fragments. Eac...
f0284734077b9b8037ae7e63ce5d42ab2bbbf16ed7aa1e11517296cc3dd07ece
MATLAB
3,194
78
function labels = validateAtlasLabels(atlasData, p, caller) % validateAtlasLabels Check that atlas label i really is feature i. % % labels = validateAtlasLabels(atlasData, p, caller) % % The three diagnostic plotters paint results into a NIfTI with % % for i = 1:p % mask = atlasData == i; % ...
91c007c0f705c50f45c9db1625f59e921a5c4b3328fd1a39a87b5dd6b9cf36f1
MATLAB
3,195
105
function compile(varargin) %% History % 2008-04-01: Added check for pre Matlab 2006b for non-large dim % sparse matrices. %% debug = 0; if strmatch('-debug',varargin), debug=1; end verbose = 0; if strmatch('-verbose',varargin), verbose=1; end clear mex mbglfiles = {'astar_search_mex.c', 'bfs_mex.c', 'd...
f774d25ac7e6239185b267e924cbaa0e2843f1506363dced261830b9f1b29e8b
MATLAB
3,195
85
function Vout = LCN12_write_image(img,outputfilename,description,datatype,Vref) % LCN12_write_image % % this script will read an image in matlab. % % syntax: Vout = LCN12_write_image(img,outputfilename,description,datatype,Vref) % % INPUT % img = 3D or 4D matrix of an image % outputfilename = name o...
33a8889b9c9376cd015c318d27bf1e5a9dae4c5e59203e3657b910a207bba222
MATLAB
3,196
97
function ref = ea_create_union_ref_nii(outPath, inFiles, voxSize) % CREATE_UNION_REF_NII Build an empty reference NIfTI covering the union % of multiple inputs, at a chosen voxel size. % % outPath : output .nii or .nii.gz for the reference % inFiles : char or cellstr of input NIfTI paths % voxSize : [vx vy vz] in mm (...
ef4bd41a5bdc734e207e4b11d51cfba996701941c4f6d71b867e01fedee4c3d0
MATLAB
3,197
105
% 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...
f8d1e95d43cda3a3672e4bd870911dbba895ffcfddd87962c80ddfc35e0311e8
MATLAB
3,197
88
function [coef, X] = llsFitSH(dirs, y, order) % Author: Jelle Veraart and Santiago Coelho (jelle.veraart@nyulangone.org) % copyright NYU School of Medicine, 2022 %X = getSH(order, dirs, 0); X = getSH(order, dirs); coef = X\y; end % function Y = getSH (Lmax, dirs, CS_phase) % % % Ylm_n ...