sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3a8e008431e9c70a89b54d94f2a465042906b26272ad5d8812c449fb6629cfc6
MATLAB
2,904
96
function handles = plotFilledArea(x, y, varargin) % PLOTFILLEDAREA Plot filled area under curve % % Syntax: % h = plotFilledArea(x, y) % h = plotFilledArea(x, y, 'Name', Value, ...) % % Description: % Creates a filled area plot from baseline to curve. % % Inputs: % x - X values (vector) % y - Y values (vector...
79a723d208520748372518ee51b3bfbdb402ab48ff1e8507aa215d48d0baaa7d
MATLAB
2,904
98
function FigureS9(datadir, codedir) %FigureS9 - Inferential model identifies mistaken inferences during mixed % blocks across rats % datadir = directory of dataset % codedir = director of code %% Set up paths s = pathsep; pathStr = [s, path, s]; onPath = contains(pathStr,... codedir, 'IgnoreCase', ispc); i...
71ee5629fcb6268187dede01bb09b6a3b20bd1219fe321cf650a1d9127357acd
MATLAB
2,905
55
% Session data handling functions for FMAToolbox. % % FMAToolbox provides a number of functions to handle data files stored % in the open and hardware-independent <a href="http://neuroscope.sourceforge.net/UserManual/data-files.html">formats</a> used by <a href="http://klusters.sourceforge.net">Klusters</a>, <a href="h...
8659e36a3992adfee5ed914c25734fc5bec93bafdbe5f1ae028dc150b36cb849
MATLAB
2,905
85
function [vertices,faces] = freesurfer_read_ascii(file) % freesurfer_read_ascii - Read FreeSurfer tesselation (.txt) % % [vertices,faces] = freesurfer_read_ascii(file) % % This function will load an ascii file that contains a one % line specification of the number of vertices and faces, % followed by rows of vertex poi...
557d2447e4be65640acde895067521e78047da1b1bef1a1167af5f4683649c20
MATLAB
2,908
79
% EEG_CACHE - Store data in cache with hashcode % % >> [cache data] = eeg_cache(cache, hashcode, data); % % Inputs: % cache - Cell array containing cached data % hashcode - MD5 hashcode % % Optional input: % data - This can be anything % % Outputs: % cache - Updated cache information % dat...
7ddd1b70ea77d9cfff7a052394364130971b521c43a73b25398ac66687880bd9
MATLAB
2,908
81
classdef nnloss < nntest properties (TestParameter) loss = {... 'classerror', 'log', 'softmaxlog', 'mhinge', 'mshinge', ... 'binaryerror', 'binarylog', 'logistic', 'hinge'} weighed = {false, true} end properties x end methods function [x,c,dzdy,instanceWeights] = getx(test,loss) ...
db78fe0d4a3e56fd0d9447f5c5118033fbc9c5479cd79fde49bdab0cd107474a
MATLAB
2,908
56
function [finalgradientval, gradientdiff, sum_down, sum_up, count_down, count_up, mingradientval, maxgradientval, startgradientval] = quant_specific_linear(xvals) %% quant_specific_linear includes additional analyses for single-worm linear assays. global info global vals B = ~isnan(xvals); Indices = arrayfun(@(x) find...
a3a53f10dc2f8b5d7f177b33d8739e64a6a9b2273012a1d57da3736579af587e
MATLAB
2,909
109
function th = threshold_for_far(target_far,hsi,det_img,filt,params) % th = threshold_for_far(target_far,hsi,det_img,filt,params) % % finds the threshold for a given false alarm rate in the detector output image (det_img) % % 2/9/2013 - Taylor Glenn - tcg@cise.ufl.edu if ~exist('params','var') || isempty(params) ...
7c778a0d307b8d55b06949ce8819426dd4c313dbe8f1fcaea670b97acbff3b93
MATLAB
2,910
79
%% get_set_swismwi_swi_2dhamming(h,mode,input) % % Input % -------------- % h : structure contains all handles of SEPIA % mode : 'set' - extract information from GUI to config file % 'get' - extract information from config file to GUI % input : if mode is 'set' then input sh...
e4dd709c6fc0f55c7418af00853d003368fd2929fdf75815e737afa24fb0c5cd
MATLAB
2,910
79
%% get_set_swismwi_swi_2dhamming(h,mode,input) % % Input % -------------- % h : structure contains all handles of SEPIA % mode : 'set' - extract information from GUI to config file % 'get' - extract information from config file to GUI % input : if mode is 'set' then input sh...
3aa71609c581179ae13a0b393a9b266bde6f22d8d6ad3f71d565e58975f88d18
MATLAB
2,911
119
addpath("~/ER_Ca_rot/networkSpreadFVM-main/scripts/"); addpath("~/ER_Ca_rot/networkSpreadFVM-main/examples/"); dirname = "~/ER_Ca_rot/networkSpreadFVM-main/examples/Kd_op/Output"; %filen= strings(5,51); ar = [0, 1.089, 2.178, 2.755, 4.356]; %diffusion constants ar1 = [-13.815, -13.539, -13.262, -12.986, -12.710, -12.43...
7c90b6a217e2b6e262793d3f7354e20289abf65a5e0e7103404e2907aaa282f9
MATLAB
2,912
126
%% %%%%% PHYSIO (just modify/hack physioinspections.m) % create physio inspection figures types = {'puls' 'resp'}; for qq=1:length(types) typ = types{qq}; alldata = {}; for subjix=1 for sess=25 for runix=1:14 file0 = sprintf('~/nsd/nsddata_timeseries/ppdata/subj%02d/physio/physio_session%02d_ru...
d1edb3555717abbd6bc58c4765a38d599d06975c64ea7e394c90ee938d3779ef
MATLAB
2,912
82
function varargout = preTrialSetup(varargin) % % [thisEvent, thisFixation, cfg] = postInitializatinSetup(cfg, iBlock, iEvent) % % % (C) Copyright 2020 CPP visual motion localizer developers % generic function to prepare some structure before each trial [cfg, iBlock, iEvent] = deal(varargin...
3228d9193eb6feb4a467c1b7743bb32e411beac7de7d6a1f30598ff067469fe0
MATLAB
2,913
71
clear all close all clc exp_root = 'C:\Users\User\Documents\fMRI_EXP\'; more_code = fullfile(exp_root, 'cells_data_muller'); data_folder = fullfile(more_code, 'wetransfer_neil-s-data_2023-09-25_1057'); addpath(genpath(more_code)); addpath(genpath(data_folder)); %load('grid_animal4.mat') load('grid_animal3.mat') num_g...
a040cffa07c2d76dc9fe833db8ce0323d59ea16c8bdf682ab05e26d83f85fbfc
MATLAB
2,913
64
function subtypes=graphical_model_prediction(subtypes_model,P_training, P, dHausdorff, K, thd, alpha) % predict the subtype membership for the new data N = length(subtypes_model); D = ones(1,N)*inf; x=1; for y=1:N % compare the temporal orders [~,sortedindexY] = sort(cell2mat(P_training{y,1}(:,4)),...
8bdea27b9e415bbd28d1b3f0e7b019a36b196849b3720af9b6ae81adef5f8dfa
MATLAB
2,916
75
function yBin = BF_Binarize(y,binarizeHow) % BF_Binarize Converts an input vector into a binarized version % ------------------------------------------------------------------------------ % Copyright (C) 2013-2026, Ben D. Fulcher <ben.d.fulcher@gmail.com>, % <http://www.benfulcher.com> % % If you use this code for ...
a349b2aa449bcf6c6146a003eaf2278e89d4a6ce58a6a8719cb52b6362909fd2
MATLAB
2,916
76
function [readyParams] = check_MLparams(params,defaultParams) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % check_MLparams checks parameters provided and returns default parameter % for an ML algorithm using a structure including default parameters. It % also throws warning messages if a...
a5215d2d08218fa26459264073eddb208ca12599059dede8dacd054266f2a3b6
MATLAB
2,916
71
function [bestParam,bestParamScore,bestParamIdx] = bayesOpt(objFun,... data,paramGrid,varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % bayesOpt performs bayesian optimization over parameters provided. % % Arguments: % objFun = Objective function (e.g., estimator). % data =...
e5bdf2517cc4e54c09337bc1add792a19239f8be6afb56b12588fa3be74b9ac6
MATLAB
2,916
91
% GETALLMENUS - get all submenus of a window or a menu and return % a tree. % % Usage: % >> [tree nb] = getallmenus( handler ); % % Inputs: % handler - handler of the window or of a menu % % Outputs: % tree - text output % nb - number of elements in the tree % % Author: Arnaud ...
94d4f2e2bb6705f7f7fc5f1b5c74f7b7b3cad404ba1b96520301183614d38505
MATLAB
2,917
83
function data = GetSpikeWaveforms(unit,varargin) %GetSpikeWaveforms - Get spike waveforms. % % USAGE % % waveforms = GetSpikeWaveforms(unit,<options>) % % unit [electrode group,cluster] pair % <options> optional list of property-value pairs (see table below) % % ============================...
9ca55f32225a85d7b8515e8935dad43a845bc536343a4a2a3d2e75bf576029fa
MATLAB
2,917
89
function PlotCSD(csd,varargin) %PlotCSD - Plot current source density. % % USAGE % % PlotCSD(csd,<options>) % % csd current source density <a href="matlab:help samples">samples</a> (see <a href="matlab:help CSD">CSD</a>) % <options> optional list of property-value pairs (see table below) % % ...
7b7946415a83a9ab02d9a717597d4bd4d673784780b28d0c8bcd574f8f61b8b4
MATLAB
2,918
96
% function [lik,likv] = hmm_cl(X,T,K,Mu,Cov,P,Pi); % % Calculate Likelihood for Hidden Markov Model % % X - N x p data matrix % T - length of each sequence (N must evenly divide by T, default T=N) % K - number of states % Mu - mean vectors % Cov - output covariance matrix (full, tied across states) % P - state transi...
c4f08c0fbca514a4d0adc310701bdefbfffa62c303d851495244dfbb9f1dae34
MATLAB
2,918
64
% This is an example code that shows how to export and import back data for manual adjustment of human Neuropixels recordings % with Blender, following by adjusting the ap.bin data accroding to manual % annotation. lfp_data_file = '{your data path}\data_file.lfp.bin'; ap_data_file = '{your data path}\data_file.ap.bin...
d6871b51cf3693d78641dd9ec6cb153c6cfa122958db4fd5ca9960cc2c8a30e5
MATLAB
2,918
118
function [lEvec,rEvec,Evals,xtras] = epca(varargin) % Return the first p eigenvectors and eigenvalues. % % Usage: % [lEvec,rEvec,Evals,xtras] = epca(X,p,dim,norm) % % Inputs: % X : 2D array % p : Number of eigenvectors and eigenvalues to be % returned. % dim : Dimension used for mean-centering. % ...
ef405b6e0f24b52bcd82c1128c7974b49b785bad0ad109c0daf05b1b4ff0c958
MATLAB
2,919
109
function afni_niml_test_io(fns) % simple test function for i/o capabilities of afni_niml_{read,parse,print,write} % % AFNI_NIML_TEST_IO(FNS), where FNS is a cell with filenames, reads each of % the files indicated in FNS, tests whether parsing and printing are % reverse operations, and writes the files to a new file. I...
89d23e69278a0f84b8fc2b419cf06296144e4f97f28a4d585e6ccb4dcfc6ff09
MATLAB
2,920
97
function getTriggers_emoReco_objectEmotion(params) % determines & saves trigger times and class labels % (c) Jiri, Mar16 display([' - finding events for: ' params.thisCategory]); %% per session: load trials, find events and save for sess = 1:size(params.storage.sessionCacheFiles,2) % load trials clear t...
e1caf0b9a5e594151a1688f9e5d96dd849a13c988417d9040e61d2ccaf3cf815
MATLAB
2,921
62
function start_cat(NiiFile, atlas, Template) % % Input: NiiFile <string> fullpath to T1 MRI image to be segmented. % atlas <string> fullpath to cortical atlas used by CAT12. % Template <string> fullpath to prior probability distribution % template used ...
49069d5517ec277153a45e06c4f0cba65da9174092e8d3ac9c63fa39efc40915
MATLAB
2,923
126
function vl_simplenn_diagnose(net, res) %VL_SIMPLENN_DIAGNOSE Plot diagnostic information on a SimpleNN network. % VL_SIMPLENN_DIAGNOSE(NET, RES) plots in the current window % the average, maximum, and miminum element for all the filters % and biases in the network NET. If RES is also provided, it will % plot ...
44b98ea19c233790a9ce8c7def6ee081fa28065ddb41f1e21002eb4dfb43fb52
MATLAB
2,924
95
function varargout = opensignals_txt(filename, hdr, begsample, endsample, chanindx) % OPENSIGNALS_TXT reads time series data from a Bitalino OpenSignals txt file % % Use as % hdr = opensignals_txt(filename); % dat = opensignals_txt(filename, hdr, begsample, endsample, chanindx); % evt = opensignals_txt(filename,...
5e71c7975487aad6e6f3139c5e8ecc3160f31af9b490f52698a80dc4f100d329
MATLAB
2,925
81
function str = fixname(str, version) % FIXNAME changes all inappropriate characters in a string into '_' % so that it can be used as a filename or as a field name in a structure. % If the string begins with a digit, an 'x' is prepended. % % Use as % str = fixname(str) % % MATLAB 2014a introduces the matlab.lang.make...
b99619739bbc463ef479470a14ae22d797a90bd4f826dd85f500020b9fa65b27
MATLAB
2,925
94
function B = ar_mls(TS,p) % [Y,B,Z,E] = CBIG_RL2017_ar_mls(TS,p) % This function identifies an autoregressive (AR) model from multivariate time series using the multivariate least square approach % Input % 'TS' original time course encoded in a matrix of size (T=number of time points,k=number of variables...
ed3265bac66d2074be618803a2d4e0a49791398c83cdd96a3ab7620cf69d4963
MATLAB
2,926
106
function diplayDesign(cfg, displayFigs) % % diplayDesign(cfg, displayFigs) % % % (C) Copyright 2020 CPP visual motion localizer developers %% Visualize the design matrix if displayFigs close all; figure(1); % Shows blocks (static and motion) and events (motion dir...
05ad7b590f42cc9173cbbfc415f51a4ddf23208f011839ecd5c9bcb98d9f7e52
MATLAB
2,927
61
function K = apxSparse(cov, xu, hyp, x, z) % apxSparse - Covariance function for sparse approximations. % % This is a special covariance function which handles some non-standard % requirements of sparse covariances % 1) it holds the inducing inputs in xu, and % 2) it returns covariances for prediction purposes....
13f90a55f068ed0826a3d267f77a2896435803843ec72b5b99bba56c55e7b7af
MATLAB
2,927
76
function firstlevel_decision() % Representative integrated decision model for Figure 4. % Loads archived multi-condition files and removes Miss/empty conditions. %% USER SETTINGS rootDir = 'D:\path\to\MRI_project'; condDir = 'D:\path\to\conditions_mat'; spmDir = 'C:\path\to\spm'; subName='sub-001'; emID='em0001'; nR...
20ecf103ca64d7b05939075e5920c07c64e7a3c95e5613c0953738108f3a8628
MATLAB
2,927
101
% This code acquires significantly related genes with MFC using PLS ROI = {'A1C' 'DFC' 'IPC' 'ITC' 'M1C' 'MFC' 'OFC' 'S1C' 'STC' 'V1C' 'VFC'}; Gene_expr_pre = readmatrix('./data/gene_expression.csv'); load('./data/Gene_label.mat') load('./data/MFC.mat') genes=Gene_label; % this needs to be imported first geneindex...
c80a41c8ac19a8baa42d283f74a6befbb5e7bbbe91db557556308034cd37218e
MATLAB
2,927
119
function [D,x0, side] = axons_setup(axons, lawname, k) % author : Tom Mingasson % axonsSetup creates a randomly generated axon gamma or lognormal distribution and initilialize axons positions in a square area defined by its length 'side'. % diameters distribution under a gamma or lognormal law D = samplingHastingsMet...
6956dccfbda6bb99aa3df548d2bb284790682e4b61862c4df4f457eec5e58253
MATLAB
2,929
113
function plot_fig4h(datadir) % Plot reward port nose poke probability during the delay period % during mixed block. N = 16 rats. % % INPUTS % datadir: file path of data downloaded from Zenodo. Link to download can % be found in README. load(fullfile(datadir, 'data-published/ratlist.mat'), 'ratList'); pokeProb = cell...
ad42835d6c7036e3f69d08fb5fae1201e7f7239a56aeee45628319c9d1d8a608
MATLAB
2,931
81
function LOCS = tapas_physio_create_LOCS_from_VOLLOCS(VOLLOCS, t, sqpar) % Compute slice scan events as locations in time vector (LOCS) from volume % scan locations and sequence parameters (TR, nSlices) % % LOCS = tapas_physio_create_LOCS_from_VOLLOCS(VOLLOCS, t, sqpar); % % % IN % NOTE: The detailed description of a...
fa02584492d97470c3d263d0662b92a8133589f219022d9428c1e5628e5cc731
MATLAB
2,932
71
function c = tapas_softmax_binary_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the softmax observation model for binary responses % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
e43a92ea679c0eb7b3a8aa7432537fec309fe343669bb870721aac9c4602fe7b
MATLAB
2,933
59
function Er = pipelineCompareDynamicEnergyAfterShuffle(time_series, control_node, window_size, r_time) % Pipeline of Compare dynamic control energy before and after shuffle % dynamicMiniEnergy to calculate the control energy. % This pipeline include: % 1. random select the start point and final point % ...
e4f36f0d46f71adc4705107474178b9bcb499fe27c8dd0a1b39215b51633f564
MATLAB
2,934
85
function [logp, yhat, res] = tapas_logrt_linear_whatworld(r, infStates, ptrans) % Calculates the log-probability of log-reaction times y (in units of log-ms) according to the % linear log-RT model developed with Louise Marshall and Sven Bestmann % % ----------------------------------------------------------------------...
fe951863c0ad86823a76cab22dc0e7f89aaa24a9a8001534b6827dfe8780803a
MATLAB
2,935
72
function ppc = PPC(phases,input2) %PPC - compute Pairwise Phase Consistency across spikes % % ppc = PPC(phases) computes the Pairwise Phase Consistency as defined by % Vinck, Wingerden, Womelsdorf, Fries, Pennartz (2010, NeuroImage) % ppc = PPC(phases,trialID) computes P(hat)2 Pairwise Phase Consistency % as define...
1de5c37d239606e49b768fb92a8343abddc7cdda003d79578ebc3f9410a52032
MATLAB
2,936
102
function M = centeredmatrixfactory(m, n, rows_or_cols) % Linear manifold struct. for optimization over matrices with centered cols % % function M = centeredmatrixfactory(m, n) % function M = centeredmatrixfactory(m, n, 'cols') % function M = centeredmatrixfactory(m, n, 'rows') % % Returns M, a structure for Manopt desc...
b17ae588502f1e60c83005af4a8fb7504d800b5e3998bec93bb2a911957a22df
MATLAB
2,937
112
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...
f7b2ad04110502de86e4283a12f7a43f5b364a84d509971906950716ef75be6e
MATLAB
2,937
66
function [brainVolumes, mni_vox] = brainVolumes_chSpec(params, struct_plotBrain, channelStruct, fixedVols, inds_vol, groupInfo) % updates/loads channel-specific brain volumes for slices plotting (defined for each channel separately) % updates if fixedVols{vol}.loaded = 0 % input: % - params struct % - struct_plotBr...
3fe06de660cf1641ca3172a0fef6a38440014f2de6ff78bbb99c7171bd90da2a
MATLAB
2,938
80
function out = ST_FitPolynomial(y, k) % ST_FitPolynomial Goodness of a polynomial fit to a time series % % Usually kind of a stupid thing to do with a time series, but it's sometimes % somehow informative for time series with large trends. % % ---INPUTS: % y, the input time series. % k, the order of the polynomial to...
613b0459f78f1cee7d3f2ec4bb9789e16e42da6cf4b3b3f4f98dc2206b06240e
MATLAB
2,938
82
function data = check_workspace(wp_dir) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % check_workspace checks if the workspace directory contains all necessary % files % % Arguments: % wp_dir: Workspace directory % % Output: % data: Structure containing the paths of the files % % Exam...
6f5c3d35cab76ccd282bb034bf48bd4bb1b5d7b7756defdccad34324579944ac
MATLAB
2,938
100
function tapas_hhmm_binary_displayResults(r) % Displays results estimated by fitModel for the hmm perceptual model in the binary case % Usage: est = fitModel(responses, inputs); hmm_binary_displayResults(est); % % -------------------------------------------------------------------------------------------------- % Copy...
9ea6863cccd0ab02bc8cd42267951bcefef738cb2ef8035044bb083096c77103
MATLAB
2,938
93
function [MRSCont] = OspreyRebase(MRSCont) %% [MRSCont] = OspreyRebase(MRSCont) % This function allows you to rebase your derviatives folder and files in % case you have processed them on another machine % % USAGE: % MRSCont = OspreyRebase(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data contai...
f878f8b1d33516452ed44ad491bde31df3c646b7b98bb78bae717f285974bdb7
MATLAB
2,939
82
function physio = tapas_physio_prepend_absolute_paths(physio) % prepend absolute paths for file names, in particular save_dir; creates % save_dir, if necessary % % physio = tapas_physio_prepend_absolute_paths(physio) % % IN % % OUT % % EXAMPLE % tapas_physio_prepend_absolute_paths % % See also % Author: Lars Kas...
9225c5c5b8d1cc03288979b7491d3fd9b59da969a43ddaa647a3a38e035abe42
MATLAB
2,940
89
function f = constructbutterfilter3D(matrixsize,cutoff,order,mode) % function f = constructbutterfilter3D(matrixsize,cutoff,order,mode) % % <matrixsize> is [A B C] with the dimensions of the 3D volume % <cutoff> is a 3-element cell vector with each element being: % A means low-pass filter cutoff (in cycles per field...
f6090b0c90d71979a110ebb5df409670803074f619825f6a87381a76b039d0e3
MATLAB
2,940
81
function s = hlp_handleerror(e,level) % Displays a formatted error message for some error object, including a full stack trace. % hlp_handleerror(Error, Indent) % % In: % Error : error object, as received from lasterror or via a catch clause % (if omitted, lasterror is used) % Indent : optional inden...
7c9bf7b5ddcaa3c5decb4db0ea5a1fb0b98eaa3192d2ad554a75f2e188882325
MATLAB
2,941
82
function transform_to_ctf(input_img) % % Input: input_img <string> fullpath to T1 MRI image to be segmented % % This function transforms all coordinate system depending results of this % segmentaion pipeline into the ctf coordinate system. It does the follwoing: % 1. Reads fiducials from nonlinear alignement. %...
39058a158a5f8f12a57cb0dea2c768cb8e451a2abf348a20d485a97a0d2587fa
MATLAB
2,943
126
function [pt,st] = contingency_table(varargin) % function [pt,st] = contingency_table(varargin) % % makes 2-way contingency tables for pairs of variables % varargin arguments are variables % vars must be column cell array vectors containing strings % % pt: Table of point (coordinate) counts % st: Table of unique study...
47c4a2097bcd745b51c91877b05ba40751939b9db0828cd609ce865cf258d4a2
MATLAB
2,943
85
function compile_all % Compile all EIF normalization MEX files into sim_script/mex % Folder layout (relative to this script): % sim_script/ % compile_all.m % mex/ (created if missing) % src/ % common/ (EIF_common.c, EIF_common.h) % variants/ (multiple EIF_normalizat...
aadc46f4d721f0b28e6b59b16a137de77ae3b5b47588801a16fdf2f93229e847
MATLAB
2,943
98
function output = cvClassifier(data, nFolds, nPartitions, type, reg) % The fraction test is 1/nPartitions * 100, for 5 partitions 20% of the % trials are held out in each model fit, making the cross validation an % 80/20 split if nargin < 2 % With nFolds and nPartitions at default, 10 models will be fit nFol...
ebbe64133db9c8db6ac81153347f1b3dd4893902c9a7d723c0750c2da1851664
MATLAB
2,943
72
function plot(recording,cfg,varargin) % Plot the contents of a McsCmosRecording object % % function plot(recording,cfg,varargin) % % Input: % recording - A McsCmosRecording object % % cfg - Either empty (for default parameters) or a structure with % (some of) the following f...
a00eb80f0e79a0ef20ef71ca8ee500a2ee568867941000c0bb64ca658cfe7c26
MATLAB
2,944
112
%% Colormaps that are pretty awesome: DEMO1 % this is an exampe of 4 colormaps that are being considered as the default % colormap in python's matplotlib lybrary. % % All of them look quite good and they dont have any official name, so at % the moment they are A,B,C,D. % % colormaps from https://github.com/bids/...
a64978d33386b52a97624a33636c3a98f07a6bdab166d9a7b6d1fcd337252fd4
MATLAB
2,945
113
% op_takeextra.m % Jamie Near, McGill University 2014. % % USAGE: % out=op_takesubspec(in,index); % % DESCRIPTION: % Extract the subspectra with indices corresponding to the 'index' input % array. % % INPUTS: % in = input data in matlab structure format. % index = vector indicating the indices of the subspectr...
42d3c493498149d113e7badfd679772cfedb004e6c44cfb4be50392f8fe3fab6
MATLAB
2,946
92
% this script looks at prffloc screening... % ranks the 14 subjects according to BOLD... % and boil it down to one number per subject. % visual inspection of variance explained [make sure they look sane] cd /Users/kendrick/sessions/nsd/ open */analyzePRF_prf_figures/R2.png open */GLM*figures/FinalModel.png % make...
60ca8442baa01f8ca519ceb2e25582c03c0c29dbe9287b4eb7949120c9a8de00
MATLAB
2,946
79
function [fList,isFine] = tapas_diagnose_file(fileNames,filterNames,notifyMultipleOccurences) % TAPAS_DIAGNOSE_FILE Checks if file uses functions which are overloaded % % IN % fileName [character vector of cell array of character vectors] % The file names to be checked. % % OUT % fList Filtered list of...
aa5de0e260216b9f667c0c0c07507fe8995f44b89913fe89775dcf38740a6c48
MATLAB
2,948
94
function out = nsamdf_nonlinear_measure(data,fs,winLenRel,shiftLenRel,lagRel,degree,doPlot) % nsamdf_nonlinear_measure computes the nonlinearity measure L through nsAMDF % (nonlinear average magnitude difference function), developed by: % % Ozkurt et al. (2020), "Identification of nonlinear features in cortical and % s...
1252ec13f5fcd7da27295781080a21ab84f097ff6d6fac40050c171a877d3ea0
MATLAB
2,949
67
function fake_output = mmx(varargin) %MMX - Multithreaded matrix operations on N-D matrices % MMX treats an N-D matrix of double precision values as a set of pages % of 2D matrices, and performs various matrix operations on those pages. % MMX uses multithreading over the higher dimensions to achieve good % ...
37ca8f8286a8ef26431c155c26ba40d496768cfa9a64f27761b196a0c80b3e43
MATLAB
2,949
96
function [ output_args ] = estimateGraphCommunityStructure( graph , opts ) %ESTIMATEGRAPHCOMMUNITYSTRUCTURE( graph , opts ) Wrapper function for the %'estimate' function to run the Marko-Chain-Monte-Carlo procedure for %estimating community structure. % % INPUT: % graph [graph]: undirected, unweigted graph % opts...
8957ad718410021a1925cbf3261e0b39b7951e3938ec2d8343802dca994a4fbe
MATLAB
2,949
101
% fir_filterdcpadded() - Pad data with DC constant and filter % % Usage: % >> data = fir_filterdcpadded(b, a, data, causal, usefftfilt); % % Inputs: % b - vector of filter coefficients % a - 1 % data - raw data (times x chans) % causal - boolean perform causal filtering...
b5e75ee1701b830ed793c049c7dbe948ff524120bec11fcbf93073b3e72fae68
MATLAB
2,949
88
%% h = sepia_handle_panel_Utility(hParent,h,position) % % Input % -------------- % hParent : parent handle of this panel % hFig : handle of the GUI % h : global structure contains all handles % position : position of this panel % % Output % -------------- % h : global structu...
bda6aba316274cf4e71e0f795be6ffb457088daa3cd549733da2131f012ffcce
MATLAB
2,949
100
function [onset, duration] = doAuditoryMotion(cfg, thisEvent) % Play the auditopry stimulation of moving in 4 directions or static noise bursts % % DIRECTIONS % 0=Right; 90=Up; 180=Left; 270=down; -1 static % % Input: % - cfg: PTB/machine configurations returned by setParameters and init...
cfb4d899e4d6f163be892225977eb66d46c7e30735d4928f5b659bc3906b828d
MATLAB
2,949
82
function [data2, length_dupl] = RemoveDuplicates(data) % by Julia Becker, 01/04/2020 % JB 19/11/2021, debugged %REMOVEDUPLICATES Handles curves from identical x/y position % Finds repeat measurements and keeps highest force one %% Do all of the below individually for each experimental folder folder = unique(dat...
a72976dc371f1d1a6801f99291d7707f70a6344ef38c8f99526bcb0194c9126e
MATLAB
2,951
92
function index2centrotype=icassoIdx2Centrotype(sR,mode,P) %function index2centrotype=icassoIdx2Centrotype(sR,mode,P) % %PURPOSE % %To compute the index to centrotype of %estimate-clusters. Centrotype is an estimate close to the centroid %of the estimate-cluster. (see help in function centrotype for an %exact definition...
1612324003b3bff4c4ff196bc7498200a9abf953cf578ff07489cd50de5f5744
MATLAB
2,952
67
classdef McsCmosDataSource < handle % Stores the contents of a generic data source for CMOS-MEA files. % % This should only be used if a data source of unknown type is used. It % reads all datasets in the data source, so it should not be used if the % datasets are very large! % % (c) 2017 by Multi Channel Syste...
2b0ab46005a1be6e6208254ddc6d4b341d89f35dcb717797fd8a0c8e6879e1ed
MATLAB
2,952
84
function out = DN_HistogramMode(y, numBins, doSimple, doPlot) % DN_HistogramMode Mode of a data vector. % % Measures the mode of the data vector using histograms with a given number % of bins. % % ---INPUTS: % % y, the input data vector. % numBins, the number of bins to use in the histogram. % doSimple, whether to...
a55f0556e12227125e1ff01f58247dc18b9c9b86aa7d83e46528b57d6b3288a0
MATLAB
2,953
87
% firwsord() - Estimate windowed sinc FIR filter order depending on % window type and requested transition band width % % Usage: % >> [m, dev] = firwsord(wtype, fs, df); % >> m = firwsord('kaiser', fs, df, dev); % % Inputs: % wtype - char array window type. 'rectangular', 'hann', 'hamming', % ...
077390ea929bb2369b74185010aae1db5012aa4aac7fb92c5f68f27320b0e80b
MATLAB
2,956
78
function [] = Crawler () %% Get user to select the files to be analyzed. [name, pathstr] = uigetfile('*.xlsx', 'MultiSelect','on'); if isequal(name,0) error('User canceled analysis session'); elseif length(name) == 1 error('User selected only one file, please use the normal WormTacker3000 for this.'); else ...
0ac139bda6c2f886ba3149a2a280f94640f2cffb857c2ff11c1e99ca54fd0fce
MATLAB
2,956
80
% FDR - compute false detection rate mask % % Usage: % >> [p_fdr, p_masked] = fdr( pvals, alpha); % % Inputs: % pvals - vector or array of p-values % alpha - threshold value (non-corrected). If no alpha is given % each p-value is used as its own alpha and FDR corrected % array is retur...
01fcf074c43270625fa19dc39a2ddcac19924b7864c64ca20e4c7a0e16bc8aa3
MATLAB
2,957
61
function [b_orig, b_anti, b_orig_norm,b_anti_norm] = er_pac_3(data,fs,segleng,segshift,epleng,filt) % Estimates PAC using bispectra assuming that data is 6 channels 3 pcs of first roi and second roi % b_orig: uncorrected bispectrum % b_anti: anti-symmetrized bispectrum % b_orig_norm: uncorrected bicoherence % b_anti...
14fe48e36a992fe286b16f7155270feabebbc5aaa1a6dc7d0f74a805a7e4c5ab
MATLAB
2,957
108
function [Out] = GetSignedBias(sn) Azimuths = [-75:15:75]; for idx = 1:length(Azimuths) TargetAzimuth = Azimuths(idx); % --- lp ResponseAzimuths = sn.lp_Azi(:,idx); nTrials = length(ResponseAzimuths); nTrialsHalf = nTrials * 0.5; n1 = nTrials/2; % last idx of first half of trials n2 ...
fbd90042d538825207b2a3de8907a4d4caa31263f774bf58e5961d6f7faec780
MATLAB
2,957
121
%% TE = readTE_JSON(filenames) % % Input % -------------- % filenames : json file fullname(s) % % Output % -------------- % TE : echo times % % Description: % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 13 June 2018 % Date modified: 12 April 2019 % % function [TE] = readTE_JSON(filena...
18430d1b51bb30da0ec0322e39e6719251fd799105e21c6e570139929fcb096e
MATLAB
2,958
82
function [K,dK] = covGabor(mode, hyp, x, z) % Gabor covariance function with length scale ell and period p. The % covariance function is parameterized as: % % k(x,z) = h(x-z), h(t) = exp(-sum(t.^2./(2*ell.^2)))*cos(2*pi*sum(t./p)). % % The hyperparameters are: % % hyp = [ hyp_ell % hyp_p ] % % We offer thr...
260afcccb6a844602e221b5f58f396c3f610ee00f49addd2c3750ffbd20ffc5e
MATLAB
2,959
86
% simulationOptions_demo % % This function is used to make a simulationOptions struct for use in the % simulation part of the demo. The options should be set to personal % preference. % % Cai Wingfield 7-2010 %__________________________________________________________________________ % Copyright (C) 2010 Medical Resea...
46a2858984e220a2e9770d4e8a4e55fc0bd8c5ba332fb66e3d40d183206eee3c
MATLAB
2,959
81
function [cs,index] = sort_nat(c,mode) %sort_nat: Natural order sort of cell array of strings. % usage: [S,INDEX] = sort_nat(C) % % where, % C is a cell array (vector) of strings to be sorted. % S is C, sorted in natural order. % INDEX is the sort order such that S = C(INDEX); % % Natural order sorting sorts ...
d5569ca36bc752845c9230a53ea7a0eb86df8e7d716aa21c90f8aa17ca7fd75f
MATLAB
2,961
91
function [iti,iti_npv,iti_pv,startTime] = getITI(S) % Calculates inter-trial interval and start time for each trial in a % session. SSS 05/2020 %INPUTS: % S = screened sessions from get_data (using poolRats to screen for % current criteria 05/2020) %OUTPUTS: % iti = cell for each session containing the ITI ...
5c795839cf6a12b840b501bb029f7b23a47d54acc374c473214e74caec981fc4
MATLAB
2,962
88
function [y,dzdg,dzdb] = vl_nnbnorm_old(x,g,b,varargin) % VL_NNBNORM CNN batch normalisation % Y = VL_NNBNORM(X,G,B) computes the batch normalization of the % input X. This is defined as: % % Y(i,j,k,t) = G(k) * (X(i,j,k,t) - mu(k)) / sigma(k) + B(k) % % where % % mu(k) = mean_ijt X(i,j,k,t), % si...
5efed1d0e9e85789fc59c9026e7f30b47b50c872cf8de946695b1ea6eabf83c1
MATLAB
2,962
77
% STD_CHECKCONSIST - Create channel groups for plotting. % % Usage: % >> boolval = std_checkconsist(STUDY, 'uniform', 'condition'); % >> boolval = std_checkconsist(STUDY, 'uniform', 'group'); % Inputs: % STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets i...
ca1d543a66d4358143036837c42702b7a0f866ae61e5a7d7765d2ead9b58745d
MATLAB
2,962
70
function [indices,values] = FindClosest(reference, query, mode) %FindClosest - field the indices of a reference vector closest to a query vector % Look up a query vector in a reference vector, and for each value in % the query vector, return the index of the closest value in the % reference vector. % % USAGE % % ...
3059548863da2a9823e950976f89f87bc79fce10922d6ee92ce17c339ca4d91c
MATLAB
2,963
76
function cm_data=fake_parula(m) cm = [[0.2081, 0.1663, 0.5292], [0.2116238095, 0.1897809524, 0.5776761905], [0.212252381, 0.2137714286, 0.6269714286], [0.2081, 0.2386, 0.6770857143], [0.1959047619, 0.2644571429, 0.7279], [0.1707285714, 0.2919380952, 0.779247619], [0.1252714286, 0.3242428571, 0.8302714286...
f054ba402b09ce58f7d27b93729d165d67074a96d4023d7118806e6c5cf0147a
MATLAB
2,963
91
function [file] = read_ctf_ascii(filename) % READ_CTF_ASCII reads general data from an CTF configuration file % % The file should be formatted like % Group % { % item1 : value1a value1b value1c % item2 : value2a value2b value2c % item3 : value3a value3b value3c % item4 : value4a value4b value...
9d75c96b0574fe24e35de76e332ba22a304d57946248831c5db9af4b427c8807
MATLAB
2,964
84
function tapas_init(varargin) % Initialize TAPAS and print a message in the console % % If no argument is given, all toolboxes are initialized. % If you want to initialize only certain toolboxes, use their % names as arguments, i.e. tapas_init('hgf') for the HGF-toolbox. % Dependent TAPAS toolboxes will be initial...
9503d8d20edfe8c1abe8a29f9395bb794f94fc0a512443333a6196751590c0ef
MATLAB
2,966
79
% EEG_MERGECHAN - merge channel structure while preserving channel % order % % >> mergelocs = eeg_mergechan(locs1, locs2); % % Inputs: % locs1 - EEGLAB channel location structure % locs2 - second EEGLAB channel location structure % % Output: % mergelocs - merged channel location ...
e8a9a5b910f774cc0b01ebd49a88951d153f1981ff6360e5fec5b0bc936faa6b
MATLAB
2,966
76
function [selectionImage, selectionIndexArray, unusedVarargin] = select(this, varargin) % Prototype for select-method of n-dimensional image data using dimInfo % % Y = MrImage() % selectionImage = Y.select('type', 'index'/'label', 'invert', true/false, ... % 'removeDims', true/false % 'di...
fc38f1a6950b95dcf464081de6aa436b083d39fe78164ca9b635e54eb69c1387
MATLAB
2,967
85
function [varargout] = simulateClusteredfMRIData_fullBrain(simulationOptions) % % this function simulates fMRI data with a categorical effect inserted at a % specified location. The remaining regions contain noise that is temporally % and spatially smooth yet lacks any particular categorical structure. % the size of th...
044b1757a8a436391af2aa30c815b265f6a9d7ed835653094a35185fda6a07c9
MATLAB
2,968
94
function costs = surfprofile(problem, x, d1, d2, t1, t2) % Plot the cost function as a surface over a 2-dimensional subspace. % % function surfprofile(problem, x, d1, d2, t1, t2) % function costs = surfprofile(problem, x, d1, d2, t1, t2) % % Evaluates the cost function at points % % gamma(t1, t2) = exponential_x(t1*d...
649f9ed420afadff2aca56185b81f6dc7dca566d2bca77a81b691b16f733faa3
MATLAB
2,968
68
disp('See http://www.gaussianprocess.org/gpml/code/matlab/doc/ for details.') clear all, close all, write_fig = 0; N = 30; sd = 3; rand('seed',sd), randn('seed',sd) % set a seed for reproducability liktyp = input('Which likelihood?\n (g)aussian, (l)ogistic: ','s'); a = 0.3; b = 1.2; f = @(x) a*x + b + sin(x); ...
b0ef4997d1dc9c185409bda236cb199a0cbe6e47bafc1a6acb11ef9119cd2132
MATLAB
2,968
102
function imdb = cnn_setup_data_voc07_ssw(varargin) %CNN_SETUP_DATE_VOC07_SSW Setup PASCAL VOC 2007 data with precomputed SSW proposals % % Copyright (C) 2016 Hakan Bilen. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file)...
3d808433bfda9a010937e651c3d9f56d7677f441d74bbc0ee2d25b14e446001b
MATLAB
2,970
82
function parameters = LoadParameters(filename) %LoadParameters - Load parameters from an XML file. % % USAGE % % parameters = LoadParameters(filename) % % filename parameter file name % Copyright (C) 2004-2018 by Michaël Zugaro % % This program is free software; you can redistribute it and/or modify...
2ac3f5af4e5490cbac678dda4cfccea662d51618603261cdc85dcfce017f7bdd
MATLAB
2,971
85
%{ preprocess.ManualSegment (imported) # manual 2d cell segmentation$ -> preprocess.PrepareGalvoMotion --- mask : longblob # binary 4-connected mask image segmenting the aligned image segment_ts=CURRENT_TIMESTAMP: timestamp # automatic %} classdef Manua...
8e47d3e229b70938f059b664e0c4b23e462d4d27e5106082ffc41878a7603c65
MATLAB
2,971
102
function [result] = fit_happy_model_partnerRPE(mtx,happyscore,constant) %assumes that each row of the cell array is a different subject rptfit = 5; %repeat N times jittering the betas tempf=fieldnames(mtx); for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end; data = mtx; data.happysc...
f136de8d3b4be709c20dbd9f1aeedabbe6df883c2639c611efeed92e344f97e5
MATLAB
2,972
85
function [spikeTrain, filtTrace, threshold] = ... detectSpikesThreshold(trace, multiplier, refPeriod, fs, filterFlag, absoluteThreshold, ... threshold_calculation_window) % Description: % Threshold-based spike detection % INPUT: % trace: [n x 1] raw or filtered voltage trace % multiplier: [scalar] thres...
6d49d15f51b3a22f08138057446198e8f9b9700c091c3d6ee0a841ce7929e333
MATLAB
2,973
77
% Main script for generating Economo-Koskinas cortical parcellation % annotation files and resampling them from fsaverage5 to fsaverage % using FreeSurfer % % Reference: % Lee H, ..., Huang S, Communications Biology, 2026 % % Requirements: % - FreeSurfer installed and configured % - FreeSurfer fsaverage and fsaverage5 ...
207b7497018e992cc1b14ee6314d9d06a73044d19776b41144184b17132f5af4
MATLAB
2,974
102
function [result] = fit_happy_model_partnerRPE(mtx,happyscore,constant) %assumes that each row of the cell array is a different subject rptfit = 5; %repeat N times jittering the betas tempf=fieldnames(mtx); for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end; data = mtx; data.happysc...
131d5de21b2386a69716f559a3daf8253c7b54658033b6c62e434204da26f361
MATLAB
2,975
97
function [Xlsq, Xhub, D] = test04(n, m) % function [Xlsq Xhub D] = test04(n, m) % All intputs are optional. % % Crude formulation of the photometric stereo problem to experiment with % product manifolds: we are looking for two sets of normal vectors in R^3, % more precisely, we work on the product OB(3, m) x OB(3, n). ...