sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fafcd6109f3741c44cfd8fbd104c7a31a30352990216112b04f1ddd4b7d9f933
MATLAB
3,337
108
function N = spreador( I, V, p, n ) % SPREADOR Spread orientation alog a surface for a given oriented point from the surface % INPUT: % I - Input binary surface mask % V - Normal unoriented vector 3D field % p - initial point coordinate % n - initial oriented normal in p % OUTPUT: % ...
319f164e8b2b63e9b6cc7c8d95f503d88101be5fbc64cefdd3d79cf06d398ad7
MATLAB
3,338
90
function makePlatformSpecificFig(figFile,newFigFile,targetPlatform) % figFile: name of original .fig file (with extension) % newFigFile: name of new .fig file (with extension) % targetPlatform: platform of target.one of {'pc' 'mac' 'unix'} % % This file exists to enable cross-platform use of a GUIDE-generated .fig % wi...
6f3964a4d91870483c7ae60fccdb747a784cb81855f0430a099102cc047c7fa9
MATLAB
3,338
100
function h=subaxis(varargin) %SUBAXIS Create axes in tiled positions. (just like subplot) % Usage: % h=subaxis(rows,cols,cellno[,settings]) % h=subaxis(rows,cols,cellx,celly[,settings]) % h=subaxis(rows,cols,cellx,celly,spanx,spany[,settings]) % % SETTINGS: Spacing,SpacingHoriz,SpacingVert % ...
2b91b2caf8b5fc50f9f1b4d2e178eea13c4551fd1be32a960492e99e584d353c
MATLAB
3,339
107
% HIFDE_SPDIAG Extract diagonal using hierarchical interpolative factorization % for differential equations via sparse apply/solves. % % This algorithm computes each diagonal entry by multiplying from the left % and right by unit coordinate vectors, taking advantage of the sparsity of % each suc...
7c03a1673856ea5e1ee1df36ee717048133db1b2a1db820fde3f81117dc93d4d
MATLAB
3,339
124
% Written specifically to work w/ the Object classes % Makes the 'SAT.predict.plotter' redundant function plotErrorStruct(errorStruct, vars) arguments errorStruct vars.fill = 0; vars.alpha = 0.05; vars.nShuffles = 1000; % vars.saveDirectory = []; vars.saveFig = 0; vars.saveFormat {...
a65f43a447424ecea118bb335c1351fae8fa229d5fbc23f9ed2056069db4a7bc
MATLAB
3,339
122
function [cdist, dcdistdom, dcdistdT, r, drdom, drdT] = TestFunction(X,om,T,k); [m,n] = size(X); [Y,dYdom,dYdT] = rigid_motion(X,om,T); inv_Z = 1./Y(3,:); x = (Y(1:2,:) .* (ones(2,1) * inv_Z)) ; bb = (-x(1,:) .* inv_Z)'*ones(1,3); cc = (-x(2,:) .* inv_Z)'*ones(1,3); dxdom = zeros(2*n,3); dxdom(1:2:end,:) = ((i...
14abf63589695599e252651cf7f58fee147bda152d6cb5ffd950ac6d26d6c0a3
MATLAB
3,341
93
function [comod] = bz_ModIndex(lfp,phaserange,amprange,flagPlot) % [comod] = bz_ModIndex(lfp,phaserange,amprange,flagPlot) %This function calculates the modulation index of phase-amplitude between %phaserange (lower frequencies) to amplitude range (higher frequencies). %It can really take a long time if you do very sma...
1533d859fa6831acc5c6c540c0622a05b98fa883f09226cf92cdf72dcb7a1dad
MATLAB
3,341
32
subjs={ '/m/cs/scratch/networks-pm/pm_denoise/sub-01/sub-01_task-movie_SGdetrend_24HMP-8Phys-Spike_HPF_smooth-6mm.nii' '/m/cs/scratch/networks-pm/pm_denoise/sub-02/sub-02_task-movie_SGdetrend_24HMP-8Phys-Spike_HPF_smooth-6mm.nii' '/m/cs/scratch/networks-pm/pm_denoise/sub-03/sub-03_task-movie_SGdetrend_24HMP-8Phys-Spike...
afaca0bea67a2ff7986da0d2e0b69b6902e12e846d7ade92b1bde4db8589aaa9
MATLAB
3,341
79
classdef CorePrevAxesTargetSpec % Value class holding just the parts of PrevAxesTargetSpec that are persisted: % iMov, frm, iTgt, gtmode, dxlim, and dylim. % % Every CorePrevAxesTargetSpec in existence is fully valid: the constructor % takes a PrevAxesTargetSpec, a single struct, or name-value pairs, and % ...
c1efe73e65f9c325984a41e5f928716378f221d6cb09f536707a26067b4d9d6f
MATLAB
3,342
94
function plot_kappVsNoise(vcf, summaryInfoTable_raw, devMeasure_all, kecn, kselPercNtr, kselPerc, singleEcnCol, varargin) %% handle optional inputs (varargin): nOpVar=0; % counter for optional variable nOpVar=nOpVar+1; opVars.sortFlag = []; defaultValues{nOpVar} = 0; nOpVar=nOpVar+1; opVars.limNoisePlotFlag = []; defa...
8c41b808b9643c754d7390e549da560ece05e90d0777fc07e79a477db9fc691b
MATLAB
3,343
94
function CBIG_Plot17NetworksCorrMat(fig_num, corr_mat, xhemi, yhemi, clow, chigh, color_map) % CBIG_Plot17NetworksCorrMat(fig_num, corr_mat, xhemi, yhemi, clow, chigh, color_map) % % This function is used to visualize 17 network correlation map. Values % less than or equal to clow map to the first color in the color_...
8051c5ba367fd46e71eb7b847f0c65b98833f581a6c1ae5248a1dbc6407438b0
MATLAB
3,346
67
function OutputImage=CoordinateImageAdjustments(InputImage,TranslationParams,RotationAngle) % InputImage=TestImage; % TranslationParams=[Grouped_Data(RecordingNum).Verified_Quantifications.STORM_AZ_Struct_AZ_Domain_AlignmentParams(Pair).ChannelData(Rotate_Centering_Channel(ClassIndex)).Offset(1),... % ...
493f659a4c443f3bcf1e32d1787dda045db951b556b17229da1ff73a7b0f71ec
MATLAB
3,347
78
function [lpffdCensoredVolumes] = lpfFDcensoredVolumes(MPs,TR,LPF_FD_Threshold) % This function returns a logical vector denoting which volumes are % targeted for removal using GEV-DV based on input time series, a gray % matter mask in the same space as the input time series, the TR (for % low-pass filtering)...
99770bcca7bc9021ab6b77a6096f862e275c9b32d80b14b46da4ad8a6b978053
MATLAB
3,349
102
function pairsOut=View_Clear_Brain_ROI_Corr(Anat,IM,M,Pnn,Proi,C,Pmax,params,g) % % This function draws ROIs on the brain and connecting rods colored by sign % of correlation values in C. This can be the fc correlation itself if that % is passed, or it can be the correlation of brain fc with behavior if that % matrix...
f6d0944109543ad73540ba374ca0ce80fd48e8b898f8271d7519b85178e9d735
MATLAB
3,349
108
%% PLCA/svm analysis [first2PCs,analysisInfo] = PCA_DN_analysis(300,true); %% PCA/svm stability analysis % eq. weight thresholds thresh2Cons = [0,50,100:100:1700]; % initialize vectors nThresh2Cons = length(thresh2Cons); PCexplained = zeros(nThresh2Cons,3); CVLoss_type = zeros(nThresh2Cons,1); CVLoss_LR = zeros(nThres...
27de01bc8c44cf666a71962e92e047b68c8aa2309a90f47e3d792cacc26de5e6
MATLAB
3,350
64
function selected_color = color_picker_4(object_type, data_dir) % COLOR_PICKER_4 assigns all colors to be plotted in a synthetic image. % Each object should have a representative color, a distribution, or % alternative data to support color selection. % In this version, color are randomly selected from Excel spreadshe...
7a6b8da01d2eadc7bf8e07aefa46628d463ca2745cdb513ae39e877967cd6bdb
MATLAB
3,350
134
%% PCA test set reconstruction error vs likelihood as K increases % Show that reconstruction error on test set gets lower % as K increases for PCA, but likelihood for PPCA has U shaped curve %PMTKslow %% % This file is from pmtk3.googlecode.com setSeed(0); if 0 loadData('olivettiFaces'); % 0 to 255, from http...
c4ada90d553938d16bada280351fe8656439b117392d3239667d16d27145396c
MATLAB
3,350
100
function [UnitIDs,UnitLabels] = FindInterestingUnitsAction(TaskLabel,varargin) %ISINTERESTINGUNIT Returns list of "interesting" units. [varargin,PThresh]=Utilities.ProcVarargin(varargin,'PThresh',.001); datafile = fullfile(env.get('results'),'FaceScratch','SUAnal',[TaskLabel '-Go'],'PopData','p1-AllDays.mat'); ...
bab78e709727f29b4392f6e11bd2d99670288074096d5de80a3da30d8bad17b5
MATLAB
3,351
92
function statsfun = statsfunhelper(inp1, inp2) % Helper tool to create a statsfun for the options structure of solvers. % % function statsfun = statsfunhelper(name, fun) % function statsfun = statsfunhelper(S) % % Usage with (name, fun): % % Input 1: name is a string which is a valid field name (no spaces, star...
49d43564f5b4eb77c6bd844d112baebd60fd3efee5b4968c719fea01148f2751
MATLAB
3,353
120
function [imp_i RT] = BA2json(cfg) % <*LAN)<] % v.0.1 % % BA2jsonwrite to _chanels.tsv % _electrodes.tsv files % [imp] aditional imput for impedance to bluid _electrode.tsv (see BVpoint2txt) % BA2json(cfg) % cfg. % filename = 'sujeto.eeg' % elec_name = {'Cz', ...
bb51386e2f02a33b33e0b3ab7999c7e01e660ef78b21e4c4db268cdbcc07797d
MATLAB
3,353
102
function [ppt_marker_summary, cluster] = getMarkerSummary(paths) config = load_config(paths, paths.name); config = config.config; step = 'fcp1'; % check for matched MRI and MEG data subj_match = ds_pid_match(paths,step); ssSubjPath = @(x) paths.(subj_match.pid{x}); % initialize output files getMark...
558f2f5e0bec42fb9f3afe592262414253322b1e3dc9a8b518c4e3f0d2ae0226
MATLAB
3,354
134
% This function runs the regression, filtering and rectification steps to % the functional data series % Author: Milena Capiglioni, University of Bern % Contact: milena.capiglioni@extern.insel.ch % Last update: Nov.2023 % Feel free to use the software and report any bugs! % If you use/modify this code for your future...
8f17d773c437a204a7eee856860c013ef518bd50877f8917a9f507443b41a89c
MATLAB
3,354
87
function [eid,emsg,varargout]=statgetargs(pnames,dflts,varargin) % % needed to copy this function because it was in the private folder of % the stats toolbox % %STATGETARGS Process parameter name/value pairs for statistics functions % [EID,EMSG,A,B,...]=STATGETARGS(PNAMES,DFLTS,'NAME1',VAL1,'NAME2',VAL2,...) % acc...
940f2a5104708f4aa79071da407d2eed64e0306363c80c7dc7066a5509aabf26
MATLAB
3,354
129
%% Plot the full L1 regularization path for the prostate data set %PMTKauthor Mark Schmidt, Kevin Murphy % This file is from pmtk3.googlecode.com clear all load prostateStnd [N,D] = size(X); %#ok wOLS = X\y; tmax = norm(wOLS, 1); %% First use LARS wLars = lars(X, y, 'lasso'); %lambdas = recoverLambdaFromLarsWeight...
036709293331d45ec0f9d904d946fa19f1343f458d7a46b27f7e9c5647e91d95
MATLAB
3,355
69
function mat=firstlevel_4d(data, out_path, TR, model_deweight_path) %%model specification matlabbatch=[]; matlabbatch{1}.spm.stats.fmri_spec.dir = {out_path}; matlabbatch{1}.spm.stats.fmri_spec.timing.units = 'secs'; matlabbatch{1}.spm.stats.fmri_spec.timing.RT = TR; matlabbatch{1}.spm.stats.fmri_spec.timing.fmri_t = ...
3418c30d0586da1cd2ed4cde5d7774e86fa5b529e3728e26b6122810711727b1
MATLAB
3,355
134
function model = parcs(x,M) % PARCS: Paired Adaptive Regressors for Cumulative Sum, Algorithm 1, as % described in Toutounji and Durstewitz (2018) Front Neuroinform. % Please refer to 10.3389/fninf.2018.00067 for details % INPUT: % x: time series matrix of size TxN % M: number of change points % OUTPUT: % model: PAR...
779307fc720332f594f8e6e2dd61267186752876ba93e5614569feb4866daa0b
MATLAB
3,355
121
function varOptBarber() % Variational Optimisation % https://davidbarber.github.io/blog/2017/04/03/variational-optimisation/ % f(x) is a simple quadratic objective function (linear regression sq loss) % p(x|theta) is a Gaussian function out=E(W,x,y) out=mean(0.5*(W*x-y).^2); end function [g,G]=gradE(W,x,y) G=repma...
e2fc5e73fe3fd2e91b9de2832cccf1e213948330931607911cb2b8b713bfff71
MATLAB
3,355
109
function [e p st] = improve_mesh_use_stellar(e, p, opt_params) % Use Stellar to improve mesh quality. Note that this routine will add more % nodes/elements to mesh and hence alter it. % Therefor no material/region property can be used after this routine is % done. if size(e,2) < 4, error(' Can only handle tetrahedral ...
3c0f04616c9ac5f4be14db2cbcd2f4c5bca07b2684344e50419196dce3418bee
MATLAB
3,356
121
function [leg0,gradleg]=legs_n0(x,dir,n,type) % usage: [basis,gradbasis]=legs(x,dir,n,scale) % % returns the values and directional derivatives of (n+1)^2-1 basis functions % constructed from spherical harmonics at locations given in x and, for the % gradients, for (in general non-normalized) directions given in dir...
48cc31197552451da6ad4953081148715e2d23c3b84c22040da5c0e591853ece
MATLAB
3,356
142
function [out, varargout] = vocoder(in, fmin, nbch, erbscale, Fs) % out = vocoder(in, fmin, nbch, erbscale, Fs) % out is tone vocoded using a gammatone filterbank % envelope filter cutoff @ 64Hz % in: In signal % fmin: Minimum frequency of the filterbank, 1st center frequency % nbch: Number of channels % erbscale: Filt...
750151c0977be192255ee2607253fe07b7086fe4cd2f96d56135988c028e8565
MATLAB
3,357
68
function lan_fill_gui(LAN) % LAN.nbchan = size(LAN.data{1}, 1); % static % LAN.pnts = size(LAN.data{1}, 2); % static % LAN.trials = 1; % static % LAN.name = ''; % LAN.cond = ''; % LAN.group = 'iEEG'; % LAN.srate = 512; % LAN.unit = 'uV'; figure('name', 'Fill specifications', 'position', [450 400 300 450]); str = mat2s...
82f869441d42695ca07f59f0f5e5c662e80840919d10528373d04b3d9adcd614
MATLAB
3,357
89
function [W,output] = boundOptL1overrelaxed(X, Y, lambda) % Fit the weights for L1 penalized multinomial logistic regression via % overrelaxed bound optimization in O((cd)^3)) where c is the number of % classes and d is the number of dimensions. % % Inputs: % % X nexamples-by-ndimensions % Y ne...
b963505d571a9655e3eeaeb9dd0d64790d4988c3ff995f071bfa1b07e1667309
MATLAB
3,358
86
function CBIG_AuthorTopic_ConvertBrainImagesToCVBData(dataDir, cvbDataFile) % CBIG_AuthorTopic_ConvertBrainImagesToCVBData(dataDir, cvbDataFile) % % Convert binary-smoothed brain images of activation foci to data input % for the Collapsed Variational Bayes (CVB) algorithm. % The binary-smoothed brain images are produce...
e27bdaa664ad575d366c1a259b2a7b9e649d80e7e76aae39ae176bd9f5a9caa8
MATLAB
3,361
146
function [options] = prepare_fullDCM(A,B,C,D,TR,microDT,homogeneous,hA,hB,hC,hD,sources) % precalculates intermediary variables for the VB inversion of DCM for fMRI % function [options] = prepare_fullDCM(A,B,C,D,TR,microDT,homogeneous) % IN: % - A: binary matrix indicating where the connections are % - B: cell-arra...
8549c37599f5cc60117c1b18dede02ec1e635d336935da03c775b4f6d1c475fa
MATLAB
3,362
95
function [stepsize, newx, newkey, ssstats] = ... stepsize_sg(problem, x, d, iter, options, storedb, key) %#ok<INUSD> % Standard step size selection algorithm for the stochastic gradient method % % Given a problem structure, a point x on the manifold problem.d and a % tangent vector d at x, prod...
4b451563ca12b79ff5630f997edcafd36005606b620ef08727be9284c73123c5
MATLAB
3,363
87
function ft_postamble(cmd, varargin) % FT_POSTAMBLE is a helper function that is included in many of the FieldTrip % functions and which takes care of some general settings and operations at the end % of the function. % % This ft_postamble m-file is a function, but internally it executes a number of % private scripts ...
70afac3efb9c9d93a6cad5acb958ccb60d1d0e252885028413fa0c2505aa2cca
MATLAB
3,363
123
function [Iphi,SigmaPhi,deltaMuPhi,suffStat] = VBA_Iphi_UNL(phi,y,posterior,suffStat,dim,u,options) % Gauss-Newton update of the obs. parameters, for un-normalized likelihoods if options.DisplayWin % Display progress try STR = 'VB Gauss-Newton on observation parameters... '; set(options.display.hm...
97f32d7d536e8922d878e3d5d83f965ec543e4be9e11b3a749efd341701532db
MATLAB
3,363
110
clc, clear, close all workDir = getenv('bodyDir'); cd(workDir) % Folder with the raw mkv files from the Azure Kinect Camera dataDir = 'Raw\'; % Subject or participant or test folder. testDir = 'test'; % targetVideo = 'FULL PATH TO TARGET MKV'; targetData = 'FULL PATH TO OPENPOSE MAT'; vide...
a0db99ccbca9bab8f975d65ff3a81d67d69ef3c8198d3e70c68bb7d2c16858ea
MATLAB
3,363
98
classdef SceneReader < matlab.mixin.SetGet & dynamicprops % DatasetReader Read Imaris ims file Surpass Scene information % % © 2015–2016, Peter Beemiller (pbeemiller@gmail.com) % % See also ImarisReader properties (SetAccess = 'immutable', GetAccess = 'public', Transient = true) ...
ee2a60feaa854ef76368849369751d65d3bad0b091a19519512bac72d209651a
MATLAB
3,363
107
clear close all clc %% Select measurement rate (MR): 0.25, 0.10, 0.04 or 0.01 mr = '0.25'; mr_str = mr(3:end); fprintf('Measurement Rate = %s \n', mr) %% Initializations % Dataset for testing test_images_dir = './test_images'; test_images = dir(test_images_dir); test_images = test_images(3:end); o...
0789703dcdee8f1ad785bada44d7971464825af482f4e1255fc8e6fa0b6dadf9
MATLAB
3,364
119
%% Get Prediction Matrices % Segregated function for calling and evaluating the different predictions; % % Used as a single common method to call and create these elements; % function H_Struct = getPredictionMatrices(sdo, xtdc, ppdc, XT_CH_NO, PP_CH_NO, vars) arguments sdo % either sdoStruct, sdoMat, sdoMultiMa...
09016a7cb5b4aed53107cc76f3165cd9c92aaa2d2521ca3153d03dd2b6413249
MATLAB
3,364
127
addpath('../generic/'); addpath('../analysis_reclassif/'); %% [t, TIN, TOUT, EC, EI, CHOICE, RT, COH, SESSION] = get_and_prep_data(); %% X = {EC-EI}; Y = {TIN}; XLABEL = {'Time, M_{in}^{contra}-M_{in}^{ipsi} [s]'}; YLABEL = {'Time, T_{in} [s]'}; for k = 1:length(X) p = publish_plot(1,1); set(gcf,'Position...
91b04cd22f854a7f4e7f8e0c4c393892aae537031d14bca97b3c2dcc1e79520b
MATLAB
3,364
101
function [Matrix_Coeff,Reconstruction,Residual,Error,dError,Max_Coeff] = Snake_kSVD_reconst(Data,Dictionary,NoAtoms,Overlap,sdRemoved,draw) if nargin==5 draw = 0; elseif nargin==4 draw = 0; sdRemoved = 4; end % Initialize Parameters counter = 0; counter...
84919d05a7889eebfd9e25b9fe4cd24c482c6568a43f6ee9b15a02f653f1c4b6
MATLAB
3,366
129
%% Sparse linear regression with EM on biscuits data % PMTKreallySlow %% % This file is from pmtk3.googlecode.com loadData('biscuits'); ings = [1:4]; % fat, sucrose, flour, water for dim=1:length(ings) ing = ings(dim); Xtrain = A_train; Xtest = A_test; ytrain = y_train(:, ing); ytest = y_test(:, ing); [N,D] = s...
1758661c74e683ce3b6e89a5a7498b756e2b372311842b2910a4b58335dd0d82
MATLAB
3,367
92
%% %This code is to clean the bad functional data after you know your final dataset %This assumes you have already run main_just_for_movment.m and count_repairee_acc_update.m. filenm='final_sample.xlsx'; %This is your data_to_keep excel after you screen the repeated runs (based on your criteria, say mv, acc, or bo...
07f5c7aea91e4f2ec4ee69675e37b077f43c3519f53f18f5992d0a578200e163
MATLAB
3,368
78
function params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params) % params = CBIG_AuthorTopic_EM_InitParams(exp_acts, paradigm_by_exp, params) % % Initialize parameters of the author-topic model % % Input: % - exp_acts = D x 1 cell where D is the number of experiments % ...
3e4e19a7f1b53a0e84ef9811c7572523b7ff58749811fa51a5b6634ee1c2bde0
MATLAB
3,370
94
%% Plot figure 7 function figureOut = PlotFigure7( OA_xhat, control_xhat, OA_x, ... control_x, ivls, figNr) % 1. Compute median, upper and lower quartile across simulations % 2. a) Compute median of median within each specified interval % 2. b) Compute error bars as median of median p...
ea5ac2205367010c64bf20b106aa7d4cda31fba6d1411db7ddb099009b7c2322
MATLAB
3,370
73
function [ titleStr, settings, results ] = dspace_moduleFcn_template( dataview, settings ) % Use this as a starting point for new module functions. % % Dataspace-Module functions are Matlan functions that can be called with 0, 1, or 2 arguments. % Depending on the number of input arguments the behav...
f17f810893cdd351b13c4c1a9ad53b754e16809ad0cef55bd54fa489ecef340e
MATLAB
3,371
111
function events = wlProc_getEvSegmentsByComparing( ... databigger, datasmaller, samprate, threshfactor, maxglitch, maxdrop); % function events = wlProc_getEvSegmentsByComparing( ... % databigger, datasmaller, samprate, threshfactor, maxglitch, maxdrop); % % This function identifies the location of events in a data...
31a3dc066cb792a38aef3fc57c63994acfd3dd1d2efd7d303fa3830b6c59a458
MATLAB
3,372
113
%ISOLATE_AXES Isolate the specified axes in a figure on their own % % Examples: % fh = isolate_axes(ah) % fh = isolate_axes(ah, vis) % % This function will create a new figure containing the axes/uipanels % specified, and also their associated legends and colorbars. The objects % specified must all be in the same f...
9debadf3a41f66d190a6012c1498160034ffb2a2381622807f6c5104d096e417
MATLAB
3,373
83
%% SAT - app_input :: %% determinePpFileType % Name: Phone Kyaw % Date: 09/19/2024 % Description: Return a pp_cell when a user inputs PP files % Parameter: None % Return Value: pp_cell - Nx1 cell array where each row contains Mx2 cell for % each trial (N = Trials, M = No. o...
061c85a9fd1b1e20e79ee0e559ce6e7b3a20f68eb1ce7fd37ba52ac852616302
MATLAB
3,374
54
classdef CBIG_MMLDA_unit_test < matlab.unittest.TestCase % Written by Nanbo Sun 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'); ...
42399116b899b7c86d75fe9cf3377b030f698f3db32a28893fb924ff75e9bbbc
MATLAB
3,375
182
%%% ERROR_ANALYSIS %%% This simulation helps coputing the acturacies of calibration %%% Run it after the main calibration N_runs = 200; %N_ima_active = 4; saving = 1; if 1, %~exist('fc_list'), % initialization % Initialization: load Calib_Results; check_active_images; fc_list = []; cc_list ...
1c12fc5a0ce33347cca3d878bcb83ee7c08345fcad694b7ed254f3a5bb26a7da
MATLAB
3,376
130
function out = CP_Run(S,vid) %% Unload variables [ t,t_lim,f,div,uprd,uprt,s, ... NEUR,N2M,K,PART,ALPHA,updm,RES,MOV ] = structvar(S); [X,Y] = meshgrid(1:div); N_neur = size(NEUR,1); % UPR tracking UPR = zeros(1,1+N_neur); WB = waitbar(0); clear S; %% Body while t<t_lim && sum(PART,'all') for n=...
d5cb50e46829f7627c6cfb3fea7f97422ce67a76222fea027a6568559fd1da07
MATLAB
3,376
82
function Cfg = y_GenerateQCHTML(Cfg) % function Cfg = y_GenerateQCHTML(Cfg) % Generate QC HTML file based on results by fmriprep. % Input: % Cfg - DPARSFA Cfg structure % Output: % see /QC. %___________________________________________________________________________ % Written by YAN Chao-Gan 190915....
d8ace9f09a56e0ec25a909e712ed14a0eaf2623472fc610febd49e212ca832c6
MATLAB
3,376
85
%----------------------------------------------------------------------------------------- % Decoding performance as a function of the neuron count included in the % analysis % % Kehl et al. 2024 (DOI:XX) % Single-Neuron Representations of Odors in the Human Brain % Figure 2c % Author: Marcel Kehl % License: MIT Lic...
dc9275ac6b75c61e97c970997e218f9ef07b18816069905b1660fe6e23ff9a9c
MATLAB
3,377
99
function h=holder(tfr,f,n1,n2,t,pl) %HOLDER Estimate the Holder exponent through an affine TFR. % H=HOLDER(TFR,F,N1,N2,T) estimates the Holder exponent of a % function through an affine time-frequency representation of it, % and plots the frequency marginal and the regression line. % % TFR : affine time-frequency r...
ede0db29d0364ea98c02d1797ce0fc3578c18a407282c2d8e9af12a08dfb8051
MATLAB
3,377
73
%% %NOTE - x axis in Figure 8c of the manuscript should be labelled radius, not diameter - this has been updated in this script %% clear all %% %Define Parameters [opt] = ParameterOptions(); %% %Modify default parameter options opt.Precision=10^-10; % Cut off for pathway amplitudes opt.nPeriods=2; % Ma...
ea37255407cf1af1f570749938b7c535d484adf07f6070982711f8cc8d3433ce
MATLAB
3,378
119
function [D0,phisq0,st] = lme_fit_FSinit(X,Zcols,y,ni,e) % [phisq0,D0,st] = lme_fit_FSinit(X,Zcols,y,ni,e) % % Starting values for linear mixed-effects estimation.This function is % intended to be used to provide starting values for the lme_fit_NR % function by mean of some initial iterations of the Fisher scoring a...
455b3f0e5bfc82089e993a0cd8e6d469e19dfbcb462e9aa6e4e85b999a407300
MATLAB
3,379
95
% FADE-SAME: Figure 5 % clear % close all %%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set results files FADE_files = {'../FADE_scores/FADE_SAME_scores_2021_01_11_ref_FADE.xls'; '../FADE_scores/FADE_SAME_scores_2021_01_11_ref_yFADE.xls'}; % load results files num_files...
8e6637903ccc702f9b104d3202b499723fd6a86f7524a93481372128c95ddc05
MATLAB
3,379
109
function folds = cvfolds_FK(Y,family,CVscheme,allcs) % allcs can be a N x 1 vector with family memberships; an (N x N) matrix % with family relationships; or empty. % If family is 'multinomial', it will stratify the estimation % Diego Vidaurre % % adapted to randomise folds taking family structure into account % NOTE: ...
d62547c827b4e7146c5b48bf00e5b0742732cde3c3280af8558bd0d1e735d820
MATLAB
3,379
140
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
997d7704296e3e36aa36539e416881b75c2da6a11070b7c77b5aee7be26fc2c8
MATLAB
3,380
105
%% lasso on polynomial regression % % This file is from pmtk3.googlecode.com ns = [21]; for n=ns(:)' setSeed(0); [xtrain, ytrain, xtest, ytestNoisefree, ytest, sigma2] =... polyDataMake('sampling','thibaux','n',n); deg = 14; addOnes = false; if ~addOnes % To avoid the need to add 1s to X, let us center the resp...
947c7751365d843fc00f3b51930d40e045bc29d9c4f6d74b3f7d524996cc7067
MATLAB
3,382
104
function [mappedX, mapping] = lltsa(X, no_dims, k, eig_impl) %LLTSA Runs the linear local tangent space alignment algorithm % % [mappedX, mapping] = lltsa(X, no_dims, k, eig_impl) % % The function runs the linear local tangent space alignment algorithm on % dataset% X, reducing the data to dimensionality d. Th...
b91e098cc5f778166a14afd60a8926137446a7c0f0e968a68740c8813c5a18cb
MATLAB
3,382
130
function [p,out] = corr_with_RT_choice(choice, RT, coh, times, dv, dv_mediator, minRT,maxRT, start_t, end_t,do_plot,flags) if do_plot ==0 p = []; end % norm_to_se_flag = flags.norm_to_se; % testing % filt = RT>minRT & RT<maxRT; ucoh = nanunique(coh); % residuals dv_res = nan(size(dv)); dv_res_choice = nan(siz...
f81fa964cc88da4fa53b93bd6cc6f36726d1c7c6a01916abc089a3f02943a079
MATLAB
3,383
103
%% Main function to generate tests % % These tests can be run from the command window with "runtests myTests" % while in the test folder, or with "runtests("test/myTests.m")" from the % project folder % % Capture the results by saving the output: e.g. testResults = runtests("test/myTests.m") % % See different types of ...
02bb10d775b432c1dd94097c495e67708c37638cb2e19ea2b4a75238045287e1
MATLAB
3,384
107
clear all; path0=pwd; path2=[ '../../Nonequilibrium']; addpath(path2); for FLAG=1:4 FLAG indexN=[1:31 50:80]; N=62; Tau=2; NSUB=176; % Parameters of the data TR=1; % Repetition Time (seconds) % Bandpass filter settings fnq=1/(2*TR); % Nyquist frequency ...
f6684dc1040d87120f7edc680f4051d6988231c00e115eb79d07e329937ca411
MATLAB
3,385
85
%% computeSDO_xtDataCell_new() % Generates a data structure for time series data ('xtDataCell'), % pre-populated with fields used in the SDO Analysis toolkit. % % PREREQUSITE: None % % INPUT PARAMETERS: % N_TRIALS : A postive integer, corresponding to the number of % independent recording trials/sessions used...
8cca69116d6ad76378e2afce7d1fcc107be8d33741b0c844dc3800e1088076fd
MATLAB
3,386
117
function saveAsJSON(data, jsonFileName) % saves the values in the structure 'data' to a file in JSON format. % Based on the work of Lior Kirsch at: https://uk.mathworks.com/matlabcentr % al/fileexchange/50965-structure-to-json % % Modification by Arthur Y.C. Liu 24/06/2020 % % Example: % data.name = 'chair'; % ...
289eb60bd5277857d66db42156bea3be91b0a7b844eec097d667699ec2daea5e
MATLAB
3,388
141
% _ _ % ___ _ __ __ _| |__ ___ ___ _ __| |_ % / __| '__/ _` | '_ \/ __|/ _ \| '__| __| % | (__| | | (_| | |_) \__ \ (_) | | | |_ % \___|_| \__,_|_.__/|___/\___/|_| \__| % % checks all ABF files to make sure they % have the same number of channels, and % that all chan...
cf744a5bd94dbcfc7f555a25f6209d190d60e09acef6a79418682c7b879e4f4c
MATLAB
3,388
111
function detectors2vtk(mesh,output_fn,varargin) % DETECTORS2VTK Saves detectors of a FEM mesh in NIRFAST format into a *.vtk file. % % DETECTORS2VTK(MESH,OUTPUT_FN) Saves detectors (MESH.meas.coord) of a FEM % MESH in NIRFAST format into a *.vtk file. Usefull for visualization % with e.g. ParaView. % MESH - mes...
be47e893ec76bb26aead743356ad8c7b5364ac002fb3689efa3130bf1ffd540f
MATLAB
3,391
92
function ort = match_seg(pl,al,bwd) % match segmentation labels from a hemisphere to canonical layers % obtained from the symmetrical D99 atlas. % % Alexandru V. Avram, Ph.D. % NIH 2022 % % inputs % pl - map segmentation (left/right hemi) % al - symmetric d99_layers segmentation (left/right hemi) % bwd -...
18f28e463655f33af3e49bed29001dd2ed7ef4c61f19ddc14e7010e30c997f83
MATLAB
3,393
86
function addPaths(root) % % % %<PRE> % This file is part of dspace-core. % % Copyright (C) 2020 University Zurich, Sepp Kollmorgen % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU Affero General Public License as publish...
43b7bf0343f56eea946252f49493baddac22cd68d1ee9278b89bcbcfabf16977
MATLAB
3,393
141
clear; clc; close all; %% warning('off'); load example_non_sinusoidal_data_v1.mat srate = 400; timex = linspace(-1500,0,srate*1.5); param.plot = 1; param.minimum_cycles = 2; param.ovlp_threshold = 0.50; param.frequency_axis = 1:40; [cho_outputs] = CHO_v22(raw_data, srate, param); %%...
0eb0c688af5f37daabe00b4cc86fe1654e00c3bab25e92a4687d1b0d5a7cf763
MATLAB
3,395
110
function clf = clfLdaTrain( clf, X, Y ) % Train a Linear Discriminant Analysis (LDA) classifier. % % USAGE % clf = clfLdaTrain( clf, X, Y ) % % INPUTS % clf - model to be trained % X - nxp data array % Y - nx1 array of labels (or cell array, see classify.m) % % OUTPUTS % clf - a trained LDA mo...
94cda9690053ca58d2898f5fce78743a04b467e2e0d462526f5642dbe6579e4b
MATLAB
3,396
109
function h = viewClassTree(varargin) % View a class inheritence hierarchy. % Same args as getClasses % Needs graphViz4Matlab % Classes must use classdef syntax not old style % PMTKneedsMatlab 2008 % This file is from pmtk3.googlecode.com args = process_options(varargin,'source',pwd(),'ignoreDirs',{'unitTests',ful...
d13e11ad183b6514725d0f2e5aaad30435035adba7d471bcf110007fa6dd4e1e
MATLAB
3,397
94
loadParameters; if ~params.DO_DOWNSAMPLE fprintf('Skipping downsample because the parameter file says not necessary\n'); fprintf('[DONE]\n'); return; end for rnd_indx = 1:params.NUM_ROUNDS precheck = true; for c = 1:params.NUM_CHANNELS filename_full = fullfile(params.deconvolutionImagesDi...
5d9af3b615b2e53db8c3d8602929df75dfd3fdcad882a02d795adaa35cb20906
MATLAB
3,399
130
function [B,MSEs]=jisotonic(A,direction,weights) % jisotonic - isotonic regression (jfm, may 2105) % % [B,MSEs] = jisotonic(A,direction,weights) % A is the input a vector % direction = 'increading', 'decreasing', 'updown', or 'downup' % weights is the optional input weight vector (same size as A) % B is the out...
79859d8270b625d32d03862421197bda02fa065be7b3984e1dfe73392cae998c
MATLAB
3,399
139
function LAN = fftamp_thr_lan(LAN,cfg) % <*LAN)< % v.0.1 % % Detec amplitud variation en fourier space % cfg.thr = [1 0.1] (sd %spectro) % .tagname= 'bad:A' % .frange= [1 60] % .cat = % .method = 'f' or 'mt' % ...
d56ae59202074472ceb76eb4e6998d4840c361ce897fa917c8408109e651e4c3
MATLAB
3,399
116
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % function [jd,...
09415d3a55519f151b9eddfa65b33fc249c68f8cb2e3aeef2715ac7e1a11af9d
MATLAB
3,400
108
function [] = randnetPlaceFieldsManuscript(modelParam, network, opS_PF, opV_PF, opGin_PF, linfields, varargin) % plots.randnetPlaceFields(modelParam, network, opS_PF, opV_PF, opGin_PF, linfields, ithEnv=1, ithTrial=1) % % Plot results from place field simulations of randnet for manuscript % % Inputs: % - modelParam: ...
73170ae090cac0af255fdeebbf6030dbc5a037bf2880f03271f588694d21894f
MATLAB
3,400
97
function mix = gmminit(mix, x, options) %GMMINIT Initialises Gaussian mixture model from data % % Description % MIX = GMMINIT(MIX, X, OPTIONS) uses a dataset X to initialise the % parameters of a Gaussian mixture model defined by the data structure % MIX. The k-means algorithm is used to determine the centres. The % p...
7dadbd57b51a74dbd6740a2f3f3dbd3825f0f731de0f8cdb5e60bd16c6f0bc1b
MATLAB
3,400
76
load('Y:\Sarah\Analysis\Experiments\Random Motorized Treadmill\behavior\gait analysis\stride segmentations\concatenated periods\FL\1087\stride_segmentations.mat') b = vertcat(stride_segmentations{192,1}{:}); figure; hold on; for i = 1:2984; plot(b{i}); end title('startwalk FL velocity strides'); savefig('Y:\Sarah\Anal...
896d76d1f202d52158c74250b5048039c525ec6096bbd6daa3d12d69a8d4d354
MATLAB
3,400
128
function [model, logev] = linregNetlabFit(X, y, alpha) % PMTK interface to netlab % X is n*d, y is d*1 % Do not add a column of 1s % alpha is fixed, beta is optimized % Computes log marginal likelihood with Gaussian prior % This file is from pmtk3.googlecode.com x = X; targets = y; % Compute posterior p(w|D,alpha) ...
04f38ee99c1f560bfef47ca2ebdf3ecc589f21a911f9efa4a5e53b92650691b7
MATLAB
3,401
108
function signal = openOTBplus(pathname, filename, ref_exist, nbelectrodes) %Reads files of type OTB+, extrapolating the information on the signal, %in turn uses the xml2struct function to read file.xml and allocate them in an easily readable Matlab structure. % Isn't possible to read OTB files because the internal s...
d3d9b9344bee304274ee65448cdae4fd4fc1865dbab5897d273a5ef938c0e515
MATLAB
3,401
104
% plot_singleTrials_highlights %% Plot settings %% Single trials Tin-c, PC1, Ramp sess = 1; % Example trials taken from session 1 set(gcf, 'renderer', 'Painters'); % for sig = 1 : length(pltSig) for d = 1 : length(plotSig) dim = plotSig{d}; clear sl assignSignal clear rl maxY = 0; m...
0ea6abf352987d427839660184a3c8da6bcc39311f0379f8533012682edce0b2
MATLAB
3,402
83
function markerParams=cookMarkerParams(markerParamsRaw) % Take an unprocessed markerParamsRaw structure, and 'cook' it to make sure % it conforms to the proper format. % Process nextra_markers field if isfield(markerParamsRaw,'nextra_markers') && ~isempty(markerParamsRaw.nextra_markers), nextra_markers=markerParamsR...
ff405c4cf648b98fcee76eba590c2dc7e05602dcfe756191e6be27acad3acd12
MATLAB
3,402
99
function Draw_ROIs_Through_Cortex(Anat,ROI,Conn,params) % % This function will draw ROI spheres on a model of the cortical surface. % The ROI spheres may be connected by tubes that are sized by correlation % strength and colored by sign. The cortical surface with have a % transparency. % Anat is a structure that descri...
ca0283ae539cbbf2e2d5516b1684fa026377248c2a5f091b62ece6709bb51a20
MATLAB
3,403
87
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef ViabilityImpedanceEvent < Tag & matlab.mixin.CustomDisplay %VIABILITYIMPEDANCEEVENT Tag for acquiring viability data properties(GetAccess = private, Constant = true) Curren...
fe88b3e32a8514f0e9954edc230c5f78669a62d91b1801f9cc41b14a9ff05de0
MATLAB
3,403
97
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef EntryRecord %ENTRYRECORD Structure representing an area of data in an Axis file % % Type: Type of data in the associated entry. See: EntryRecordID.m % % Length: Length...
8efdbd9f62a3f9c0aae0f571cecc1d0044346d178013600b6891b95f17489e49
MATLAB
3,404
110
function tpl = set(tpl,action,varargin) %TEMPLATE/SET Edit data stored in a Template object % TPL = SET(TPL,ACTION,VARARGIN) % ACTION 'root' % ACTION 'unknowns' % ACTION 'file' % ACTION 'block' % ACTION 'var' % Copyright (C) 2003 Guillaume Flandin <Guillaume@artefact.tk> % $Revision: 1.0 $Date: ...
1fe58a8f32782eacaf8f4763f14f8d49aae07bc8cd5a3b69c8b7f3e94034a0ca
MATLAB
3,406
101
function result = interpSurfBiLinear(inputGrids, stack, ssGrids, ss) % interpolate 2D data set over gridded 2D inputs % % interpSurfBiLinear(inputgrids, stack) % % inputGrids is cell array of 2D grids {X,Y} % stack is a 2D numeric array %-------------------------------------------------...
0bf6149e01628f643f8a3eab102490150e912641c8f145cbd500b5535599df21
MATLAB
3,408
115
function status = makessense(data, field) % MAKESSENSE determines whether a some specific fields in a FieldTrip data structure % make sense. % % Use as % status = makessense(data, field) % % See also GETDIMORD, GETDIMSIZ, GETDATFIELD % Copyright (C) 2018-2019, Robert Oostenveld % % This file is part of FieldTrip, s...
3fe78928e94638a2b338dfc57fc57906fcc1d79fdeaa374b15fb96343cac6c19
MATLAB
3,408
94
%----------------------------------------------------------------------------------------- % Plot piriform neuron responding to the image of garlic % % Kehl et al. 2024 (DOI:XX) % Single-Neuron Representations of Odors in the Human Brain % Figure 5b % Author: Marcel Kehl % License: MIT License %---------------------...
790d792736ded3e742810a07cf01fe6db98ca30c1ab9826c4a052786ea169ee0
MATLAB
3,409
106
function [A] = VBA_spm_matrix(P, order) % Return an affine transformation matrix % FORMAT [A] = spm_matrix(P [,order]) % P(1) - x translation % P(2) - y translation % P(3) - z translation % P(4) - x rotation about - {pitch} (radians) % P(5) - y rotation about - {roll} (radians) % P(6) - z rotation about - {yaw} ...
a48da7794e796812ce12859b5182b0566b7a2d81e6417c059db1dff5d7b47095
MATLAB
3,412
99
function newdata = wlProc_calcShortLowpass(olddata, fcorner, samprate, fact) % function newdata = wlProc_calcShortLowpass(olddata, fcorner, samprate, fact) % % This function implements low-pass filtering using raised cosine windows % as FIR filters. The farthest any disturbance can propagate is the width % of the wind...
dcdf185c6033b6f81679e58a667f8f3bf077468f9611e348ba201eae856f30d4
MATLAB
3,412
131
classdef ProgressMeter < handle % This is a model class for a waitbar. Designed to be used with a Labeler and % (optionaly) a LabelerController. properties labeler_ title_ = '' message_ = '' denominator_ = nan numerator_ = nan doShowFraction_ = true isActive_ = false % maps 1-to-1 t...
fe1856beea2d34e3e04c8a1df414cde6f74a047146605f981f0d215fa771b46b
MATLAB
3,412
93
clear;clc; %% data load fisheriris; X = -meas./max(meas)*0.005*9.8; y = species; [unique_labels, ~, label_indices] = unique(y); num_labels = numel(unique_labels); one_hot_labels = eye(num_labels); one_hot_labels = one_hot_labels(label_indices, :); split_ratio = 0.7; num_train_examples = round(size(X, 1) * split_ratio)...
b1029cd5cf3f385e59b6a0cd70632ff4ca5f0568d9354c167b98a8ab4f8cd84d
MATLAB
3,414
67
function [S,f,Serr]=mtspectrumc_lan(data,params) % Multi-taper spectrum - continuous process % % Usage: % % [S,f,Serr]=mtspectrumc(data,params) % Input: % Note units have to be consistent. See chronux.m for more information. % data (in form samples x channels/trials) -- required % params: structur...
dd8b3299b30f353b8549d95b19a33e496a8159c0439d105bbf24145d322685b3
MATLAB
3,414
88
% clear stitching_queue tform kk = 0; for ii = 1:size(read_file_name,1)-1 for jj = 1:size(read_file_name,2) kk = kk+1; stitching_queue(kk).tile_1 = [ii, jj]; stitching_queue(kk).tile_2 = [ii+1, jj]; stitching_queue(kk).res_i = tiling_info.y_pixel; stitching_que...