sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fa5406cfa9cdb3344473bc4040ed0c37d3f702cf681204b02951a995499213a5
MATLAB
6,153
191
% FORMATTING clear all close gcf load Transient081_2-train % Go to directory cd C:\matlab\work DATA = dir('C:\MATLAB\work\*.ctr'); DATA = rmfield(DATA,'date'); DATA = rmfield(DATA,'bytes'); DATA = rmfield(DATA,'isdir'); [numSamples x] = size(DATA); o = zeros(1, 250); for c1 = 1:numSamples eval(['load ' DATA(c1).n...
d7d0bb3592af4f56f602159bfc313ff66aedaf96550e9f844e0ba9330ad958fd
MATLAB
6,160
168
function [Z, P, X, A] = sparse_pca(A, m, gamma) % Sparse principal component analysis based on optimization over Stiefel. % % [Z, P, X] = sparse_pca(A, m, gamma) % % We consider sparse PCA applied to a data matrix A of size pxn, where p is % the number of samples (observations) and n is the number of variables % (featu...
28689f245fdcc47f95f0b3fedd92951957149f14352e854557176fcd70db6d1f
MATLAB
6,168
180
function [distmat,cfg] = mahal_iem_mds_xgen_1fold(dat,theta,task,cfg) % [distmat,cfg] = mahal_iem_mds_xgen_1fold(dat,theta,task,cfg) if nargin < 3 help mahal_iem_mds_xgen error('missing input arguments!') end ntrl = size(dat,1); % number of timepoints nsens = size(dat,2); % number of M/E...
8ef584768a7125855a6a4055b728a6093e90c06347dc3373c0f4b09f1594cd06
MATLAB
6,170
102
%% the beta parameters from a ROI %% extract beta estimates from TML task clear % sub-pil001 and sub-pil002 have no localizer %'sub-011' have no hMT;'sub-013' no (rhMT rMTt),'sub-014' no MTt %'sub-008' have only right mst - !! do manually subjectList= {'sub-001','sub-002','sub-003','sub-004','sub-005','sub-006','sub...
18f1d9480b232c34ba9f2342c07bc192f1ff67bef6d6951b2e3015dffda014a3
MATLAB
6,173
118
function plot_metrics(plotStructs, plotColors, figure_save, saveLocation, ... y_param, x_axis_lim, y_axis_lim, x_axis_ticks, y_axis_ticks, y_axis_label, ... pulse_width, optional_outline_color, specific_num, custom_stats, each_acq, acq_range, ... x_axis_label, x_tick_labels, y_tick_labels) fig = f...
d5a70651cc7a787366c4978e1389a79874fedf710011c4b76cefb80d667934cb
MATLAB
6,174
193
% EEG_EVENTTYPES - return a list of event or urevent types in a dataset and % the respective number of events of each type. Output event % types are sorted in reverse order of their number. If no % outputs, print this list on the commandline instead. % % U...
29442e1276ea877e7487aca3f160721e121be0108f8711201cce18f65cc7b74d
MATLAB
6,175
194
% presentStimuli % Presents SF bandpass filtered noise stimuli to the subject for a fixed number of blocks. % The subject responds to a change in luminance at fixation with a button press. % The subject is provided a blank period between blocks. % % Syntax % run_info = presentStimuli(p, w, t, stimuli) % % Input...
3ca2d56cf0e49146e594f80bd7feac1cd1cbacbf378e5655fc93a1c3ad57783b
MATLAB
6,180
224
% READEGI - read EGI Simple Binary datafile (versions 2,3,4,5,6,7). % Return header info, EEG data, and any event data. % Usage: % >> [head, TrialData, EventData, CatIndex] = readegi(filename, dataChunks, forceversion) % % Required Input: % filename = EGI data filename % % Optional Input: % dataChunks = vec...
286353c27593788013ceb46b8daa11c56f1859cea82e1173aadb6d9bf6d5d0c9
MATLAB
6,183
260
function OUT = db_cluster_table(clusters,DB,varargin) % function OUT = db_cluster_table(clusters,DB,varargin) % % tor wager % counts studies and contrasts in each cluster % % clusters is a struct in which XYZmm field has list of points % --should be output of database2clusters, which contains all fields % DB is databas...
f5413b2a853779c6ad847ee1f108440d953a103e4c23fb3619e416fa6ad18a81
MATLAB
6,183
143
%************************************************************************************% %************************************************************************************% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%Master file for D.sort%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %**********************************************************...
22d87175f904e451b8b487424782aa8c31350d6d68964764143b68fa3aeeabfb
MATLAB
6,184
177
% GRADPLOT - Compute the gradient of EEG scalp map(s) on a square grid % % Usage: % >> [gradX, gradY] = gradplot(maps,eloc_file,draw) % Inputs: % maps - Activity levels, size (nelectrodes,nmaps) % eloc_file - Electrode location filename (.loc file) containing electrode % - coordinates...
efd1ff19bf324599580cb1c199b0714ab6e01e102ea312289336bf880d7a54a7
MATLAB
6,190
105
function ops = Config_file(sessionpath) <<<<<<< HEAD ops.datatype = 'OpenEphys'; % binary ('dat', 'bin') or 'openEphys' ops.root = sessionpath; % 'openEphys' only: where raw files are % ops.fbinary = strcat(ops.root,'\example.dat'); % will be created for 'openEphys' ======= ops.da...
641a757c0cb8f1b827ecdf474c9aa9c4f0b4dfd74af26d9ef267af8bd2dc2ff8
MATLAB
6,192
156
function [movie,movie_batch,summary]=loadDCIMGchunks(filePath,varargin) % Loading DCIMG in chunks, clearing mex buffer inbetween chunk loading. % This function makes sense when you want to resize the file on the fly % while loading. Otherwise, there is no memory benefit. Loding to H5 % possible too. % % SYNTAX % [movie...
a299d106c3eac26ceb9722601b1789227d74b9a4c9608dd1dcf5d67509eba275
MATLAB
6,192
173
function PlotExtendedData7(datadir, codedir) %PlotExtendedData7 - Plots Extended Data 4. % INPUTS: % datadir - Local directory where ProcessData_ExtendedData7.mat was saved after running ProcessData_ExtendedData7 % codedir - Local directory where code (e.g., published/EstrousRPE/) was saved %% Set up paths s = pa...
021066ac0f81e547f4d6842cb8b8425788aefc10e08d6866288631833f241fb6
MATLAB
6,193
162
function out = FC_LoopLocalSimple(y, forecastMeth) % FC_LoopLocalSimple How simple local forecasting depends on window length. % % Analyzes the outputs of FC_LocalSimple for a range of local window lengths, l. % Loops over the length of the data to use for FC_LocalSimple prediction % % ---INPUTS: % % y, the input ti...
643ab6417eb47ee18cc4977a4b50db49e4de0fa221b871a0abe4b80f821fc8e1
MATLAB
6,199
152
% fig8_v1_noGUI.m % RF parameters: % LW ratio: 4 to 2 % # subregions: 2 % center frequency: 0.08 cpd clear close all % simulated response parameters deltaFMax = 1; noiseStd = 0.01; % visualization parameters gOSIThresh = 0; alphaExp = 0.00001; disableLabels = 1; customFile = "~/Documents/MATLAB/mousesc-ori-model/fi...
e5c35e001fa684019892552b8f58bbbb1cf8c09d95314535b753d22e48a317d8
MATLAB
6,199
177
function NAMES = fieldnamesr(S,varargin) %FIELDNAMESR Get structure field names in recursive manner. % % NAMES = FIELDNAMESR(S) returns a cell array of strings containing the % structure field names associated with s, the structure field names % of any structures which are fields of s, any structures which are % ...
cd48f7909ed16b4ac8f8d034cae38e5cf264a6e4ceae1e8d183dfccd9277223c
MATLAB
6,204
148
%% Wrapper_CLEARSWI(headerAndExtraData,output_structure,algorParam) % % Input % -------------- % headerAndExtraData : structure contains extra header info/data for the algorithm % output_structure : structure contains output file path and output NIfTI header % algorParam : structure contains fields with algor...
97c8d9f32619582db1f70735be6a359353a05e2b0d387c92481e23e4c2c68d6d
MATLAB
6,207
144
function processMuscimolData(muscimolDataPath, codePath, savePath) % Process muscimol data. Must run for plotFigure2_muscimol, plotFigure_S4 %INPUTS: % muscimolPath = local path to muscimol behavior data downloaded from Zenodo % codePath = local path to where code was saved % savePath = local path to where yo...
969c60694916a194c51700a7efd2a3c8e936d395d109ec6630261995326edb9d
MATLAB
6,211
166
function [net, info] = cnn_imagenet(varargin) %CNN_IMAGENET Demonstrates training a CNN on ImageNet % This demo demonstrates training the AlexNet, VGG-F, VGG-S, VGG-M, % VGG-VD-16, and VGG-VD-19 architectures on ImageNet data. run(fullfile(fileparts(mfilename('fullpath')), ... '..', '..', 'matlab', 'vl_setupnn.m...
f76cdfc19e369e44a1f414c4d59a271713277bdec6fea46cf71b571fd1d6b0ab
MATLAB
6,214
108
% STD_SPECPLOT - plot STUDY component cluster spectra, either mean spectra % for all requested clusters in the same figure, with spectra % for different conditions (if any) plotted in different colors, % or spectra for each specified cluster in a separate figure % ...
1e27a96ebe7a3da700882ff6272ce71b087c9f8ee7fa64a211422b1428cd8025
MATLAB
6,215
159
function plotNMF(experimentMatFolder, plotSaveFolder, Params) % Plots components and variance explained using non-negative matrix % factorisation (NMF) % Parameters % ---------- % experimentMatFolder : str % path to where experiment mat files are located % plotSaveFolder : str % path to save plot % Params : st...
c9daa02de39330f1c41bbcb3eb13b65e3f2c2d6cb118e31c649ce727900f930e
MATLAB
6,215
214
function [err,Fname] = wryte3 (M,Fname,Opt) % % [err,UsedName] = wryte3 (M,Fname,[Opt]) % %Purpose: % Write matrix M to a text file % % %Input Parameters: % M : NxK matrix % Fname : string containing the file name to write the matrix to % Opt is either a flag (0/1) or an optional structure with the following ...
fe4eb9faf91dfe2b365f34e5ceaf91434e0447e7a38eaad2a270959589d65b7a
MATLAB
6,223
141
%VL_IMREADJPEG Load and transform images asynchronously % IMAGES = VL_IMREADJPEG(FILES) reads the specified cell array % FILES of JPEG files and returns at cell array of images IMAGES. % % IMAGES = VL_IMREADJPEG(FILES, 'NumThreads', T) uses T parallel % threads to accelerate the operation. Note that this is ind...
c921e95107a6b7df8197f22e3f7b51ea4d01247b37f63dc97e8f6fbb08bc3f19
MATLAB
6,225
207
% output = demo_image_math_imcalc_fslmaths() % % IN % % OUT % % EXAMPLE % demo_math_with_two_images % % See also % Author: Saskia Klein & Lars Kasper % Created: 2014-11-18 % Copyright (C) 2014 Institute for Biomedical Engineering % University of Zurich and ETH Zurich % % This file is part of ...
90347edd246696c7a5056ecff64b56875cdc59097fb4278b7af431d67e64243a
MATLAB
6,228
153
function transform_to_ctf(input_img, numverts, maxvoxelvol, num_sources) % % Input: input_img <string> fullpath to T1 MRI image to be segmented % numvertices <integer> number of desired mesh vertices. % maxvoxelvol <float> desired maximal volume per tetrahedra % num_sour...
6469eccfd20be80a89d8188b30d894674d1ba1244398737abdb7b25eb9a3f699
MATLAB
6,229
148
function [trl] = iEEG_func_rippleDetector2(x, srate) %% ######################################################################## % [trl] = iEEG_func_rippleDetector2(x, srate) % ######################################################################### % % Ripple detection % %--------------------------------------------...
ae252640ced0d0586cffe6cba3302dd47602d9915675b60719d050ec30ca4043
MATLAB
6,231
255
disp('The only input needed is a distance matrix file') disp('The format of this file should be: ') disp('Column 1: id of element i') disp('Column 2: id of element j') disp('Column 3: dist(i,j)') %Change the line below to match the actual file name mdist='s1cPROT_kept.dmtx'; xx=load(mdist); %Set upper and lower bounds ...
eb3e40bf50b923be35203ddfca9bb33025b18e510d0d89e5bac9f5774169bbe0
MATLAB
6,231
255
disp('The only input needed is a distance matrix file') disp('The format of this file should be: ') disp('Column 1: id of element i') disp('Column 2: id of element j') disp('Column 3: dist(i,j)') %Change the line below to match the actual file name mdist='s2cPROT_kept.dmtx'; xx=load(mdist); %Set upper and lower bounds ...
3e02fad4a44a102b845e413a52d53e8789e96ec3861a2bac57853acfbf050198
MATLAB
6,234
199
function V = tapas_uniqc_spm_create_vol_with_tr(V) % Create a NIfTI image volume % FORMAT V = spm_create_vol(V) % V - image volume information (see spm_vol.m) %__________________________________________________________________________ % Copyright (C) 2005-2014 Wellcome Trust Centre for Neuroimaging % John Ashbu...
31fbda9d99549ab3d36189241bd25da177dce8534e5561cba97e5c90f1a76e48
MATLAB
6,239
166
function TS_SingleFeature(whatData,featID,makeViolin,makeNewFigure,whatStat,beVocal) % TS_SingleFeature Plot distributions for a single feature given a feature ID % %---INPUTS: % whatData: the data to load in (cf. TS_LoadData) % featID: the ID of the feature to plot % makeViolin: makes a violin plot instead of overlap...
eb3ac46e28d338771bd8b097e89f99b73120d229ffbc0e99e270816287fbb784
MATLAB
6,240
174
% FLOATREAD - Read matrix from float file ssuming four byte floating point number % Can use FSEEK to read an arbitrary (contiguous) submatrix. % % Usage: >> a = floatread(filename,size,'format',offset) % % Inputs: % filename - name of the file % size - determine the number of float element...
f68abf18190e0a5825a05a0b9f7a1e73a849faf75bb470f132a6820faf227d40
MATLAB
6,243
155
function out = PP_ModelFit(y, model, order, randomSeed) % PP_ModelFit Investigates whether AR model fit improves with different preprocessings. % % After performing the range of transformations to the time series, returns the % in-sample root-mean-square (RMS) prediction errors for an AR model on each % transformed t...
5e9fb858324a73556ba41ed1dc3d53cd61a7145ab3b348102779359b622a65b1
MATLAB
6,244
160
%{ pre.SegmentMask (computed) # mask of a segmented cell -> pre.Segment mask_id : int # id of the mask ----- mask_pixels : longblob # indices into the image in column major (Fortran) order mask_weights : longblob # weights of the mask at the indices above %} classde...
f28d9e323e15fe8b4c992e909190076ff8108a74f3048416dc8766dd6b8bb89a
MATLAB
6,247
141
%VL_IMREADJPEG Load and transform images asynchronously % IMAGES = VL_IMREADJPEG(FILES) reads the specified cell array % FILES of JPEG files and returns at cell array of images IMAGES. % % IMAGES = VL_IMREADJPEG(FILES, 'NumThreads', T) uses T parallel % threads to accelerate the operation. Note that this is ind...
a3f8d81ee238fcfba8364db0297b87778b767f2aa04fd5afa9b04e540f51f984
MATLAB
6,253
170
function [ output_args ] = findCOREassemblies( spike_probability_raster , spike_probability_coactivity_threshold ) %FINDCOREASSEMBLIES( spike_probability_raster , spike_probability_coactivity_threshold ) % % % === Jan Moelter, The University of Queensland, 2018 =================== % %% > EXTRACT ENSEMBLES printConso...
523218fa27c3fb5387b8106e8f8ecf9ba4879276c2fc04a2ce37bfc1e1152557
MATLAB
6,255
159
clc, clear, close all; filepath = fileparts(mfilename('fullpath')); addpath(genpath(filepath)); % Select an example to run exampleID = 3; % 1, 2, 3, 4, 5 %% Example 1 % Research question: % - I have an imaging map (a nifti file) and a gene set. I want to test if % the imaging pattern correlates to the expression ...
f1508c8a8403b0bc860e679e70fb1ad8af9aed1d93177e444f40530d5269e3a6
MATLAB
6,256
210
function warp_HArtMuT_sources_iso2mesh( ... srcScalpFile, srcSkullFile, ... tgtScalpFile, tgtSkullFile, ... hartmutMatIn, hartmutMatOut, ... mean_pnt) %WARP_HARTMUT_SOURCES_ISO2MESH % Warp HArtMuT artefact source positions from a source head (e.g., NYHead) % to an individual target head using radial dep...
b253d3d188ab445eda781138e5267e11a19c945e7d2ba0503e7f15eed0d0f4b3
MATLAB
6,259
216
function [ output ] = tapas_rdcm_ridge(DCM, X, Y, args) % [ output ] = tapas_rdcm_ridge(DCM, X, Y, args) % % Variational Bayesian inversion of a linear DCM with regression DCM. The % function implements the VB update equations derived in Frässle et al. % (2017). % % Input: % DCM - model structure % ...
cd53e4a6f0c93e41f833896bd1e56356d33f7e9340f87f19f778d1e841446b62
MATLAB
6,260
149
function [data, timestamps, info] = load_open_ephys_data_faster(filename) % % [data, timestamps, info] = load_open_ephys_data(filename) % % Loads continuous, event, or spike data files into Matlab. % % Inputs: % % filename: path to file % % % Outputs: % % data: either an array continuous samples (in micro...
92530378a18d6b17ea4e312471a30b1c8c391058798e130e23ef1f15e9211dc5
MATLAB
6,261
136
%{ vis.Trippy (manual) # randomized curvy dynamic gratings -> vis.Condition --- version : tinyint # trippy version rng_seed : double # random number generate seed packed_phase_movie : longblob # phase movie...
334efb064017d990cc8a2251edb74e21030d327469bc09b4ddccf95813f1a5a8
MATLAB
6,264
161
%% plot tactile beta % from the mask fo indivudual ms ROi %% %settings for plots shape='.'; %%set the size of the shape sz=50; %%set the width of the edge of the markers LineWidthMarkers=1.5; %%set the width of the edge of the mean line LineWidthMean=4; %%set the length of the mean line LineLength=0.4; %the actual l...
639715b0ff1781fba0d330995954e66021a6b002ea8494b76df9a4f568299a98
MATLAB
6,264
146
function [map,stats] = FiringMap(positions,spikes,varargin) %FiringMap - Compute firing map (e.g. for a place cell, head direction cell, etc.) % % Compute firing map (e.g. for a place cell), as well as occupancy and spike % count maps. Optionally, field statistics can also be computed, including % in-field peak and...
e9fc698cd55c3da6b15dfae383196f277e928a13714cb5f33560ce12a32815a5
MATLAB
6,266
209
function [ subject, backup ] = nmri_backup_cleaning_marking(subject, params) %[ subject, backup ] = nmri_backup_cleaning_marking(subject, params) % % This function will create a backup file of the cleaning, marking and vigilance % scoring from one subject % Will use the dws-filt and cleaned/ICA-cleaned file to extra...
82b59be200079df772f59e82ebda3325129d06e87e9d05fef15ea0ca79639264
MATLAB
6,267
168
function res = hlp_varargin2struct(args, varargin) % Convert a list of name-value pairs into a struct with values assigned to names. % struct = hlp_varargin2struct(Varargin, Defaults) % % In: % Varargin : cell array of name-value pairs and/or structs (with values assigned to names) % % Defaults : optional list of n...
68bddc3be8a42c37bf9900173f5344bc2ad1420b8e2ae5547b0d5391198bc325
MATLAB
6,271
165
%% Use predetermined crop ROI parameters to crop a single image of the % calibration lframe We will use these % cropped images to determine view extrinsic parameters. clear % Load in the crop params basedir = 'D:\20191030\mouse9\calibration\'; numCams = 6; numPoints = 5; ext = '.tiff'; % Input the physical (x,y,z) dim...
82bddf12cecb81077941b5590cf15d91e089afc9b1cc9ab3e73f6640f6977d6c
MATLAB
6,271
149
%% DEMO4_RSAsearchlight_sim % simulates fMRI data for a number of subjects and runs searchlight % analysis using RSA, computes the similarity maps for each subject % and does group level inference. % demo of the searchlight analysis %%%%%%%%%%%%%%%%%%%% %% Initialisation %% %%%%%%%%%%%%%%%%%%%% clear;clc returnHere = ...
94ecd0bae90e096a5dd5e7756af27e0968ff6a62ce17f0e15efb58319eb04db6
MATLAB
6,273
198
%PRINT2ARRAY Exports a figure to an image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % [A bcol] = print2array(...) % % This function outputs a bitmap image of the given figure, at t...
b60a1081ea2f81387a673943698555c2f136d22e18f3299f0c9edc914935d251
MATLAB
6,275
180
function this = MrDataNd_shift_timeseries(this, verboseLevel) %Tests shift_timeseries using synthetic data (sine waves of different frequency % per slice) % % Y = MrUnitTest() % run(Y, 'MrDataNd_shift_timeseries') % % This is a method of class MrUnitTest. % It creates sine waves of different frequencies per slice...
689f6dc07f6a58917a82d8b322bb69d6820c6196913618d522215c02e7d342ec
MATLAB
6,278
108
function plot_communication_subspace_similarity close all clear all clc % Plot communication subspace similarity. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) % Control. load('population_regression_control.mat') mean_similarity_animal_session_control = population_regression_control.simi...
9fa33ce3296ca3e55aee7a162d11a07913372f12e64da8aa3f09136ef35c1f87
MATLAB
6,285
168
function varargout = TMSsphereROI_GUI(varargin) % TMSSPHEREROI_GUI M-file for TMSsphereROI_GUI.fig % TMSSPHEREROI_GUI, by itself, creates a new TMSSPHEREROI_GUI or raises the existing % singleton*. % % H = TMSSPHEREROI_GUI returns the handle to a new TMSSPHEREROI_GUI or the handle to % the existing ...
d0c2c76a563f3bffc9b7a1b51692ea5fbaa17fa480c0c5858e5bee3cda58d792
MATLAB
6,285
132
% dipfitdefs() - default settings and filenames for dipolefitting % to source in the ICA/ERP package functions. % Insert local dir reference below. % % Note: Edit this file to change local directories under Unix and Windows % % Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 % SMI, ...
860b480a528455fa2f0f8d436b3125f82dead0a37ac0a8a5fdd1e22399ebb614
MATLAB
6,287
194
% POP_COMMENTS - edit comments % % Usage: % >> EEG = pop_comments( EEG); % >> newcomments = pop_comments( oldcomments); % >> newcomments = pop_comments( oldcomments, title, newcomments, concat); % % Inputs: % EEG - EEGLAB structure % oldcomments - old comments (string or cell array of strings) % tit...
8541cb7bd4d985b018b10317fcb17f7df5d7eef74e03ef7d1a394de75fa44c56
MATLAB
6,290
191
% Morphology Enabled Dipole Inversion (MEDI) % [x, cost_reg_history, cost_data_history] = MEDI_L1(varargin) % % output % x - the susceptibility distribution % cost_reg_history - the cost of the regularization term % cost_data_history - the cost of the data fidelity term % % input % RDF.mat has to be i...
c948523a2c9b972147e361f44f7bc533850868c49c56a9d71ccbd4ee3283ce98
MATLAB
6,291
251
function [pval table] = circ_hktest(alpha, idp, idq, inter, fn) % % [pval, stats] = circ_hktest(alpha, idp, idq, inter, fn) % Parametric two-way ANOVA for circular data with interations. % % Input: % alpha angles in radians % idp indicates the level of factor 1 (1:p) % idq indicates the level...
41e26738699d1a4fcf63b19c30feed90faf9f8f0c77b4e223064f86e3eb93344
MATLAB
6,301
171
function bpa = tapas_bayesian_parameter_average(varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This function calculates the Bayesian parameter average for the individual estimates handed to % it. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
9972c66e5417d70fab82b2e584dcba28ec911359353e9f6cf15ce36bc55d6c89
MATLAB
6,301
172
function out = MF_armax(y, orders, pTrain, numSteps) % MF_armax Statistics on a fitted ARMA model. % % Uses the functions iddata, armax, aic, and predict from Matlab's System % Identification Toolbox % % ---INPUTS: % % y, the input time series % % orders, a two-vector for p and q, the AR and MA components of the model...
c13b961ba74a6836c9f2c997d985999cb70e48ddd9235c6062f4ee6f79c6954d
MATLAB
6,306
153
% plugin_getweb - support function to get plugin information from the web % Copyright (C) 2012- Arnaud Delorme % % This file is part of EEGLAB, see http://www.eeglab.org % for the documentation and details. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided th...
253bfc839a01708e2e3db24b3b5f969d8099e137a18159bee72adeab7065350b
MATLAB
6,307
168
function [w, A, C, sbc, fpe, th]=ARFIT_arfit(v, pmin, pmax, selector, no_const) %ARFIT Stepwise least squares estimation of multivariate AR model. % % [w,A,C,SBC,FPE,th]=ARFIT(v,pmin,pmax) produces estimates of the % parameters of an m-variate AR model of order p, % % v(k,:)' = w' + A1*v(k-1,:)' +...+ Ap*v(k-p,:...
57414df4b739fa7d4f0aff2e7b765351668ca24df19f39ab254bbf51f1f65008
MATLAB
6,307
176
% Main script for super-resolution reconstruction of diffusion MRI data using T1w guidance % % Reference: % Lee H, ..., Huang S, Communications Biology, 2026 % % Requirements: % - FreeSurfer installed and configured % - FreeSurfer recon-all completed for each subject % - FSL (flirt, fslmaths, convert_xfm) % - MRtrix3 (...
317d2c24cc80bd0b12a8f03ffe5d7bfa545b2aa087f5e22a241b0211d16060a9
MATLAB
6,309
209
function [ltom, htom, mtol, mtoh,... ltom_incong, htom_incong, sems, outmat] =... block_dynamics_latency(A, twin, smoothfactor, z_arg, varargin) %plot how latency changes around block transitions. cmc 7/16/21 %inputs: A struct- If given S struct, will convert it to A. % twin- ntrials around block transit...
fc632c25bd015a78dab4db313260feb32f8aa806a131e5c9f550bdc3ae848b66
MATLAB
6,312
217
%% Part 1 : Single Neuron close all clear all rng(1) % load('Z:\CLOOSE_benchmark_tests\Spine_imaging\DF_gcampspinebci04_000_006.mat'); % load('Z:\BCI\glusnfr_spine_bci\glusnfrbci4\Baseline\baselineMask_1.mat') % load('Z:\CLOOSE_benchmark_tests\Spine_imaging\ROIS_gcampspinebci04_000_006.mat') load('Z:\CLOOSE_benchmar...
73021efea23987b8f01f23521a1212d121af5c733b3673f57bb7430ccd698b6e
MATLAB
6,315
162
%************************************************************************** % % This is a simple extension of the bar plot to include error bars. It % is called in exactly the same way as bar but with an extra input % parameter "errors" passed first. % % Parameters: % errors - the errors to be plotted (extra...
4530da012f301c2384544c6100b5c01e65c6beaa5ff417965fc769859f0f3a9e
MATLAB
6,316
163
%% plot tactile beta % from the mask fo indivudual ms ROi %% %settings for plots shape='.'; %%set the size of the shape sz=50; %%set the width of the edge of the markers LineWidthMarkers=1.5; %%set the width of the edge of the mean line LineWidthMean=4; %%set the length of the mean line LineLength=0.4; %the actual l...
d36e1914cc1af039f2b6559563010d80fc14e467f9bd2b68bc6d2d9a3e87ec36
MATLAB
6,316
190
% Bang et al (2020) Private-public mappings in human prefrontal cortex % % Reproduces Figure 4-figure supplement 1 % % "Private confidence" is computed by training multinomial regression on % data from prescan session and then applying weights to data from fMRI % session while setting context weights to zero % % Visual...
5f97d06ee6a1180a8c100bcaa2a4720d1caed9aa0f8599438faaf0e9b3a35bda
MATLAB
6,319
196
% POPHELP - Same as matlab HTHELP but does not crash under windows. % % Usage: >> pophelp( function ); % >> pophelp( function, nonmatlab ); % % Inputs: % function - string for a Matlab function name % (with or without the '.m' extension). % nonmatlab - [0|1], 1 the file is not a Matlab file %...
a0cb0e2c97fc7bd60e111095a3c2cc3a7e4dd18a2e31da50874055c16848a89a
MATLAB
6,319
194
function M = multinomialfactory(n, m) % Manifold of n-by-m column-stochastic matrices with positive entries. % % function M = multinomialfactory(n) % function M = multinomialfactory(n, m) % % The returned structure M is a Manopt manifold structure to optimize over % the set of n-by-m matrices with (strictly) positive e...
dce150a153a1cc73402a272c7a48de94fcd012faad008646b79a5dbb9a1686e9
MATLAB
6,320
177
function [ obj ] = mh_init( obj ) % Initialize Markov chain state for Metropolized Gibbs sampling. % Requires obj.dcm and obj.prior to be intialized. % % This is a protected method of the tapas_Huge class. It cannot be called % from outside the class. % % fMRI forward model obj.options.fncBold = @bold_gen; %% prio...
66e97fea1f8f2be5850cdbda5a712c0c9eb86b5af521c1fc7e7494436a2b1bc9
MATLAB
6,323
216
%% h = sepia_handle_panel_swi(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 structure c...
cc0fe1077cdbdff974b5f2145e84ba15a3018b5c3b96918915e78bc4359883aa
MATLAB
6,325
141
classdef circularGraph < handle % CIRCULARGRAPH Plot an interactive circular graph to illustrate connections in a network. % %% Syntax % circularGraph(X) % circularGraph(X,'PropertyName',propertyvalue,...) % h = circularGraph(...) % %% Description % A 'circular graph' is a v...
6913c0b7f731f9f56e829d215c3ddf73f82eefa17d7445aa373a2838d7b02c7a
MATLAB
6,328
159
% DFTFILT2 - discrete complex wavelet filters % % Usage: % >> wavelet = dftfilt2( freqs, cycles, srate, cyclefact) % % Inputs: % freqs - frequency array % cycles - cycles array. If one value is given, all wavelets have % the same number of cycles. If two values are given, the % two ...
9a0b2dfcd85c5321dbb835fdc0a225f8ceafe9a1584a70da16d738d09c04574e
MATLAB
6,328
185
% fit_makeSplineBasis.m % Georg Oeltzschner, Johns Hopkins University 2020. % % USAGE: % [splineArray] = fit_makeSplineBasis(dataToFit, fitRangePPM, dkntmn); % % DESCRIPTION: % This function creates an array of cubic baseline spline functions, which % serve as a basis set for the LCModel baseline computation. % % The ...
83f09582be5df7effd604bf40097b1ee775ab96ef79a5d1a92b0344366b3a4c2
MATLAB
6,329
170
function [y, lambda, info] = hessianextreme(problem, x, side, y0, options, storedb, key) % Compute an extreme eigenvector / eigenvalue of the Hessian of a problem. % % [u, lambda, info] = hessianextreme(problem, x) % [u, lambda, info] = hessianextreme(problem, x, side) % [u, lambda, info] = hessianextreme(problem, x, s...
e5e9c473ff960b944cb6c0665f1be3b5e5e1aac8865acfc60ba3d745cc2c9e4e
MATLAB
6,329
117
% POP_DIPPARAMS - Set plotting parameters for dipoles. % % Usage: % >> STUDY = pop_dipparams(STUDY, 'key', 'val'); % % Inputs: % STUDY - EEGLAB STUDY set % % Optional inputs: % 'axistight' - ['on'|'off'] Plot closest MRI slide. Default is 'off'. % 'projimg' - ['on'|'off'] lot dipoles projections...
c697c58f15d9ac0237a99ecb5d3509236d2370630e39ca28376331616f312828
MATLAB
6,333
198
function run_permuttest_examples %RUN_PERMUTTEST_EXAMPLES Run paired permutation t-test examples. % Generates random multivariate data for 2 "dependent" samples X and Y. % Each sample has 20 variables, each with a mean value of 0, except for % the first 10 variables of Y which have a mean value of -1. Each % v...
366fc28594cf20d1f908146cba13613bca7e472791e58c2b89d21ced08dc035f
MATLAB
6,334
208
function [BCMatrix, BCRHS] = boundaryCondition3D(BC) % It creates the matrix of coefficient based on the BC structureprovided % by the user. It also generates the right hand side vector of the linear % system of equations % % SYNOPSIS: % [BCMatrix, BCRHS] = boundaryCondition3D(BC) % % PARAMETERS: % % % RETURNS: % % %...
863daef4f6428d9d5a50ccef28f417a69e280fadc7ee72015aea914811e50dd3
MATLAB
6,334
127
%% ============================================================ % Main burst analysis script % ============================================================ clear all; close all; clc; %% ============================================================ % Set parameters and import data % ==============================...
cf7f76decfd66bf4bb506be910e5cbac10b93a2affe0955bd6dd761cd9c85252
MATLAB
6,334
189
function M = grassmanncomplexfactory(n, p, k) % Returns a manifold struct to optimize over the set of subspaces in C^n. % % function M = grassmanncomplexfactory(n, p) % function M = grassmanncomplexfactory(n, p, k) % % Complex Grassmann manifold: each point on this manifold is a collection % of k vector subspaces of di...
7208b0b4ec00dc84d9c6799ecabd009df12513fe716440e2d043207465737c5b
MATLAB
6,335
167
function ISInTh = getISInTh(SpikeTimes, N, Steps, plotFig) %GETISINTH Returns the threshold to use for BurstDetectISIn.m % Tim Sit 2018 % Based on HistogramISIn.m by Douglas Bakkum, 2013, but automatically % returns the result rather than having to eyeball it, and uses a freely % available (and perhaps m...
6f76021be9973199db840078c6bb7034dca1adbd973b72f08e2c10757ae66009
MATLAB
6,339
155
function G = crossvalIPMraw(Y,SPM,conditionVec,varargin) % function dist=rsa.spm.crossvalIPMraw(Y,SPM,conditionVec,varargin); % First, gets the regression coefficent from the SPM, and prewhitens them. % Prewhiten can be controlled using different methods (run-wise or overall). % The same code is used in rsa.spm.noiseNo...
acdf282eb5bb367bdb0f4eecd51b91532e4bd5fe80f17a834e3e6158812ac165
MATLAB
6,339
160
function plot(segStream,cfg,varargin) % Plot the contents of a McsSegmentStream object with spike cutouts. % % function plot(segStream,cfg,varargin) % % Produces for each segment a 3D plot of trials x samples and a time series % plot which overlays all trials. % % Input: % % segStream - A McsSegmentSt...
455caeff4dfb16cbbc9ca15acc5e2a0f1eb3d1e50cde830f050539b6dadb54ce
MATLAB
6,341
163
function out = PH_ForcePotential(y, whatPotential, params) % PH_ForcePotential Couples the values of the time series to a dynamical system % % The input time series forces a particle in the given potential well. % % The time series contributes to a forcing term on a simulated particle in a: % % (i) Quartic double-wel...
ed2e237204a8055784a58944fe6aa72dd7aebb3a65384a8ed6e8b6260958ad7d
MATLAB
6,341
174
function [rpulset, verbose] = tapas_physio_filter_respiratory(... rpulset, rsampint, cutoff_freqs, despike, normalize, verbose) % Preprocesses respiratory data % % Key steps % + Remove NaNs and outliers % + Optional: Despike with sliding-window median filter % + Detrend at `cutoff_freqs(1)` Hz % + Remove no...
ff7d74ae84a99b0d11897008aa97f85503445334452d359944bff42a02e95dd0
MATLAB
6,344
226
function plotFigureS1_rawWTexperts(processedBehaviorPath) %Plot figure S1 - raw wait time block transition dynamics for expert rats % and inference model predictions % YOU MUST RUN processBehaviorData BEFORE RUNNING THIS FUNCTION %INPUTS: % processedBehaviorPath = path to where you have saved the outputs from % ...
bad747e7c99d7e7156ee7eb97ca666126a4f63a1947b6430110f02d0d1aa371c
MATLAB
6,345
133
function [STA, coherenceCurve, STA_shuff_mean, STA_shuff_SD, coherence_shuff_mean, coherence_shuff_SD] = HI_calc_coherence(spkTimes, inputSignal, Fs, windowSize, iterations, plotFlag, varargin) switch nargin case 8 minFreq = varargin{1}; maxFreq = varargin{2}; case 7 error('Only one inp...
9354bab55ba259283d6f9fdc86bb79c56ad52e30538e74257a64d56a43e25cf5
MATLAB
6,350
157
function [dWU] = Template_building(DATA,ops) [NT, Nchan ,Nbatch] = size(DATA); Nfilt = ops.Nfilt; % Deleted the option to choose from data or not, now only fromdata. % thus, the initiale template will always be calculated from the data. if(ops.template =='Y') % dWU0 = load(ops.template_file); load(ops.tem...
0d4841f36227942fac5ab0c4b865966d2c79fe7bf3422cd292de7a3b9521a9ab
MATLAB
6,353
141
%{ vis.Matisse2 (manual) # conditions for the moving matisse stimulus -> vis.Condition --- -> vis.Matisse2Cache pre_blank_period : decimal(5,3) # (seconds) duration : decimal(5,3) # (seconds) pattern_width : smallint # pi...
6a84e528aa384dfbee9c19dfa7ddb7978c11f2fd102806200506ec9802605744
MATLAB
6,353
141
% CORRECT_MC - compute an upper limit for the number of independent % time-frequency estimate in a given time-frequency image. % This number can be used to correct for multiple comparisons. % % Usage: % [ncorrect array] = correct_mc( EEG, cycles, maxfreq, timesout); % % Inputs: % E...
b0aca9a73820c721d7d698f0edd46ae208cee5d49d0029d99b0ce0646a78175b
MATLAB
6,356
156
function out = CO_TranslateShape(y, shape, d, howToMove) % CO_TranslateShape Statistics on datapoints inside geometric shapes across % the time series. % % Inputs specify a shape and its size, and a method for moving this shape % through the time domain. % % This is usually more informative in an em...
c2c6fd06f1ef5c76b8b690329b0618d2906b8dd6069e551ed09393aa3c98a128
MATLAB
6,356
148
function [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Multi-taper time-frequency spectrum - point process times % % Usage: % % [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr) % Input: % data (structure array of spike times with dimension channels/trials; % also ...
57827f58c476c33de81fe2543c07f2a82b69dcc05bf8f795d6fd6eba61d0e8e1
MATLAB
6,361
204
function [x, E, s, lambdamax] = ML_l1pwc(y, lambda, display, stoptol, maxiter) % Performs discrete total variation denoising (TVD) using a primal-dual % interior-point solver. It minimizes the following discrete functional: % % E=(1/2)||y-x||_2^2+lambda*||Dx||_1, % % over the variable x, given the input signal y, acco...
c3a8d8c2ef11725a14f90aba3daabd6b06c85ef0d89548554f463fb68f614ba9
MATLAB
6,362
186
function [headmodel] = ft_read_headmodel(filename, varargin) % FT_READ_HEADMODEL reads a head model (or volume conduction model of the head) from % various manufacturer specific files. Currently supported are ASA, CTF, Neuromag, % MBFYS, MATLAB and SimNIBS. The volume conduction model is represented as a % structure w...
4d486dc2f975b26c14982699fb73a521684e9dfec88b1052d706533e7d89b4a3
MATLAB
6,363
111
%% Plot the beta parameters from a ROI % spherical functional roi % use subject masks - lS1, lPC, rPC, lMTt, rMTt, lhMT, rhMT % from TACTILE MOTION LOCALIZER % take the avg of beta values from the roi % example (1)lS1- motion_beta and (2) rS1 -static_beta % across two runs %% extract beta estimates from TML task a...
9873110e2ac43345b56445b9202815a5b231d8a30ca96c491ca4331fcbc7b3ef
MATLAB
6,363
201
function [h,a] = PlotDistribution2(var1,var2,varargin) %PlotDistribution2 - Plot bivariate data along with respective distributions. % % USAGE % % [h,a] = PlotDistribution2(var1,var2,<options>) % % Using cell arrays will overlay variable pairs. % % var1 variable 1 % var2 variable 2 % ...
876862481ce6ae78eeea05e9fafd63a33284b7c012e0509f3740e869cc3a5ad7
MATLAB
6,371
155
% EEG_SELECTSEGMENT - Select a data segment % % Usage: % OUTEEG = eeg_selectsegment(INEEG, 'key', val) % % Input: % INEEG - input EEG dataset structure % % Optional inputs: % 'timeoffset' - [2x float array] beginning and end in seconds. For example % 'timeoffset' of [0 1800] selects the fi...
b7bd389e6e5f12f0cc4f13fa4118ea19394a4bd730fedf7a5d25e1ac8e5fdeec
MATLAB
6,371
156
function firstlevel_main() % Representative Figure 3 first-level model for sub-001. % Edit USER SETTINGS, then run this function. %% USER SETTINGS rootDir = 'D:\path\to\MRI_project'; behRoot = 'D:\path\to\behavioral_results'; spmDir = 'C:\path\to\spm'; subName = 'sub-001'; emID = 'em0001'; nRuns = 4; TR = 0.8; deri...
45712402d3aa5378b92e34c7f659982bf8e948d14fc6706613444265242dd798
MATLAB
6,372
197
function styleOptions = setPlotStyle(styleName, varargin) % SETPLOTSTYLE Set consistent plot styling for different publication types % % Syntax: % opts = setPlotStyle(styleName) % opts = setPlotStyle(styleName, 'Name', Value, ...) % % Description: % Configure plot styling for different publication formats. % % In...
6a33bed5098701e79c0d2ef81fc1ddd06f338a7d615de920f24fa2e0901b1417
MATLAB
6,372
180
%% SetupForceSettings.m 08/12/2020 Julia Becker % This script creates .force-settings files for the JPK software which % allow to automatically read in and/or alter AFM measurement settings % during an AFM experiment. % CAVE! You need to have calibrated your cantilever before running this % scrip...
ec54f79f651c836449e2e5422be4edf9d737789ee1b2a309de7ba94c8c540f6b
MATLAB
6,373
187
function fear_icaCoactTrigLFPaverageHighThreshold_shuffle(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115' % basename='~/data/Fear/triple/karmeliet190901/karmeliet190901'; load([basename '.basicMetaData.mat']) fprintf('\n%s start %s with data of %s\n',datestr(now),mfilename,basicMe...
066abf5955e239fa1352e4416a04859ec345fcf24b34f92d21e1450c9a677d94
MATLAB
6,382
208
function [p,F] = CircularANOVA(angles,factors,method) %CircularANOVA - One or two-way ANOVA on circular data. % % Circular ANOVA can be performed using one of three methods with different % assumptions and limitations: % % 1) Watson & Williams (1956) % The data are drawn from von Mises distributions with ...