sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1bf3395daf261aeb2b85154581de745d7b6a3a40ed86081a8de7b84df379e150
MATLAB
8,589
206
function [cfg] = ft_definetrial(cfg) % FT_DEFINETRIAL defines the segments of data that will be used for % further processing and analysis, i.e. the pieces of data that will % be read in by FT_PREPROCESSING. Trials are defined by their begin % and end sample in the data file and each trial has an offset that % defines...
d1bc1a572b82405487a3ed4d5e8acd72f1f664a57aaa85ce4dac3929c0ea90a1
MATLAB
8,592
215
function ft_select_channel(handle, eventdata, varargin) % FT_SELECT_CHANNEL is a helper function that can be used as callback function % in a figure. It allows the user to select a channel. The channel labels % are returned. % % Use as % label = ft_select_channel(h, eventdata, ...) % The first two arguments are auto...
9f2efdbeeee31d4ea87213cdafc41818b1651a7169b6a54b490e14139170a94c
MATLAB
8,593
210
load(fullfile(dipole_folder, strcat(patno,'_',model_name,'_',dipole_name, ... '_output_charge_solution'))); %% load additional colormaps addpath(fullfile("../engines/Colormaps")); %% XY transverse cross section % Prepare plane data planeABCD = [0 0 1 -Z]; % Equation of the plane of the cross-section...
44c6007fdd23aa481a9b31eb7134a54235b6f6034c399e191d2f0d8ea1b4b601
MATLAB
8,594
223
function SelectTrackingAlgorithm(varargin) % SelectTrackingAlgorithm(lObj,hPar) % GUI for selecting a deep learning tracking algorithm. After % selection, it will create a new tracker with the function % lObj.trackMakeNewTrackerGivenNetTypes(nettypes) if nargin == 2 && isa(varargin{1},'Labeler'), lObj = varargin{1}...
68406a6ba2d3a22d3ac8bde45056567d2e3902b410c623d693751c6b0e9d2196
MATLAB
8,594
217
function [spikes] = bz_LoadPhy(varargin) % Load kilosort/phy clusters % % USAGE % % [spikes] = bz_loadPhy(varargin) % % INPUTS % % basepath -path to recording (where .dat are) % kilosort_path -path to kilosort* folder after phy curing (by default % .\kilosort_\) % getWaveforms -logical (...
c85bd9fa2a3156ea140ff9a15eddfa9890880587dd224e97d2101a4eaef37ef0
MATLAB
8,595
150
format compact; Int_main_folders = ''; % main working directory ShortNames = {'R1_6hr','R1_24hr','R1_72hr','R2_72hr','R2_24hr','R2_6hr'}; Int_Results_folders = {}; % folders to save the results Int_RawImage_folders = {'Folder1', 'Folder2', 'Folder3', 'Folder4', 'Folder5', 'Folder6'}; % Raw Tiff image folders for...
0e8a4870dcd68eb527e385e1cdc04fb501bec72dd2aca2046a2ea0a32730d227
MATLAB
8,598
215
function ft_select_channel(handle, eventdata, varargin) % FT_SELECT_CHANNEL is a helper function that can be used as callback function % in a figure. It allows the user to select a channel. The channel labels % are returned. % % Use as % label = ft_select_channel(h, eventdata, ...) % The first two arguments are auto...
335c94a64048babdde4b0cda9bdf799c29b874cd5152884035faa2b29a08d2b9
MATLAB
8,601
200
function lambdas = hessianspectrum(problem, x, usepreconstr, storedb, key) % Returns the eigenvalues of the (preconditioned) Hessian at x. % % function lambdas = hessianspectrum(problem, x) % function lambdas = hessianspectrum(problem, x, useprecon) % function lambdas = hessianspectrum(problem, x, useprecon, stor...
f35e9ffc5f0d7d6dcdcf639d97b77003e409ff7baf903bf46626c5c4ef820493
MATLAB
8,603
192
function varargout = DPABINet(varargin) % DPABINET MATLAB code for DPABINet.fig % DPABINET, by itself, creates a new DPABINET or raises the existing % singleton*. % % H = DPABINET returns the handle to a new DPABINET or the handle to % the existing singleton*. % % DPABINET('CALLBACK',hO...
116e65806bfe37894bdd41aa1ad22c207e4f61cea01737a72ab49aa317ec7a11
MATLAB
8,605
247
function [ACC sensitivity specificity avg_SNR] = harmonic_osc_simulation_TACC_v5(sim_param) warning('off'); ACC = []; sensitivity = []; specificity = []; %% simulation details for this video srate = sim_param.srate; % sampling rate in Hz time = -1:1/srate:4; pnts = length(time); osc_amp = sim_param.osc_amp*2; ...
e744c81cf0137052959f816fdcc23cdcbf235b56638ada2604e2d6394fe8788b
MATLAB
8,606
212
%% Split NIFTI volumes by major region boundaries % be aware that neighboring labels will be included as this is just copying a bounding box % this will include some duplication of labels as well as bstem, and hc % will have labels from the ctx; cereb will have some labels from bstem % etc.. vol = niftiread("T:\...
6dc91d849c4ad5d0013d4db6750a4c5861f804d6abab0fb24f5bbd8948282258
MATLAB
8,619
202
function network = create_network(modelParam, varargin) % network = create_network(modelParam) % % Generates the network structure. % % Inputs: % - modelParam: Structure containing model parameters % % Optional: % - seed: random number generator seed % % Output: % - network: The network structure for a given net ...
ed43ecc8db7c5956b16f6313d146ae49bc09514571d03e68eff97de8c2d48c56
MATLAB
8,620
231
% Optional 4th step of the multivariate moderation model framework %%% Bootstrapping on the voxels' moderation (CR) coefficients %%% % The idea is to reduce the fMRI contrast in the chosen voxels to a number % of principal components and use them in a multivariate regression. The % regression weights are then be map...
9db0a5c3e578b06e38e74c6058ce6460f1720da3630704d0a6eb08aa307692ca
MATLAB
8,622
281
function [ CF ] = Cost_Function (xopt) NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat'); NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial; G = 4; % Muscle Group Number (G = 1 to 9) MotionData = load('MotionData.mat'); MotionData = MotionData.MotionData; % 40 Mu...
b9877f49dfb244d1924f734b92e1cc6c5a339e45396f421759fee94870015250
MATLAB
8,622
259
function [results]=VBA_Shapley(posterior,out,varargin) % [results]=VBA_Shapley(posterior,out,[options]) % % Compute the Shapley values of the model's factors (inputs or paramters). % These scores measure the relative influence of these factor on the variaince % explained by the model. % ------------------------------...
140e412bc0a3f0921f43105d06804fc9f3a1191c096f4a803e1f099ab3d65f8e
MATLAB
8,629
256
function [eout,thresh] = coloredge(a,varargin) %COLOREDGE Find edges in intensity image. % EDGE takes a color image I as its input, and returns a % binary image BW of the same size as I, with 1's where the function % finds edges in I and 0's elsewhere. % % COLOREDGE uses the Canny method for edge detection: %...
814955838b27e6da36197c30ff0c1ed2abe170a0ca9f6933c6191cd4d1871f30
MATLAB
8,630
210
% Second-kind integral equation on the unit sphere, Laplace double-layer. % % This example solves the Dirichlet Laplace problem on the unit ball by using a % double-layer potential, which yields a second-kind boundary integral equation % on the unit sphere, represented using flat triangles. The system is % discretized ...
14629f8be720d3770907ba553790fe46e325c6f183ca8c4a55f7b5f99879f331
MATLAB
8,633
273
function [flags,keyvals,varargout] = SOFAarghelper(posdepnames,definput,arglist,callfun) %SOFAARGHELPER Parse arguments for SOFA % Usage: [flags,varargout] = SOFAarghelper(posdepnames,definput,arglist,callfun); % % Input parameters: % posdepnames : Names of the position dependant parameters. % definput...
414012777ce690695c152e518e65356926dbf03c756e17858dfd72c35423c544
MATLAB
8,637
218
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math/Statistics: Connor Meehan <connor.gw.meehan@gmail.com> % Guenther Walther <gwalther@stanford.edu> % Primary inventors: Wayne Moore <wmoore@stanford.edu> % David Parks <drparks@stanford.edu...
df5adf44f94b53f1ef5ce0329df6c7209d6ea8f336e3836d621caa9c949e3184
MATLAB
8,637
229
function low_rank_matrix_completion() % Given partial observation of a low rank matrix, attempts to complete it. % % function low_rank_matrix_completion() % % This example demonstrates how to use the geometry factory for the % embedded submanifold of fixed-rank matrices, fixedrankembeddedfactory. % This geometry...
f9b1c3d6ec9928a60026ea2b25f23dfd5f2e07146e7e689caab503b7583115d8
MATLAB
8,640
189
clear; %% % This script creates ten files: In current directory (can move them % later) % 1) significat network for group1 (matlab data file) % example: patients_group_13-29Hz_signetwork_cerebellum.mat % patients_group_<freq>_signetwork_<network>.mat % 2) significat network for group2 (matlab...
83f2397336c33f29962bc9fb397d736874c8462b381c56aa410622f7101e25e5
MATLAB
8,647
212
function [X_rows, X_cols, F_rows, F_cols, N_rows, N_cols] = fdct_wrapping_param(C,M,N) % fdct_wrapping_param.m - Gives the location of each curvelet in phase space % % Inputs % C Cell array containing curvelet coefficients (see % description in fdct_wrapping.m) % M, N Size of the ori...
46a831a8d48d90b2a4bd7cb6d35b64da7524301a77ad15c9965650d98622c0be
MATLAB
8,652
212
function GonzalezPereyra_etal_Fig_07 Color_300=[3 168 158]./255; Color_500=[0 85 212]./255; ThisColors=[repmat(Color_300,5,1);repmat(Color_500,5,1)]; newColors=[Color_300;Color_500]; %load /Users/pavel/LocalDocuments/Data/MiceRecordings/Data_GonzalezPereyra_etal_Fig_07.mat %#ok<*LOAD> load ([pwd '/Data_Gonzal...
0352af4b8c3622cb6b3c71d23f8fa0d8d430e910215291f69a8ae566969df7ee
MATLAB
8,656
256
function [eout,thresh] = thresholdBSE(a,mag,varargin) %COLOREDGE Find edges in intensity image. % EDGE takes a color image I as its input, and returns a % binary image BW of the same size as I, with 1's where the function % finds edges in I and 0's elsewhere. % % COLOREDGE uses the Canny method for edge detec...
9289eeff615bb0d2b5399b48abf3073b8127708a0218f8589764a5b79a0efa1c
MATLAB
8,657
266
function PlotFigure3(timelock) % plot mean ERP, difference waves, diff-difference waves % mean ERPs, indiv-pp mean ERPs, and regressions of means vs beh, a if nargin==0 timelock = 'Figure 3 - Source Data 1.mat'; end if regexp(timelock, '.mat') % try loading this as a file name data...
a02de3d09aaf1b277fb51263b73c1f4913d95a12a7c2f2962ff2e8f05dd9f56c
MATLAB
8,661
235
% Author: Daniel J. Beall % Email: DJBEALL1101@gmail.com % % beall_horizontal() - Returns list of ICA components marked with % horizontal eye movement % % Usage: % >> [horizontal] = beall_horizontal(cwb,topog,chanlocs,n); % % Inputs: % cwb - list of components with bumps % t...
5cec234bfa1fa2a41ab541ff06e51511bd03dfbaf58646b415d8448ca11964f4
MATLAB
8,664
253
function corr_mat_parcelOrder = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_thresholded(corr_mat_row, ... scalelim, filename_prefix, blk_indices) % corr_mat_parcelOrder = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_thresholded(corr_mat_row, % scalelim, filename_prefix, blk_indices) % % Plots thresholded 419x419 matri...
45dce03296a78424d056498466e5f69dbd479aa0a59cfcf0a726cadee7a1ddbf
MATLAB
8,665
231
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % To get the 2d coordinates of EMG channels over the grid % To check the EMG signals (automatic or visual) % Input: % signal: row-wise signal % gridname: name of the OTB grid of electrodes % check EMG: 1 = Visual checking of EMG channels % O...
c2ceadedbf1e3ad3aecbcba9638e14a5978484568393c7eea61a6c0b80246493
MATLAB
8,669
241
function [stats,st] = lme_mass_fit(X,Xcols,Xrows,Zcols,Y,ni,prs,e) % [stats,st] = lme_mass_fit(X,Xcols,Xrows,Zcols,Y,ni,prs,e) % % Location-wise linear mixed-effects estimation. Allows to have different % models across locations (this is useful when there are either missing % values at some locations or the number o...
cee03793c6f8f1bf82ef90b8d02b7acdefd184e5e9163e7f2c4095ccaeb7320d
MATLAB
8,671
208
% Author: Birgit Nierula % nierula@cbs.mpg.de function esg_preprocessing_loops(loop_number, subjects, conditions, srmr_nr, sampling_rate) switch loop_number case 1 %% loop 1: prepares data % loads raw bids data % removes stimulus artifact % downsample to sampling rate of R-pea...
7a73ae51392ffc56e5fec314c9062097b55ef4d9e7ec4afc6b8ce42f4492fd83
MATLAB
8,676
303
function varargout=sigstar(groups,stats,nosort) % sigstar - Add significance stars to bar charts, boxplots, line charts, etc, % % H = sigstar(groups,stats,nsort) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The user specifies the groups a...
1944343770d1dcc862451eb4df35b3f96298f449f41865dee55bd1015c95c2a3
MATLAB
8,681
213
function data = load_microscopy_file_FramesCut() %%%%%% file type can be either "bin", "locb" or "csv". %%%%%% example: data = load_microscopy_file('bin'); %%%%%% example: data = load_microscopy_file('locb'); %%%%%% example: data = load_microscopy_file('csv'); [file_names,path] = uigetfile({'*.bin;*.locb;*.csv'},'...
df35ee12e3953acfd299b90a8fb0002a43d961ed9c7571ac90c199edbc27674b
MATLAB
8,684
168
function [glob_avg1,glob_avg2,glob_avg3,glob_avg4,glob_avg5,glob_avg6] = assembly_trig_avg_pool (traces, pyr_id, int_id, si_img, TRace, RasterRace, CellCl, PCl, C0) windowSize = 200; %in frames x = -windowSize/2:1:windowSize/2; n_int_in_assembly = sum(sum(CellCl(:,int_id))); pyr_out_assemblies = intersect(pyr_id,fi...
02ce47d3ffbd4d59b8a86a5ef5c55d6bd5068d0611f6a82d83de698bb3bb9757
MATLAB
8,685
274
function plotBrain(regions, values, cm, varargin) % PLOTBRAIN Create simple line-art SVG brain plots. % % PLOTBRAIN(REGIONS, VALUES, CM) creates brain plot with regions having % colors as specified by the REGIONS and VALUES vectors with a colormap % defined by the matrix CM. Colormap CM can have any number of rows, but...
4e2ff054ad8e249f7b7639bda4f13194df93f5fbc27377ab5ef719e1ef49a1ac
MATLAB
8,687
188
function [EEG,com] = pop_detect_spindles(EEG) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Detect Spindles in EEG data % % INPUT: EEG = EEGLab structure % PARAM = structure of parameters (see below) % % OUTPUT: EEG = same structure with spindle markers (EEG.event) % ...
4411c978ac13bf064ca199890f8af7be3202de8c8d2106260575648e2e15231e
MATLAB
8,689
193
%% Sort data based on the cue and stimulation in each trial function [ xhat, xhat_] = SortData(data, dataType) % Sort data based on the cue and stimulation in each trial and store in two % structs, xhat for perceived pain and xhat_ for expected pain. Each struct % has fields for different conditions: % If dataType = ...
0eed742cf2935b5497fbe61ff1329d572e5f6093fc2d8012212c51ab8bfc63fa
MATLAB
8,711
230
%% pxTools_getTrialwisePxt % Generates probability distributions from the supplied timeseries % data cell ('xtDataCell'), using the queried time points and parameters. % Used for multiple-comparisions/extractions. Not optimial for single % comparisions % % PREREQUSITE: xtDataCell has been processed by 'createXtStateMap...
77c1d5a6edf47fb902fc8e71cd44921e5ae5296e41ecf8668a8b551940f13745
MATLAB
8,716
229
function subjExtractedTimeSeries = getBadVols(eyeClosureFile,TR,subjExtractedTimeSeries) %SETBADVOLS This function identifies indices of "bad volumes" as determined %by eye closure onsets % EDIT BY PNT 06/23/23: implemented cleaning and merging eye closures %Rules: % 1. In SBU data, if the eye clo...
9c8383cc34c885bbbe89b81dacee49ac29978ea79b9e79b32577483528bdb681
MATLAB
8,724
322
function spm_movie(Action,Orient,F,p,nloops,mode) % Runs a movie of a plane from a series of images % FORMAT spm_movie % % This is a simple command-line utility which you can use if you % wish. % % The movie can be displayed as transverse, coronal or sagittal % in movie mode or slider mode which allows slide selection ...
7905ef60dc7424661b8826f2d7c24e03ec2dccd6a4ba63b63b7172db66495fc1
MATLAB
8,726
274
%PMTKauthor Jarno Vanhatalo % Same as demo_spatial1 from GPstuff-2.0 except % we only run Laplace, not MCMC, for speed %DEMO_SPATIAL1 Demonstration for a disease mapping problem % with Gaussian process prior and Poisson likelihood % % Description % The disease mapping problem consist of a dat...
367140901fa6f6aaca7d212dd46daa71675a4c55077cb3507eeef150399f8cfe
MATLAB
8,729
308
function SPT_analysis_entries_Ca(basename) miniscope_data=load([basename '_Test.mat']); fs3=20; temp_fields=fieldnames(miniscope_data); % if length(temp_fields)==1 % miniscope_data=miniscope_data.data; % end traces = miniscope_data.AllData; FR2 = traces; trk = load([basename '_Test_trk.mat']); ...
eb11302b7ef30ac42d0fbecbc5b216e620dfb85fb623d207feccdb1fd1984af2
MATLAB
8,733
343
function wlPlot_plotMatrixErrorStats(cfg, serieslist, figtitle, filelabel) % function wlPlot_plotMatrixErrorStats(cfg, serieslist, figtitle, filelabel) % % This function creates bar plots and scatter-plots of specified error % metrics for a specified series of event matrices. % % Bar plots show a histogram of event co...
b630d665ca78c6c8da0198387ff9876bbe4bbf28ac2153225f25680888e1dc25
MATLAB
8,734
203
% boney_eval_readCSV. Read and evaluate CSV files to setup parameters. % % _________________________________________________________________________ % % Robert Dahnke & Polona Kalc % Structural Brain Mapping Group (https://neuro-jena.github.io) % Departments of Neurology and Psychiatry % Jena University Hospital % ____...
0a8d09d9bd86a2dcc7b335ea56aae94e6cf20aaa72976514b838ab299557405c
MATLAB
8,735
221
%%Open tiffs of separate channel stacks to show mult-color max projection. %%This script assumes that each channel is separated into it's own stack %%and is in .tiff format. This script is formatted for 3 channels %%currently, and can be adjusted to fewer or more channels if desired. clear; file0 = 'filename'; %Enter ...
f77bbda5d1a61ec2e0b2b8714e5e405ff5b69e3e8b4ac7369b3ab67c0d30cde6
MATLAB
8,742
223
function varargout = w_ApplyVertexMask(varargin) % W_APPLYVERTEXMASK MATLAB code for w_ApplyVertexMask.fig % W_APPLYVERTEXMASK, by itself, creates a new W_APPLYVERTEXMASK or raises the existing % singleton*. % % H = W_APPLYVERTEXMASK returns the handle to a new W_APPLYVERTEXMASK or the handle to % t...
12234175ba58b9a56a7d75de6fb83acac09113d8b8eebd58643813de42e20d79
MATLAB
8,744
307
function varargout=sigstar(groups,stats,nosort) % sigstar - Add significance stars to bar charts, boplots, line charts, etc, % % H = sigstar(groups,stats,nsort) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The user specifies the groups an...
b89f1d890653c3a4eeb5cd61f363d06b6fc29ce257bb291dc0e3a57339fb1bb5
MATLAB
8,746
297
%% Overview % % Here we load in our source parcellated MEG data from the preprocessing stage, % perform some normalisation and compute an Time-Delay-Embedded HMM. % config = utils.get_studydetails; %% % Find preprocessed data files datapath = fullfile( config.analysisdir,'spm_sss_processed' ); s = study(datapath,'Gi...
602c20f7207905561a044217623e81b7434013e23e4d78f99658d85943dbb966
MATLAB
8,748
260
% Author: Birgit Nierula % nierula@cbs.mpg.de function figure_stackedplot_seps(condition, srmr_nr, subjects) % set path savepath_ga = getenv('GADIR'); % condition info cond_info = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; nerve = cond_info.nerve; str_stimulation = cond_info.str_stimulat...
353be6d87f298adebc6664d8b582579c9100058a0b8c6eb1ba5a2b8540d16ace
MATLAB
8,752
199
classdef monteCarloSimulation %monteCarloSimulation This class includes all properties and methods %related to the Monte Carlo simulation in an MCmatlab.model. properties %% Input properties silentMode (1,1) logical = false % Disables command window text and progress indication useAllCPUs (1,1) logic...
5809cab6f6037ae6558cbfbe2d269dc438526ce5d00f0b515c0a6351dfdbdef3
MATLAB
8,752
236
% FADE-SAME: Figure S4 clear % close all %%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set results files FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_only.xls'; covs_file = 'covariates/covariates_FADE.xls'; % define cohorts cohs = {'middle-aged' ,'older'}; cohs_cols =...
99bc71da158ee2d9101cd25fdaf846f22d6ce20c676ef45d2ab024d4291b726e
MATLAB
8,755
212
function StatsTableExporterFull(Statistics,PvaluesTable,OverallPValue,GroupNames,TestName,SaveDir) OS=computer; if strcmp(OS,'MACI64') dc='/'; else dc='\'; end FullLabelTableDisplay=0; for i=1:length(GroupNames) GroupNamesNumberedList{i}=[num2str(i),': ',GroupNames{i}];...
a533177cb42880f9116b4b559fb3860cece7465f8e539b5118c14a1116ab0b74
MATLAB
8,755
307
function varargout=sigstar(groups,stats,nosort) % sigstar - Add significance stars to bar charts, boxplots, line charts, etc, % % H = sigstar(groups,stats,nsort) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The user specifies the groups a...
1404eb2ec756bd281b694b9dc28d7009ee300d93da7ad1b27cc21dff751d4357
MATLAB
8,756
256
function M = grassmanngeneralizedfactory(n, p, B) % Returns a manifold struct of "scaled" vector subspaces. % % function M = grassmanngeneralizedfactory(n, p) % function M = grassmanngeneralizedfactory(n, p, B) % % Generalized Grassmann manifold: each point on this manifold is a % collection of "scaled" vector s...
5e4e2e40705e69195e3df1cd30953b9f4ab8c32c5790ea627eed46f70fe22f0c
MATLAB
8,759
239
function varargout = DPABI_BrainImageNet_Local(varargin) % DPABI_BrainImageNet_Local MATLAB code for DPABI_BrainImageNet_Local.fig % DPABI_BrainImageNet_Local, by itself, creates a new DPABI_BrainImageNet_Local or raises the existing % singleton*. % % H = DPABI_BrainImageNet_Local returns the handle to a...
6733fca9bfcd7d73c1a34ecd0c4b5a9f07c79419ffb61f58e831fdc55ab0353a
MATLAB
8,762
191
% MotorFindFullBehaviors.m % Sarah West % 5/22/22 % Runs with RunAnalysis.m. Uses behavior ranges from % MotorBehaviorPeriodsTable.m to put together full trainsition behaviors % (from "warning" to "finished" portions). function [parameters] = MotorFindFullBehaviors(parameters) % Load & define full_periods_table. ...
624571f4db770a411f7e98b5878b7958e8d271fc58e9ce2698099a4a699a1d1b
MATLAB
8,772
308
function [post,out] = VB_CRP(y,alpha,options) % function [post,out] = VB_CRP(y,alpha,options) % VB scheme for the CRP-MoG classifier. % IN: % - y : the pxn data matrix, where n is the number of % 'observations' to be classified, and p is the dimension of each of % these observations % - alpha : CRP concentratio...
6fd199d089bd0992133c0b9ed56d44363b533519b5031c65bfc8312d52c344b6
MATLAB
8,772
237
%% Calculate SWI for randNet across nclusters and mnc % swiGrid.m addpath(fullfile("..", "..", "src")) Config = utils.setConfig; myPlotSettings() % Select which panel to plot panelToPlot = '8b'; % 1g, 8a, 8b, 8c %% Main script parameters switch panelToPlot case '1g' modelParam.conn_prob = 0.08; % Use {...
2dfa3132476590d516d247138112ba1aa9617fc6f47400a3386063581560f0b6
MATLAB
8,774
248
function [data, mri, grid] = nutmeg2fieldtrip(cfg, fileorstruct) % NUTMEG2FIELDTRIP converts from NUTMEG either a sensor data structure % ('nuts') to a valid FieldTrip 'raw' structure (plus 'grid' and 'mri' if % available), OR a source structure 'beam' to a valid FieldTrip source % structure % % Use as % [data, mri...
96dc2cb36154ddb2a68889b364dc13a6385ab02ec90b1c6fb9c7893eed2f644d
MATLAB
8,783
251
function varargout=VBA_spm_platform(varargin) % Platform specific configuration parameters for SPM % % FORMAT ans = spm_platform(arg) % arg - optional string argument, can be % - 'bigend' - return whether this architecture is bigendian % - 0 - is little endian % - 1 ...
260afa45e38a16a19163fe14f763d7413c193e3f7f93d259557c62ebf8ae2424
MATLAB
8,793
191
function eps2pdf(source, dest, crop, append, gray, quality, gs_options) %EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, de...
f6a9280623e14b9a6b58e5d2368fadf5882ee8a49df813205834205ce98a710e
MATLAB
8,806
167
function varargout = DPARSF_main(varargin) % DPARSF_MAIN MATLAB code for DPARSF_main.fig % DPARSF_MAIN, by itself, creates a new DPARSF_MAIN or raises the existing % singleton*. % % H = DPARSF_MAIN returns the handle to a new DPARSF_MAIN or the handle to % the existing singleton*. % % D...
856358107f176db08b75fc7b55198a5919ae1a49395486ed8a90c23da544f9f2
MATLAB
8,810
210
function embedding = trans2_optimize_layout(head_embedding, tail_embedding, ... head, tail, n_epochs, n_vertices, epochs_per_sample, a, b,... gamma, initial_alpha, negative_sample_rate, verbose, min_dist, move_point) %OPTIMIZE_LAYOUT2 Another version of optimize_layout.m that slightly % optimizes the speed for ...
318f62c6a518d4b9f2109d8a4b624a13ab961a23e653153b67c7403311622329
MATLAB
8,815
222
%% Read two greyscale images of Lena imgDir = '/Users/paultillberg/Documents/MATLAB/Image registration/SIM before after from Fei 140109/'; Iafter=imread([imgDir 'B5_3_3_MAX_After.tif']); Ibefore=imread([imgDir 'B5_3_stack_MAX_before.tif']); %Scale both images to max pixel value for uint16 Ibefore = uint16(...
84f91861fff3dcb05e6e6fdb53250ca3daacd2c931eba9858eb63cbbb07090b4
MATLAB
8,819
281
% HIFDE2 Hierarchical interpolative factorization for differential equations % with nearest-neighbor interactions on a regular mesh in 2D. % % This is an optimization of HIFDE2X for the special case of nearest-neighbor % interactions on a regular mesh. A given mesh node is allowed to interact % only w...
ed8d4c307cb5b0f845ec3fcf41336faace987fd837c9f9a86f5ef41669497943
MATLAB
8,825
209
function embedding = optimize_layout2(head_embedding, tail_embedding, ... head, tail, n_epochs, n_vertices, epochs_per_sample, a, b,... gamma, initial_alpha, negative_sample_rate, verbose, min_dist) %OPTIMIZE_LAYOUT2 Another version of optimize_layout.m that slightly % optimizes the speed for MATLAB; in particu...
d35f078b0ce6c065e9b04031b4f37179b2684549d1af233516739b07bb088cb1
MATLAB
8,826
188
clear % close all Monkey = ['Monkey2']; % ['Monkey1' or 'Monkey2'] %---------------------------- Base = ['PER_ON']; %'Fig_ON' 'PER_ON' %---------------------------- Align = [{'GO'} {'MOV'}]; % --------------------------- SIGNAL = 'Difference' % 'Difference' 'Beta' 'Gamma' % -------------...
fa3d9fa929aadc743223f5cab9603f1fd1f11e987e0b5d66b49f269e1057c8e1
MATLAB
8,828
248
% Imports addpath("HelperFunctions") load(fullfile(DataPath, "WeberData.mat")) % Weber fraction load(fullfile(DataPath, "AmpDiscrim.mat")) % ICMS amp discrim load(fullfile(DataPath, "AmpDiscrimBioLin")) % Amp discrim bio vs lin load(fullfile(DataPath, "MechAmpDiscrim.mat")) load(fullfile(DataPath, "MagEstBiovsLin.mat")...
85d589a74886e58c1f0a609a499f92e1bda9e510ba8bbe18c598a6eb37113697
MATLAB
8,831
279
% Author: Birgit Nierula % nierula@cbs.mpg.de function figure_spinalTFplots(subjects, condition, is_evoked) % set path savepath_ga = getenv('GADIR'); % condition info srmr_nr = 1; cond_info = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; nerve = cond_info.nerve; trigger_name = cond_info.tri...
ce134c652cf128d29148ab6955dd54a522c1b172c9a62a1b7a20e9d90429737b
MATLAB
8,832
208
function [cfg] = ft_topoplotIC(cfg, comp) % FT_TOPOPLOTIC plots the topographic distribution of an independent % component that was computed using the FT_COMPONENTANALYSIS function, % as a 2-D circular view (looking down at the top of the head). % % Use as % ft_topoplotIC(cfg, comp) % where the input comp structure ...
5b45e724fd1ad2c9ac174f039a5ffc7c025ca69d8183ab0ff37d6729f9fc96b5
MATLAB
8,840
257
function ROCdata=roc(varargin) % ROC - Receiver Operating Characteristics. % The ROC graphs are a useful tecnique for organizing classifiers and % visualizing their performance. ROC graphs are commonly used in medical % decision making. % If you have downloaded partest % http://www.mathworks.com/matlabcentral/fil...
d983dc182e3163d6b8ebca2b3153db829dc8773456a2c64797fd2da4493e4111
MATLAB
8,840
254
function pmlFigureCodeReport(dest, includeEx, includeSol) %% Generate an html report of figures in PML and their source files % %% Inputs % % dest - this script creates a whole directory structure, specify the root % destination. % % includeEx - [false] if true, pml exercises are included % includeSol - [...
e2e4a5385336f88dcb1767eecef6b36e81a0406f21f32e6120cc944449c1bac1
MATLAB
8,841
254
function [mt_grid, mt_length, mt_state, grids, growths] = simTauMap6(params) %SIMTAUMAP6 Summary of this function goes here % Detailed explanation goes here %% Load and validate inputs % load params via input parser input = inputParser; addRequired(input, 'params', @(x) isstruct(x) && ~isempty(x)); parse(input, para...
e6d3dc3ea147c5fb5585bf79932da105c01c844fd79b52a457d8d89b603ff6fe
MATLAB
8,841
224
function [freq] = ft_freqdescriptives(cfg, freq) % FT_FREQDESCRIPTIVES computes descriptive univariate statistics of % the frequency or time-frequency decomposition of the EEG/MEG signal, % thus the powerspectrum and its standard error. % % Use as % [freq] = ft_freqdescriptives(cfg, freq) % [freq] = ft_freqdescrip...
805050e5b71147c38593ca2711843ea409302f343db8e67ea8bf62fcab2f1373
MATLAB
8,844
226
function STATS = cuzick(x,varargin) % CUZICK: Perform the Cuzick's test on trend. % This function provides a Wilcoxon-type test for trend across a group of % three or more independent random samples. % % Assumptions: % - Data must be at least ordinal % - Groups must be selected in a meaningful order i.e. ordered...
e7c68f6bb2164695ac943788a28ef4402f5ff3d81d891736d8ce8703b0374043
MATLAB
8,844
279
function [posterior,out] = VBA_onlineWrapper(y,u,f_fname,g_fname,dim,options) % online VB inversion of nonlinear stochastic DCMs % function [posterior,out] = % VBA_onlineWrapper(y,u,f_fname,g_fname,dim,options) % This function inverts a nonlinear state-space model 'on line', i.e. % estimate hidden states, observation/e...
97d1ab2395a1ef11dac13677c137d4e6375c654c05ba43497c57dfc36eac92d1
MATLAB
8,849
282
function M = productmanifold(elements) % Returns a structure describing a product manifold M = M1 x M2 x ... x Mn. % % function M = productmanifold(elements) % % Input: an elements structure such that each field contains a manifold % structure. % % Output: a manifold structure M representing the manifold obtai...
e7e6827c9d7e8ceacaa6663f636d64dac8b81e897a891f2df92c1b0249966afb
MATLAB
8,851
237
function [response, timing, quitProg] = showScanStimulus(display,... stimulus, t0, timeFromT0) % [response, timing, quitProg] = showStimulus(display,stimulus, ... % [time0 = GetSecs], [timeFromT0 = true]) % % Inputs % display: vistaisp display structure % stimulus: vistadisp stimulus struc...
668487bbf9903331e65ce173da65e581b7d6d84cfbdabb7a1661cc5a54e55508
MATLAB
8,853
215
function [cfg, artifact] = ft_artifact_clip(cfg, data) % FT_ARTIFACT_CLIP scans the data segments of interest for channels that % clip. A clipping artifact is detected by the signal being completely % flat for some time. % % Use as % [cfg, artifact] = ft_artifact_clip(cfg) % with the configuration options % cfg.da...
80a36f19163e9cdd22116c820a4dcfa625af28de65658599a767158474951bbe
MATLAB
8,856
196
%% This is the script that generates the sectored colony images %% Steps for each training image % 1. Create background of the table color % 2. Create inner circle % 3. Color inner circle with the plate with the same color as the plate % 4. Plot colonies whose centers are in the inner circle and match the % c...
237acb634aac20bb3aea7dff025e6149e01dbd2d1f1107caa4cf2abb0074de35
MATLAB
8,860
259
function [combined] = ft_appendlayout(cfg, varargin) % FT_APPENDLAYOUT concatenates multiple layout descriptions that have been constructed % separately. % % Use as % combined = ft_appendlayout(cfg, layout1, layout2, ...) % where the input layouts result from FT_PREPARE_LAYOUT and the configuration % should contain ...
e44cc76bc127885b7cec9bb783b4559dcc7340b717646f56cef6481f1dade8de
MATLAB
8,860
213
load(fullfile(dipole_folder, strcat(patno,'_',model_name,'_',dipole_name, ... '_output_charge_solution'))); %% load additional colormaps addpath(fullfile("../engines/Colormaps")); %% XY transverse cross section % Prepare plane data planeABCD = [0 0 1 -Z]; % Equation of the plane of the cross-section...
ca1a177b377416d8d4c40a0478a9e0d21d947aa3aabe5647a82f3711835a353f
MATLAB
8,866
247
function varargout = w_ClusterSize(varargin) % W_CLUSTERSIZE MATLAB code for w_ClusterSize.fig % W_CLUSTERSIZE, by itself, creates a new W_CLUSTERSIZE or raises the existing % singleton*. % % H = W_CLUSTERSIZE returns the handle to a new W_CLUSTERSIZE or the handle to % the existing singleton*. % % ...
ceac1832e1302cdeb156d8c02ecbe8fef58a3bab4c0ab8aa5be5072c815e1638
MATLAB
8,867
214
function [spectrum,freqoi,timeoi] = ft_specest_hilbert(dat, time, varargin) % FT_SPECEST_HILBERT performs a spectral estimation of data by repeatedly applying a % bandpass filter and then doing a Hilbert transform. % % Use as % [spectrum,freqoi,timeoi] = ft_specest_hilbert(dat,time,...) % where % dat = matri...
eed7d07a0c2f6e1afcf0d4f26b054ddb69cb64b1f7a1f89f3b67a7acaac6f188
MATLAB
8,867
324
function graphviz(adj, varargin) % Calls graphviz to generate a pretty layout of an adjacency matrix % You must first install graphviz from http://www.graphviz.org/ % This function converts the adjmat to a .dot file, % and then calls graphviz to generate a .ps file. % Finally we convert this to a .pdf file. % Unlike gr...
751f48c46ba50a711088aca3e6459aecefcaa7188bad596c797918db6228f5e6
MATLAB
8,870
226
function [LF2B, HF2B, B2LF, B2HF] = BHImodel(TFR_EEG, TFR_HRV_HF, TFR_HRV_LF, time, t_RR, FS, RR, window) % This function quantifies directional Brain-Heart Interplay (BHI) % through the model proposed by Catrambone et al.(2019) [1]. % INPUT variables: % TFR_EEG = Time course of EEG power spectral density (PSD). This...
2a8b8a2b959141ae355ae940e306849beb3802e12fec585effe179b9ab4a0fd0
MATLAB
8,873
227
function [dat] = read_neuralynx_ds(dirname, hdr, begsample, endsample, chanindx) % READ_NEURALYNX_DS reads multiple single-channel Neuralynx files that are % all contained in a single directory. Each file is treated as a single % channel of a combined multi-channel dataset. % % Use as % [hdr] = read_neuralynx_ds(dir...
9f4e6729d399aa929fc8a2827b98426e39b94d7cd76e0081e585e3e888fb5f0a
MATLAB
8,875
228
function [dat] = read_neuralynx_ds(dirname, hdr, begsample, endsample, chanindx) % READ_NEURALYNX_DS reads multiple single-channel Neuralynx files that are % all contained in a single directory. Each file is treated as a single % channel of a combined multi-channel dataset. % % Use as % [hdr] = read_neuralynx_ds(dir...
a109f72f26c8769a5abcb912707dc1d179dfbe4a972ec90b338d379c14feba39
MATLAB
8,878
321
function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data) % SUBFUNCTION for ft_rejectvisual % determine the initial selection of trials ntrl = numel(data.trial); trlsel = true(1, ntrl); % determine the initial selection of channels nchan = numel(data.label); chansel = true(1, nchan); % compute the samplin...
381f8a000f3cbcc16d06580ddbe558dea8f7200642f1da1cefc669aaeab51e60
MATLAB
8,880
249
function [data, mri, sourcemodel] = nutmeg2fieldtrip(cfg, fileorstruct) % NUTMEG2FIELDTRIP converts from NUTMEG either a sensor data structure % ('nuts') to a valid FieldTrip 'raw' structure (plus 'sourcemodel' and % 'mri' if available), OR a source structure ('beam') to a valid FieldTrip % source structure. % % Use a...
4e7a75c62812719dab9ebf371cb1aa32054e8a805037faca40407b046ce73794
MATLAB
8,880
220
%% To make data matrix and design matrix for NBS exercise % modified from NBS_sam by Sonya - May 9, 2018 % modified by Liz - Sept 2018, Jan 2020 % load path to parpticipant data matrix files for participants spath = '/mnt/sda/juanita/MEGneto/analysis/Right/analysis'; %% create data matrix - PLI adj. matrix (subjects...
f2546cb2d706b817dea4b1a2cb1f1cc64b960114dc40055ec3527862c3193167
MATLAB
8,886
166
classdef geometry %GEOMETRY This class contains all properties related to the geometry of %an MCmatlab.model. % This class defines the properties of a geometry to be used in a % monteCarloSimulation, fluorescenceMonteCarloSimulation or % heatSimulation. properties silentMode (1,1) logical = false...
8c1f82486b963080e9db432e0d92095c87526b6e347d3978485430dc8cfd5331
MATLAB
8,893
242
function [conjunction] = ft_conjunctionanalysis(cfg, varargin) % FT_CONJUNCTIONANALYSIS finds the minimum statistic common across two or % more contrasts, i.e. data following ft_xxxstatistics. Furthermore, it % finds the overlap of sensors/voxels that show statistically significant % results (a logical AND on the mask...
45e1a7a6834890308599af187b3652d6f68451d2126707df8edb2b142a8996dd
MATLAB
8,905
196
function[vect_PO, vect_POCI_dist, vect_POCI, CI_under_45, OS, OS_CI, OSnn, OSnn_CI, vect_PD, pref_stim, pref_stim_resp, DS] = ... vect_PO_boot(mean_resp_dir_rep,stim_dir_correction,showplot) % in order to keep rep number equal across stims, if there is a nan in a % rep for any stim, that whole rep is removed m...
2975102680d8df4a3d34be3a9e0c434a0782b776eaa6b4d9b6166b92937205ff
MATLAB
8,906
255
function [fx] = f_AVL(x,Theta,u,in) % OTO: associative learning evolution function % function [fx] = f_AVL(x,Theta,u,in) % This function implements the VB recognition of audio-visual cue/outcomes % pairs (it learns about the cue/outcome association). The recognition % process expects: % - sensory cue (u). This is a v...
a6fde655c91ad5e5e6245a8725b9610fd5894aa2cd0f6becd515a3ea2e6952c3
MATLAB
8,908
249
function [nsout] = read_neuroshare(filename, varargin) % READ_NEUROSHARE reads header information or data from any file format % supported by Neuroshare. The file can contain event timestamps, spike % timestamps and waveforms, and continuous (analog) variable data. % % Use as: % hdr = read_neuroshare(filename, ...) ...
e5271561bb61a6aea776803e01a5a1ae34cd69ebc2fa3546e517c80a909aaa60
MATLAB
8,910
264
% mediation_zeta_control load(fullfile(saveLoc, 'sig_allSessions'),... 'sigSL') S = sigSL; % Analysis parameters max_coh = 0.1; minRT = 0.67; maxRT = 2; start_t = 0; end_t = 0.55; session = S.session; times = S.t; dt = times(2) - times(1); choice = S.choice; RT = S.rt; coh = S.sig_coh; str = ...
504673a490bead929db39f84f6b03ac52a00b87c9a8b3d35390507f5be0bb9cb
MATLAB
8,911
293
function allppobj = RunPostProcessing_HeatmapData2(hmdir,varargin) % Run single-view heatmap postproc ncores = feature('numcores'); if isdeployed, fprintf('Starting RunPostProcessing_HeatmapData, ncores = %d...\n',ncores); end if ncores == 1, ncores = 0; end if isdeployed, varargin = DeployedChar2NumberArgs(va...
7fa85dce3d09824e5bcb635e036e1a41e52be251d7f406087f5e367c0d7d26a6
MATLAB
8,916
266
function create = spm_cfg_opm_create % configuration file for creating OPM objects %__________________________________________________________________________ % Copyright (C) 2018 Wellcome Trust Centre for Neuroimaging % Tim Tierney % $Id: spm_cfg_opm_create.m 7521 2019-01-30 18:16:03Z tim $ %------------------------...
4d02ae8049475fce083ed2c084f13bd096c1619a741df559a09c1ae8fbd0231e
MATLAB
8,917
329
function [PI,out] = MixtureOfBinomials(y,K,options) % This function inverts a binomials mixture model (BMM). % [PI,out] = MixtureOfBinomials(y,K,options) % % IN: % - y: the Dxn binary data matrix, where n is the number of samples, and % D the dimension of the data. % - K: the number of classes to be used. As a g...
44e3a6445f18216b7cfbcc9a53dd2718ff17260b2654f7fe48b133afc46c2d3f
MATLAB
8,918
231
function hdr = read_yokogawa_header_new(filename) % READ_YOKOGAWA_HEADER_NEW reads the header information from continuous, % epoched or averaged MEG data that has been generated by the Yokogawa % MEG system and software and allows that data to be used in combination % with FieldTrip. % % Use as % [hdr] = read_yokogaw...