sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
50a4ca170b677adc331cd7121754bd1dafd5946de0437b1f7cb05f60701a3dc3
MATLAB
15,601
520
function M = fixedranktensorembeddedfactory(tensor_size, tensor_rank) % Manifold of tensors with fixed multilinear rank in Tucker format % as a submanifold of a Euclidean space. % % function M = fixedranktensorembeddedfactory(tensor_size, tensor_rank) % % NOTE: Tensor Toolbox version 2.6 or higher is required for this ...
edc589dd63dcfc2353ebced94ef13a7b0a4935ea20786d21c012695493802ad9
MATLAB
15,612
335
function files_out = bids_spreadsheet2participants(varargin) % routine to takes an spreadsheet file (e.g. excel) as input and export as participants.tsv % and participants.json % % FORMAT files_out = bids_spreadsheet2participants(file_in,'ignore','field1','filed2',...) % % INPUTS if empty user is prompted % fi...
0b5cc9ec726027723009cd313fa388802d65aa4c4c9549d8a64fd8b1de690cc1
MATLAB
15,630
342
function TS_ClassifyLowDim(whatData,cfnParams,numPCs,doComputeAtMaxInSample) % TS_ClassifyLowDim compare performance of reduced PCs from the data matrix %------------------------------------------------------------------------------- % 'whatData', HCTSA data file (or structure). % 'cfnParams', parameters of the classif...
8d254d18978df7b44861d8a553df78da51831b8a5ade490d4727308d8144a7c1
MATLAB
15,645
268
function TOL_main % TOL_main, main code for Duvelle and Grieves (2026) % Code to plot figures for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80 % years on: A meta-analysis reveals poor replicability and little evidence for % shortcutting. European Journal of Neuroscience. DOI: % https://doi.org/10.1111/ejn.7...
8afb7da3d69d345a6849aec5bb2f061125f9b534b39759c69a9ac54cb689555b
MATLAB
15,646
570
%% Part 1 : Single Neuron close all clear all rng(1) load('Z:\CLOOSE benchmark tests\Various_BCI_approaches\DF_062624_NDNF_07_000_009.mat'); load('Z:\BCI\Data\NDNF_Opto\NDNF_07\062624_NDNF_07\Baseline\baselineMask_2.mat') load('Z:\CLOOSE benchmark tests\Various_BCI_approaches\ROIS_062624_NDNF_07_000_009.mat') figure...
1a7d4fbd2abb6ef842dde6e0f5def429679f372de67da7d67df2bec6e40555f5
MATLAB
15,655
391
% STD_SPECGRAM - Returns the ICA component or channel spectrogram for a dataset. % Saves the spectra in a file. % Usage: % >> [spec freqs] = std_specgram(EEG, 'key', 'val', ...); % % Inputs: % EEG - a loaded epoched EEG dataset structure. % % Optional inputs: % 'components' - [numeri...
58d9fae950dab09531371d5466a9c2744ac08e22ea47588de6aa8e0f18c7097b
MATLAB
15,662
352
function outputFileName = TS_Normalize(normFunction,filterOptions,fileName_HCTSA,classVarFilter,keepCalcTime) % TS_Normalize Trims and normalizes data from an hctsa analysis. % % Reads in data from HCTSA.mat, writes a trimmed, normalized version to HCTSA_N.mat % For many normalization settings, each feature is normali...
abe370a30cbbd8e2216dc02e1394f670e476abdaf1b1792372c1bc54e5773fb0
MATLAB
15,665
268
function [cm_data]=magma(m) cm = [[ 1.46159096e-03, 4.66127766e-04, 1.38655200e-02], [ 2.25764007e-03, 1.29495431e-03, 1.83311461e-02], [ 3.27943222e-03, 2.30452991e-03, 2.37083291e-02], [ 4.51230222e-03, 3.49037666e-03, 2.99647059e-02], [ 5.94976987e-03, 4.84285000e-03, 3.71296...
9d6d82e54a8eb936cd183004e8a9de1684632b23394aa5aec2bd0cc3909aa303
MATLAB
15,667
389
Skip to content Features Business Explore Marketplace Pricing Search Sign in or Sign up 1 0 31 spike3600/rsatoolbox forked from rsagroup/rsatoolbox Code Pull requests 0 Projects 0 Insights Join GitHub today GitHub is home to over 28 million developers working together to host and review code, manage projects, and...
18e20b1a881386c7473f3f8b0f0b367d356e3a61ba61de0c6948490c88a2a622
MATLAB
15,668
271
function [cm_data]=magma(m) cm = [[ 1.46159096e-03, 4.66127766e-04, 1.38655200e-02], [ 2.25764007e-03, 1.29495431e-03, 1.83311461e-02], [ 3.27943222e-03, 2.30452991e-03, 2.37083291e-02], [ 4.51230222e-03, 3.49037666e-03, 2.99647059e-02], [ 5.94976987e-03, 4.84285000e-03, 3.7129...
4781d926e89a18d422c80dc28219142a36d975e5e6f5c607c71bc0f9985823f5
MATLAB
15,687
129
%EEGLAB group processing (STUDY) functions (studyfunc folder): % <a href="matlab:helpwin compute_ersp_times">compute_ersp_times</a> - Computes the widest possible ERSP/ITC time window,... % <a href="matlab:helpwin eeglabciplot">eeglabciplot</a> - Eeglabciplot(lower,upper)... % <a href="matlab:helpwin extra...
58a0caeecca5ad37ab5b33720dd90159db4da9cf0454385accdda6cb5fcbf800
MATLAB
15,692
346
function runStimDetectionApp(MEANAPapp) %RUNSTIMDETECTIONAPP Summary of this function goes here % Detailed explanation goes here % MEANAPapp : app object % Main MEANAP application object, to sync settings / parameters across % these two apps stimDetectionAppObj = stimDetectionApp; stimDetectionAppObj.UIFigure.Name ...
f618520605de21e6b8fbee1c6c8642ed78519a8fb83e5e5977cc6aab9bf81569
MATLAB
15,692
341
%% ===================================================================== % GROUP‑LEVEL ERP ANALYSIS & N1 EXTRACTION % --------------------------------------------------------------------- % Author : Suong Welp % Date : 2025-07-24 % Loads all *_ERP.mat files created by preprocessing2ERP_final.m, % build...
d7029eee45f5ae34908bdce42b95912f1cffbfb40a742e48c7e420cf450c9751
MATLAB
15,696
503
function coactPaper_figure05() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',3,'font','Arial','fontsize',fontsize); x=14; y=6-4; panel_01(x,y,fontsize) panelLetter2(x-letGapX-6,y-letGapY+2+4,alphabet(1,labelCase),'fontSize',labelSize,'isB...
7bb7bba7152e6e8e35d61d460fe20de7b42b03852d6b81ebe52832942aa41ec2
MATLAB
15,714
445
%{ Once you have your results, time for plotting and making the graphs look beautiful already in Matlab! Rather than prettifying your plots in Illustrator, I highly recommend doing as much as possible already in Matlab. Chances that you'll have to regenerate the figures at some point (because you decide to change one s...
2eebc56d7bbb3cdbbb2d1a93f62b4edb594119fe2f3791b135dc12b3def75430
MATLAB
15,723
396
clear all; close all; clc; warning('off'); % ---------------- I/O and paths ---------------- fullpath = mfilename('fullpath'); if isempty(fullpath) fullpath = matlab.desktop.editor.getActiveFilename; end [scriptFolder, scriptName, ~] = fileparts(fullpath); parentFolder = fileparts(scriptFolder); dataPath = full...
e43c9b1818ee86616ab1693c8cee7a3c406f239e38a25af958b74118fa99a8c0
MATLAB
15,725
318
%% h = sepia_handle_panel_utility_get_header(hParent,hFig,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 ...
0f6ce1d43315d3b8cc999cdfa10be1217ecedc778570329a0a815ed66966a6cb
MATLAB
15,732
302
% SHOW FIGURES OF MAIN FMRI RESULTS AND CALCULATE EFFECT SIZES FROM BETAS function master_fMRI_showResults % % js 2019-2024 % general settings panLetterFontSize = 28; sliceFontSize = 18; labelFontSize = 16; LMMcoeffBarColor = [.8 .8 .8]; tFlg = 0; % if 1, adds text title to panels figName1 = 'Figure 4 - fMRIresults'; ...
0749ffe7fb2a5c3e44f7c73f3e83c0b2aa159bedb670cd50f10145e6b9b33fe0
MATLAB
15,733
344
function fh = plot4D(this, varargin) %plots an MR image per slice % % Y = MrImage % fh = Y.plot4D('ParameterName', ParameterValue) % % IN % varargin 'ParameterName', 'ParameterValue'-pairs for the following % properties: % 'plotType' Type of plot that is created % ...
0aeb6b2c140e6251801698dd855088568d2e47e4e935e67d466c53e0d4dc98da
MATLAB
15,762
357
function [A, bcol, alpha] = print2array(fig, res, renderer, gs_options) %PRINT2ARRAY Exports a figure to a bitmap RGB image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % A = ...
af8080d219c5239c5f1fd3ed899656313630c5a319eeba8aa502926418b2d6dc
MATLAB
15,821
400
function m = hlp_serialize(v) % Convert a MATLAB data structure into a compact byte vector. % Bytes = hlp_serialize(Data) % % The original data structure can be recovered from the byte vector via hlp_deserialize. % % In: % Data : some MATLAB data structure % % Out: % Bytes : a representation of the original data as...
fb020eb7fb0785cfc6b01b27a6ee011545befc278806c0b675a4ab3c542da60c
MATLAB
15,829
515
function ss=FscatJit2(identifiers, data, varargin) % Plots data as both jittered points and an error bar, in the % order the identifiers are passed to it. It preserves whatever order % was in the fbmm structure. Also includes the option to define the circle % size or use a default. Also allows someone to add bars to ...
2b436a0d9be1da675d1e1a5eb4c8283215d5ba92481313ff1a199cf5e006f5db
MATLAB
15,858
517
function Answer=APinputdlg(Prompt, Title, NumLines, DefAns, Resize) %INPUTDLG Input dialog box. % ANSWER = INPUTDLG(PROMPT) creates a modal dialog box that returns user % input for multiple prompts in the cell array ANSWER. PROMPT is a cell % array containing the PROMPT strings. % % INPUTDLG uses UIWAIT to suspend ...
00d962d20d14c367f1b0d1102180dd114bb14fd2581479d9487aef9ebc9c6e98
MATLAB
15,864
291
% CROSSFREQ - compute cross-frequency coherences. Power of first input % correlation with phase of second. % % Usage: % >> crossfreq(x,y,srate); % >> [coh,timesout,freqsout1,freqsout2,cohboot] ... % = crossfreq(x,y,srate,'key1', 'val1', 'key2', val2' ...); % Inputs: % x = ...
04710d406778e6bd53ff99b6ea8358bcd22efdee4f31261bba5d754386551d68
MATLAB
15,886
461
function res = vl_contrib(command, module, varargin) %VL_CONTRIB Contribution modules management % VL_CONTRIB is a tool to download, set up and compile external % contribution modules for MatConvNet. It downloads the list of available % modules from a dedicated repository and uses GIT (if present) or ZIP % file...
f09ac36c2e22e381a25e2231651920532f1fe7d563a07f8454c07bd606f68f03
MATLAB
15,900
447
clear all close all clc n_track = 1; step_time = 10; step_avg = 200; peak_lap = 0.2; threshold_norm = 0.2; threshold_burst_cp = 10; file_names = dir('*.csv'); for q = 1:length(file_names) input = readtable(file_names(q).name); time = table2array(input(:,1)); signal = table2array(input(:,n...
9df41c6809b5650911c5d4e5515fd3a1e149a017199ce4c966b61794e6fd5776
MATLAB
15,901
595
function pp = splinefit(varargin) %SPLINEFIT Fit a spline to noisy data. % PP = SPLINEFIT(X,Y,BREAKS) fits a piecewise cubic spline with breaks % (knots) BREAKS to the noisy data (X,Y). X is a vector and Y is a vector % or an ND array. If Y is an ND array, then X(j) and Y(:,...,:,j) are % matched. Use PPVA...
d254c7b2e7e35fb803f6dea431a99f4f78ac95badbc0b7b9d8c5dd5b3944ac57
MATLAB
15,963
338
% STD_TOBIDS - From a STUDY rename files if needed, sort folders, and export metadata % following the BIDS specification % % FORMAT STUDY = std_tobids(STUDY,options) % options are: 'export_dir' followed by the path % 'keep_files' being 'yes' (default) or 'no' % ...
29a29aa0e8f25c74e593536fe70eab3c8b2e710a459e6ecb85f36d2be084d3d9
MATLAB
15,980
404
function m = std_serialize(v) % Convert a MATLAB data structure into a compact byte vector. This function % is identical to hlp_serialise (as of 2015). It bears a different name % so as to avoid conflict. % % Bytes = std_serialize(Data) % % The original data structure can be recovered from the byte vector via hlp_dese...
7d67ffaaf120fc8400825fbfffa9ae8df991016e53f5bd4bede13bf722ab8b32
MATLAB
15,991
400
function [] = StandardisedNetworkPlotNodeCartography(adjM, coords, edge_thresh, ... NdCartDiv, plotType, FN, pNum, Params, lagval, e, figFolder, oneFigureHandle, suffix) % % script to plot the graph network for node cartography % % Parameters % ---------- % adjM : double array % adjacency matri...
21ee423feb95b7fffde82878c80539c472ac38b92433f5b37469424759ec7daa
MATLAB
16,024
349
function [trl,dataselep] = iEEG_func_detectRipples_detector5(fsettings,data) %% ######################################################################## % [trl,dataselep] = iEEG_func_detectRipples_detector5(fsettings,data) % ######################################################################### % % Ripple detection...
e5f2c6119ad6ae52c064d3064b043a507be1856e9f69ea1643546d4d4aa3b428
MATLAB
16,034
411
function TS_FeatureSummary(opID,whatData,doViolin,doInspect,annotateParams,customAnnotation) % TS_FeatureSummary How a given feature behaves across a time-series dataset % % Plots the distribution of outputs of an operation across the given dataset % and allows the user to annotate time series onto the plot to visual...
61a50cfa9b952369326fc2e3d2ae4cc1e247d220d7d78e95c5029c7c31db22c5
MATLAB
16,047
356
%************************************************************************************% %************************************************************************************% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%Master file for D.sort%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %**********************************************************...
90c61eddbeeaf0b447d21234b71f048ac42739f8042d2d8e436249f947cebb23
MATLAB
16,051
483
function [VOLLOCS, LOCS, verbose] = ... tapas_physio_create_scan_timing_from_gradients_auto_philips(log_files, ... scan_timing, verbose) % Automatically extracts slice/volume scan events from gradient timecourse % SCANPHYSLOG file % % [VOLLOCS, LOCS, verbose] = ... % tapas_physio_create_scan_timing_from_gra...
e6d86f256ccbb61a1879986b629a933ff8473ba7ef3333119e5d100d8c997e00
MATLAB
16,061
590
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MakingSubcorMORDensity % Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add paths baseloc="C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC"; % For outputs str='\Outputs'; outputpath=strcat(baseloc,str); a...
37362a7650081571fbca8cbf48db2047ddfac7e946911200ba1751e52b4b99e8
MATLAB
16,066
442
function ccainf(N,Ny,Nx,Nz,Nw,Npca,dist_parm,sig,nR,nP,deconf_meth,use_nullspace,seed0) % Monte Carlo evaluation of CCA inference % ccainf(N,Ny,Nx,Nz,Nw,Npca,dist_parm,sig,nR,nP,deconf_meth,seed0) % % N : Number of subjects % Ny : Number of variables in Y % Nx : Number of variables in X % Nz...
4ba9531ea6bde7c925e87217a008e9da8a5efa26e89b7380dc6e29ed31e9bd41
MATLAB
16,083
392
% EEGLAB_UPDATE - assess if EEGLAB new updating and ask user to install % new version % % Usage: % >> eeglab_update % % Authors: Arnaud Delorme, SCCN/INC/UCSD, 2019 % Copyright (C) 2019 Arnaud Delorme, SCCN/INC/UCSD % % This file is part of EEGLAB, see http://www.eeglab.org % for the documentatio...
646d8abf22013ec130da85ac1ee39f75c5933ce43003af1ef5ff198111e2018d
MATLAB
16,098
394
function [x, cost, info, options] = arc(problem, x, options) % Adaptive regularization by cubics (ARC) minimization algorithm for Manopt % % function [x, cost, info, options] = arc(problem) % function [x, cost, info, options] = arc(problem, x0) % function [x, cost, info, options] = arc(problem, x0, options) % function ...
c7297ebcb354bbe1e8b315529473237b5a96943dc20096829d5386cdd98b7b5c
MATLAB
16,098
419
function CellsortICAplot(mode, ica_filters, ica_sig, f0, tlims, dt, ratebin, plottype, ICuse, spt, spc) % CellsortICAplot(mode, ica_filters, ica_sig, f0, tlims, dt, ratebin, plottype, ICuse, spt, spc) % % Display the results of ICA analysis in the form of paired spatial filters % and signal time courses % % Inputs: % ...
0b5aea6876fd4d690b253721230f1fa2d22d27e4fbd34eb4b4d58e73c67f7a92
MATLAB
16,119
459
load('pooldata_ComboStim.mat') stimInd = [1,2,3]; SpikeCount_Twindow = 1; % compute spike count in 1 sec time window following IgnoreTimeWindow StimTimeIndv = 1; % duration of each stimulus is 2 sec IgnoreTimeWindow = 0; % ignore first 0 sec response %% spike counnt in 1 sec bin clear spikecount num for k1 = 1:size(p...
21931ddcaad328a2f8196169980f2197397cc17cf524aad2944a7cca0c138e67
MATLAB
16,121
414
function [ subject ] = nmri_read_markers( subject, params ) %[ subject ] = nmri_read_markers( subject, params ) % Will check spike/event markers and put into subject struct % call the subject and params include nmri_include_read_ps %% Get the modality-specific analysis params if isfield(subject,'dataset_mapping') ...
bfd5edeb7925a444b189162510097e77717539534b92816a2ba9b60b6b99f04c
MATLAB
16,121
433
function [anstime, answer] = PresentStimulus(signal, refdirection, signaldirection, leng, display, jitter, depthorder, ped, peddisp, disparitydiff, task, contr, contrsign); %% Inputs % signal is given in proportion -- this represents the coherence of the % stimulus. signal = signal/100; %% Initialize these v...
405d5ae4b6c358efa3700d077cb2414d34f318425a0b824786a53b70bfe10377
MATLAB
16,139
460
function varargout = DensityMap(x, y, varargin) %DensityMap - colormap equivalent of the dotplot produced by PlotXY % % This funtion produces a colormap equivalent of the dotplot producesd by % PlotXY. Provide two vectors x and y (of equal lengths) to get a map with % values of x varying in different columns (absciss...
be9b7cbc4bb1d8c97700febf3e57c19eea3fe1636c377c35aecb58849ea1b60e
MATLAB
16,160
375
function [] = load_params %%load_params: Load parameters for assays global info %% Import general experimental information % These values will be common across all assay types disp('Reading data from file....'); % Detect names of tabs in excel spreadsheet [~, info.sheets] = xlsfinfo(info.calledfile); alphabet = ['A...
40eeab82150be8f285e152adbc0af1d47bf1b9ce6b9b48d19884ee16d2ce6eac
MATLAB
16,166
422
function varargout = dataset_select(varargin) % DATASET_SELECT MATLAB code for dataset_select.fig % DATASET_SELECT, by itself, creates a new DATASET_SELECT or raises the existing % singleton*. % % H = DATASET_SELECT returns the handle to a new DATASET_SELECT or the handle to % the existing singleton...
22bc2690e33f8ee709173e4293f89fc10af624471c89c52ff599625551a91740
MATLAB
16,171
369
classdef Population % evolvable population of reservoir objects. properties % User-modifiable properties: Size = 100; % number of reservoirs Env = 'Lorenz'; % reservoir environment T = struct('spinu...
912228bafc4ce247e41bdfb9ed35860327c3d66d41eebd97ab60eba7bba93c57
MATLAB
16,174
416
function out = NL_LargestLyap(y, Nref, maxtstep, past, NNR, embedParams) % NL_LargestLyap Largest Lyapunov exponent of a time series. % % ---INPUTS: % y, the time series to analyze % Nref, number of randomly-chosen reference points (-1 == all). Accepted for % backwards compatibility but no longer affects the co...
ed70e8107443fa288df29ebbb8691c77d73a9f1996975d7a85de6f42d9a32e8c
MATLAB
16,176
496
function data = loadjson(fname,varargin) % % data=loadjson(fname,opt) % or % data=loadjson(fname,'param1',value1,'param2',value2,...) % % parse a JSON (JavaScript Object Notation) file or string % % author: Qianqian Fang, <q.fang at neu.edu> % created on 2011/09/09, including previous works from % % Nedialk...
e62c33d18dedb04c40ccd1d4aaf5401ef27d65a53662a6f9517887855adabfea
MATLAB
16,178
493
function varargout = colorspace(Conversion,varargin) %COLORSPACE Transform a color image between color representations. % B = COLORSPACE(S,A) transforms the color representation of image A % where S is a string specifying the conversion. The input array A % should be a real full double array of size Mx3 or MxN...
b7c4200d14184a530ec329883cbaf96405254832452aec9ce3c3b3f0df735b7e
MATLAB
16,215
404
function ft_fmri_preprocessing(img_input, slice_params, field_params, ... realign_params, outlier_params) % FMRI preprocessing % % ft_fmri_preprocessing(img_input, slice_params, field_params, ... % realign_params, outlier_params) % % Inputs: % input - cell array of filenames of input time series. % ...
bcbf3903082ed4131661121ba39a0ad079e223d1595ce86433a4badb37bfe57f
MATLAB
16,219
372
%Axon analysis and quantification code associated with Gutman-Wei et al., %2025 - function for initial processing of reconstruction % Returns reconstruction with WM axon and small branches removed, and a % series of indices matching each xyz value of reconstruction with point % type, height, layer identity, and other...
6526029df9140500ee259bde58bb6ad53616a323377a307583dfd4bba5a6917c
MATLAB
16,241
481
% This demo script provides data description and analysis demonstration % Data for each section can be accessed in each corresponding subfolder directly or via % external link % Call functions from #functions# % Contact Dr Ye Tian, yetianmed@gmail.com %% 1.Compute subcortex-to-subcortex similarity matrix addp...
526698651327f7edb7b2b58500253ee8569739111474f8735329f28772cf083f
MATLAB
16,267
447
function han = showsurface3(vertices, faces, para, varargin); % plots volume conductor/cortex as surfaces % eventually plus sources/dipoles % usage: showsurface(vc,para,source1,source2,....); % % % vc is a structure with two fields: % vc.tri is Nx3 matrix of integers where each % column denotes the indic...
0249d0f7b4f83e420afe8abb6d8d383bf84a5f5fdb75175ffefb93e2b6b9d4a4
MATLAB
16,271
494
function varargout = Meta_cluster_tools(meth,varargin) % varargout = Meta_cluster_tools(meth,varargin) % % This function contains multiple tools for working with clusters % derived from Meta_Activation_FWE and Meta_SOM tools % % % ------------------------------------------------------ % extract data and print a table f...
b7d749b507c0c440bef0938139e9c6f3573ba076a84a2f23103950d86aac221b
MATLAB
16,284
484
function generateFigure6() % GENERATEFIGURE6_REVISED Generate Figure 6 for the normalization paper % % Purpose: % Creates a multi-panel figure comparing default and in-degree matched conditions: % - Normalization index distributions % - Fisher Information scaling for contrast and orientation % - Neural manifold...
25c33e9cd5084f2f3d744f0b0e552258896235f33bc749ead6d381afe98e7472
MATLAB
16,285
354
%% Script to compute HC and SSD MIND edges and degrees. % Copyright (C) 2026 University of Seville % Written by Natalia García San Martín (ngarcia1@us.es) % This file is part of Hierarchy Longitudinal MIND Gradients Psychosis toolkit. % % Hierarchy Longitudinal MIND Gradients Psychosis toolkit is free softwa...
57935c0179eda70c2c41995b5bfa3958ec0af92367f144b785fd350612a93cca
MATLAB
16,299
436
function out = DN_OutlierInclude(y, thresholdHow, inc, fixedThresh) % DN_OutlierInclude How statistics depend on distributional outliers. % % Measures a range of different statistics about the time series as more and % more outliers are included in the calculation according to a specified rule, % of outliers being ...
6d67ef85b36808eb6feaec51035354da68073afa40e5eb2b2d264469a4b7a4d9
MATLAB
16,301
410
function [x, cost, info, options] = conjugategradient(problem, x, options) % Conjugate gradient minimization algorithm for Manopt. % % function [x, cost, info, options] = conjugategradient(problem) % function [x, cost, info, options] = conjugategradient(problem, x0) % function [x, cost, info, options] = conjugategradie...
d52fa421ae9b50fd5cf63a6c857d8c749cdeab4f3835dadef354183b4625d9bf
MATLAB
16,314
580
function exportfig(varargin) %EXPORTFIG Export a figure to Encapsulated Postscript. % EXPORTFIG(H, FILENAME) writes the figure H to FILENAME. H is % a figure handle and FILENAME is a string that specifies the % name of the output file. % % EXPORTFIG(...,PARAM1,VAL1,PARAM2,VAL2,...) specifies % parameters th...
8d6fbacd7049536949f7bba5f0e62cf4368b6762ea6c4c4ebe8a15315c7f7122
MATLAB
16,318
409
function results = runnsdbehavioralanalysis(filename,expectedframes,expectedduration,nsdexpfile,choicebuttons); % function results = runnsdbehavioralanalysis(filename,expectedframes,expectedduration,nsdexpfile,choicebuttons); % % <filename> is the .mat file saved from runnsd.m % <expectedframes> is the expected number...
df797c06031a08b8cde10541d1e51778b9836c4e862e01a5518484fb926411a1
MATLAB
16,356
385
set_up_paths_and_data_directories; bold_suffix = 'space-MNI_desc-ppres_bold.nii'; tr_length = 1.3; stim_names = { 'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ... 'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ... 'Superhero', 'Tears_of_St...
8e5a807230a9bdabaf58f5cb375f618ee05b59d3d03f6ee793335365056ba6bf
MATLAB
16,358
341
function plot_communication_subspace_prediction_ablation close all clear all clc % Plot prediction performance by reduced-rank regression after ablation. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) % Ablation dimensionality. ablated_dim_num = 2; % 1, 2 or 3. load('population_regressio...
529363e4f07a4866c874aabd8598472db5b086f1fb91d4aad10cde1c0b893437
MATLAB
16,363
455
function [] = tapas_uniqc_view3d(img, voxelSizeRatio) % Display 3D matrices along their 3 dimensions. % % [] = tapas_uniqc_view3d(img) % % IN % img arbitrary matrix (can be complex) % voxelSizeRatio allows display of non-isotropic voxel size % default: [1 1 1] for isotropic display ...
1c2a5873cce32120ffcbf6f2680d80646bc1e69d16240a60247c9edb04ca6f23
MATLAB
16,372
407
% EEG_INTERP - interpolate data channels % % Usage: EEGOUT = eeg_interp(EEG, badchans, method, t_range); % % Inputs: % EEG - EEGLAB dataset % badchans - [integer array] indices of channels to interpolate. % For instance, these channels might be bad. % [chanlocs structure] cha...
cff5127b03001fe41925a87c5ddcaa9f53e18e744f281c39f999fefb16d92fd0
MATLAB
16,376
435
function [basefun] = chooseBasis(type,tmesh,params) %CHOOSEBASIS: create basis functions for spike and stimulus filters % % %input: % %type: a handle to decide which basis to use %tmesh: vector of time points. just needs to be 1:numel(tmesh) %params: the importnat parameters for each model. if not % ...
c52563593b29ffc2c841907f517ef05025ee198b1f082a39b5dfe95722813068
MATLAB
16,379
358
close all; clear all; clc; ForderName=['PAG/BadMood']; Monkey_name='all'; % 'c' 'k' 'all' Num_context=4; Num_probability=3; POP_foldapath=['POP_Correlation/PavFo4C4S/ALL/',ForderName]; POP_allfolda=dir([POP_foldapath,'/*.mat']); load(['Labnote/Labnote.mat']); load(['Labnote/Labnote_RAW.mat']); u=1; for POP_i=1:length(P...
f1b64c970a5926627915b790f3af0db43031ad08177549992d18acdd30ba314b
MATLAB
16,401
338
function env_showmenu(varargin) % Links the BCILAB menu into another menu, or creates a new root menu if necessary. % env_showmenu(Options...) % % In: % Options... : optional name-value pairs; names are: % 'parent': parent menu to link into % % 'shortcuts': whether to enable keyboard s...
d34e590a715a672e04dffbf283a126c279bac320a46c2ad29f4cf529db8f83de
MATLAB
16,419
456
function [grad, elec] = mne2grad(hdr, dewar, coilaccuracy, coildeffile) % MNE2GRAD converts a header from a fif file that was read using the MNE toolbox into % a gradiometer structure that can be understood by the FieldTrip low-level forward % and inverse routines. % % Use as % [grad, elec] = mne2grad(hdr, dewar, co...
ebaf8eb48497d554b7932a6ec9de114120d4ae9f3a8ac0d5728ac24f84a99bef
MATLAB
16,432
269
function [cm_data]=inferno(m) cm = [[ 1.46159096e-03, 4.66127766e-04, 1.38655200e-02], [ 2.26726368e-03, 1.26992553e-03, 1.85703520e-02], [ 3.29899092e-03, 2.24934863e-03, 2.42390508e-02], [ 4.54690615e-03, 3.39180156e-03, 3.09092475e-02], [ 6.00552565e-03, 4.69194561...
042cd589bd82c14d039bd1f61d9709b20b20b881cb24ab8ad3a7479ff2262f1d
MATLAB
16,433
270
function cm_data=plasma(m) cm = [[ 5.03832136e-02, 2.98028976e-02, 5.27974883e-01], [ 6.35363639e-02, 2.84259729e-02, 5.33123681e-01], [ 7.53531234e-02, 2.72063728e-02, 5.38007001e-01], [ 8.62217979e-02, 2.61253206e-02, 5.42657691e-01], [ 9.63786097e-02, 2.51650976e-0...
129960b2e003266f8687f9f751523587cf6f7b7c60b750596ca971f95b931f1d
MATLAB
16,433
410
function M = fixedrankembeddedfactory(m, n, k) % Manifold struct to optimize fixed-rank matrices w/ an embedded geometry. % % function M = fixedrankembeddedfactory(m, n, k) % % Manifold of m-by-n real matrices of fixed rank k. This follows the % embedded geometry described in Bart Vandereycken's 2013 paper: % "Low-rank...
d990518624b416476469e530bcb2f0dcf9c2685ee2f459c6fe46e84a9da9d563
MATLAB
16,434
432
function [center, Cn, PNR] = initComponents_residual_parallel(obj, K, save_avi, use_parallel, min_corr, min_pnr, seed_method) %% initializing spatial/temporal components for the residual video %% input: % K: scalar, maximum number of neurons % frame_range: 1 X 2 vector indicating the starting and ending frames % ...
cb0614ce21933b20e5968fe0de64cb6eda7f57dc28950c1f4e7a97f529fa8d75
MATLAB
16,446
530
function json=saveubjson(rootname,obj,varargin) % % json=saveubjson(rootname,obj,filename) % or % json=saveubjson(rootname,obj,opt) % json=saveubjson(rootname,obj,'param1',value1,'param2',value2,...) % % convert a MATLAB object (cell, struct or array) into a Universal % Binary JSON (UBJSON) binary string % % author...
a7fe789b19041587ca541ae933596819fd874d0ccdb496a0eb7a71406725599c
MATLAB
16,449
416
function data = besa2fieldtrip(varargin) % BESA2FIELDTRIP reads and converts various BESA datafiles into a FieldTrip % data structure, which subsequently can be used for statistical analysis % or other analysis methods implemented in Fieldtrip. % % Use as % [output] = besa2fieldtrip(input) % where the input should b...
cad8de8450696474e6a053b4b694b91fafddd19568eb5b81b0a1a6fc926a725d
MATLAB
16,450
386
function [ avw, machine ] = avw_hdr_read(fileprefix, machine, verbose) % avw_hdr_read - read Analyze format data header (*.hdr) % % [ avw, machine ] = avw_hdr_read(fileprefix, [machine], [verbose]) % % fileprefix - string filename (without .hdr); the file name % can be given as a full path or relative to ...
0f5786f8555ed446f123b619b8cc32658d79584f33a88f4150a693c70bd9429a
MATLAB
16,452
341
%% ms SEI: job - functional connectivity (FC) between 2 selected AAs (DMN & DAN) % figs = msSEI_FC_DTF_fig_v2_selCh.m % (c) Jiri, Oct23 %% settings: v1 - relaxed conditions (p-level, length of significance, ...) dirSuffix = '_msFig_AA_v1_relaxCond'; t_sel = [-1.0, 2.0]; % the true sel time will be cut by 1 s on ed...
d2429134c40006283a211eecb33499fdabf6ba41092058f61f7c70d5782ac83d
MATLAB
16,468
456
function [MRSCont] = OspreyLoad(MRSCont) %% [MRSCont] = OspreyLoad(MRSCont) % This function loads the raw MRS data from all major vendors. % Data is read from the provided input filenames. It is shaped according % to the type of sequence (un-edited data, MEGA-edited (ON/OFF), % HERMES/HERCULES (A/B/C/D), etc.)....
535e64fd85e0f833c437f24ed5d9f4dfbaeb934ef8e9642c2bd592d4e516c751
MATLAB
16,510
372
function [trl,dataselep] = iEEG_func_detectRipples_detector4(fsettings,data) %% ######################################################################## % [trl,dataselep] = iEEG_func_detectRipples_detector4(fsettings,data) % ######################################################################### % % Ripple detection...
420edccf8994c849956f0787bbba92d333820366e7bb2ec48290bc05deab35db
MATLAB
16,555
421
function [fitParamsStep1] = fit_Osprey_PrelimReducedMM(dataToFit, basisSet, minKnotSpacingPPM, fitRangePPM) %% [fitParamsStep1] = fit_Osprey_PrelimReduced(dataToFit, basisSet, minKnotSpacingPPM, fitRangePPM) % Performs the first step of the LCModel preliminary analysis % analogous to the LCModel algorithm. The algo...
262e7b7043535e6cbd29f981a2bd7fd5f1c0c25a38fce77388b1a9f723541583
MATLAB
16,563
395
function [C2,cfg] = mahal_iem_trialwise_xgen(dat,theta,task,cfg) % [distmat,cfg] = mahal_iem_trialwise_xgen(dat,theta,task,cfg) if nargin < 3 help mahal_iem_trialwise_xgen error('missing input arguments!') end %set options if (nargin < 3) || (isempty(cfg)) cfg = struct; end ntrl = ...
f36248aa5157da81ecef79bff6d644b7d77ba4a3c4731ad2181f927adf8f9185
MATLAB
16,596
353
function poolSubjects_signifActivTimes(params, AA_type, SA_params) % plots histograms of times of significant activations in anatomical areas % activation time = when activations in given freq. band were significantly different % !!! works for only 2 classes !!! % pools together subject processed by a given job % sett...
cec352eca6c25e321ce87194080148b8f2a74682df07569f8b9b8f1b957798ff
MATLAB
16,610
505
clear % Clears workspace clc % Clears history clf % Clears figure window Nx = 101; % Defines the no. of x grid points Ny = 101; % Defines the no. of y grid points px = 0; % Sets the lower end of the domain x qx = 1; % Sets the upper end of the domain x py = 0; % Sets the lower end of the domain y qy = 1; % ...
41e5e60adb59f9514bc9cb70493ed4067270a9ada75b611433cdefe147993e23
MATLAB
16,623
337
%% jobSDAT.m % This function describes an Osprey job defined in a MATLAB script. % % A valid Osprey job contains four distinct classes of items: % 1. basic information on the MRS sequence used % 2. several settings for data handling and modeling % 3. a list of MRS (and, optionally, structural imag...
bd1ecf6b5a120f49c866e2297430dd13ed11b618de508480797f2a9dce1b4cfa
MATLAB
16,625
358
function [trl,dataselep] = iEEG_func_detectRipples_detector1(fsetup,data) %% ######################################################################## % [trl,dataselep] = iEEG_func_detectRipples_detector1(fsetup,data) % ######################################################################### % % Ripple detection. Func...
b7ba3d911dc12150b4750215d42ae54798f8fb4c0854b88eb7b0b5e2d1ce234b
MATLAB
16,655
347
%% h = sepia_handle_panel_utility_get_header(hParent,hFig,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 ...
a66c6f947e1b045e378c15a8aadfde5b1bd98f21f22a2264755105fdcb27e938
MATLAB
16,664
334
%% jobP.m % This function describes an Osprey job defined in a MATLAB script. % % A valid Osprey job contains four distinct classes of items: % 1. basic information on the MRS sequence used % 2. several settings for data handling and modeling % 3. a list of MRS (and, optionally, structural imaging...
0c707a211fc679312d51c0fb725d3f52132f6add7086b0c32db9059edf483ebe
MATLAB
16,693
449
addpath '/slow-scratch/erfan/brainstorm3/' % add brainstorm to path fs_folder = '/slow-scratch/erfan/freesurfer/subjects/'; % FreeSurfer folder setup BrainstormDbDir = '/slow-scratch/erfan/brainstorm_db/'; % Brainstorm database folder setup AD_dir = main_path; % main project directory fig_folder = [AD_dir '/Resu...
0f0187d41ac159ed5f07a253aa7761fcb85ebe93dd62f8920211d1f02790f18d
MATLAB
16,704
617
%% clear; working_dir = 'G:\CEST-fMRI'; % the actual directory to put the codes SPM_modified_path = [working_dir,'\scripts\SPM_modified']; addpath(SPM_modified_path); BM_sim_path = [working_dir,'\scripts\simulation\CEST_coef']; addpath(BM_sim_path); ds_dir = [working_dir,'\datasets\sim\exp1\result']; % dir...
454454c416f2a2c291e90e538d116530709028c1dde5518009788f48e4fd2885
MATLAB
16,707
591
% op_robustSpecReg.m % Georg Oeltzschner, Johns Hopkins University 2019. % Mark Mikkelsen, Johns Hopkins University 2019. % % USAGE: % [out,fs,phs] = op_robustSpecReg(in, seqType, echo, F0, noAlign); % % DESCRIPTION: % Perform robust spectral registration in the time domain to correct frequency and % phase drifts. % % ...
3ec7d9479cfb860df85277af6dc87517060132602fa0cafbd18f06546615f272
MATLAB
16,721
497
function [conn, nlags] = data2spwctrgc(data, fres, nlags, cond, nboot, maxfreq, output, verbose) % Epoched time series data to spectral pairwise-conditional time-reversed Granger causality % and other useful quantities (cross-spectrum, (time reversed) directed % transfer function, (time reversed) partial directed coher...
7e770be743cf969971898cec0b8de9fc65e8217b67ed73c38ed7662db901e0e4
MATLAB
16,722
489
function data = multiEventLockKinematics(R, M, eventNames, preT, postT, tBase, lags, varargin) % data = multiEventLockKinematics(R, eventName, tPts, ...) % % Repair, smooth, and time-lock video tracking data from DeepLabCut (3D % version) from an R struct produced by mergeDLC3R. % % Smooth: Use either Savitsky-Golay (d...
7d587db4d3057bd9864be058fd14139b046a0a96664007417126856508b41269
MATLAB
16,724
471
%% Figure 3, co-written with Luca Cecchetti %% 1.1 Prepare the training and test sets: IRI-PT, IRI-EC, and PCL-R F1 % (and PCL-R total score, for the supplement) clc; clear; close all load data % Select variables of interest dataNonSA = data(:, {'URSI' 'IRI_PT' 'IRI_EC' 'PCL_Total' 'PCL_Factor1' 'Age' 'IQ' 'eTIV'}...
82dad40ec617960b827c65858c511ece45952e26997a9524094e56ba8e6a9387
MATLAB
16,746
442
function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank) % Manifold of fixed multilinear rank tensors in Tucker format. % % function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank) % % n1 = tensor_size(1); % n2 = tensor_size(2); % n3 = tensor_size(3); % r1 = tensor_rank(1); % r...
7f3f976786c36dea7b97f2d346409f2c3268c9de0d4b65097e118f748cd39375
MATLAB
16,805
406
% STATCONDFILEDTRIP - same as statcond except that it uses the fieldtrip % statistical functions. This is useful to perform % a wider variety of corrections for multiple % comparisons for instance. % Usage: % >> [stats, df, pvals, surrog] =...
8bea5ad683415390ead7cd0693894c748bfc47217b098763c3317f3cae7cfb22
MATLAB
16,822
393
function plot(str, cfg, varargin) % plot function for a McsCmosSpikeSorterSource object % % function plot(str, cfg, varargin) % % Produces an intensity map with colorbar and a list of all units. Units % can be selected from the list or from the map and detailed Information % about them is displayed in a separat...
d16d13e6bf24f503d6dc8bd784367d10fd19ac62dd665d83f6cd70906e5cdbaf
MATLAB
16,825
428
% pop_leadfield - compute Leadfield Matrix % % Usage: % EEG = pop_leadfield(EEG, 'key', 'val', ...); % % Inputs: % EEG - EEGLAB dataset % % Required inputs: % 'sourcemodel' - [string] source model file % % Optional inputs: % 'sourcemodel2mni' - [9x float] homogeneous transformation matrix to convert % ...
dd2c42a964ed1167ae7dcc4311a9cb4e00f8bf165381149caa5868bfc050646f
MATLAB
16,825
540
function Answer=inputdlgcol(Prompt, Title, NumLines, DefAns,Resize,NumCols) %INPUTDLGCOL Input dialog box. % Answer = INPUTDLGCOL(Prompt) creates a modal dialog box that returns % user input for multiple prompts in the cell array Answer. Prompt % is a cell array containing the Prompt strings. % % INPUTDLGCOL uses ...
fd8e3c5afa247fb5533268b1db98322f7d1a1b9becf8a7add89b348ab41de340
MATLAB
16,842
338
%% jobSDAT.m % This function describes an Osprey job defined in a MATLAB script. % % A valid Osprey job contains four distinct classes of items: % 1. basic information on the MRS sequence used % 2. several settings for data handling and modeling % 3. a list of MRS (and, optionally, structural imag...
107dc6e34660a4c09ea1f8bea8801c98f730e61c22c45f045362f901efc4b899
MATLAB
16,879
465
function [anstime, answer] = PresentStimulus(signalD, signalGP, signaldirection, leng, display,depthorder, task, contr, contrsign); %% Inputs % signalD, signalGP given in proportion -- this represents the coherence of % the disparity and GP aspects of the stimulus answer = []; anstime = []; %% Initialize ...
d731e864ec241ceb811086c51a68471c70e74a660abf2528f0556f93eab9009e
MATLAB
16,882
337
%% jobRDA.m % This function describes an Osprey job defined in a MATLAB script. % % A valid Osprey job contains four distinct classes of items: % 1. basic information on the MRS sequence used % 2. several settings for data handling and modeling % 3. a list of MRS (and, optionally, structural imagi...