sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4af1bb9d929d0dfa28a27593e64a2d07dae71fbb58e25536b4f47b74b38c4953 | MATLAB | 7,610 | 162 | function test_compiled_version(varargin)
global CURRENTSTUDY CURRENTSET ALLEEG EEG STUDY
res = questdlg2('Are you seeing the command line outputs?', 'Compiled version', 'No', 'Yes', 'Yes');
if strcmpi(res, 'No')
res = questdlg2( [ 'Users need to be able to see command line' 10 ...
'output even for the comp... |
2c42df20dcfa3765b64ce7e0390cec3cf83831c74fae4c58efd78f106b912a36 | MATLAB | 7,612 | 273 | function [traj, infStates] = tapas_ehgf_binary(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_ehgf_binary(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in native ... |
81760891f88e19f6e9b7256990ce15da0f21c61e15619e13d13e1fd14276ed35 | MATLAB | 7,612 | 185 | function shuffle_icaReacCCG_dropHFO_baseCond(basename)
[rootPath,sesName,~]=fileparts(basename);
fprintf('%s load files for %s\n',datestr(now),sesName);
load(fullfile(rootPath,'data', [sesName '-icaReac.mat']))
load(fullfile(rootPath,'data', [sesName '.sleepstate.states.mat']))
load(fullfile(rootPath,'data', [sesName ... |
61f91262ffd96f741cff6305e3417adcb0eeec9e0a2a989aaf6f860ced4df7d7 | MATLAB | 7,614 | 175 | %% This file is used to differentiate 2 classes of surface-localized endocytic pits
clear all;
close all;
clc;
% Define folder paths and saving_path
folder_path = '\\E1-054867\Jinyu\20250926 DIV14 OE_Flot1_583 b2_647\Analysis\diat_regions\2 Type Puncta';
saving_path = fullfile(folder_path, '2 classes of surface-local... |
3ccf9c320efeb75a0e4ca0bcd612cfde77689a65460d7395a33282c298467b39 | MATLAB | 7,615 | 174 | function [offset,chai,log_spec,freqs,aperiodic,periodic,first_peak_params,second_peak_params] = st_fit_EEG(frequencies, spectrum, fitting_range, num_peaks)
%Function to fit 1/f to EEG data.
% Aperiodic component has 2 terms: offset and slope (chai)
% output gives the absolute, aperiodic, and periodic spectra ... |
4bc7d82dd88e4c517aa2a0a0b15969fc56d3ffa5269687da3318835ae219b3ee | MATLAB | 7,615 | 213 | % POP_PLOTDATA - Plot average of EEG channels or independent components in
% a rectangular array. Else, (over)plot single trials.
% Usage:
% >> avg = pop_plotdata(EEG, typeplot, indices, trials, title, singletrials, ydir, ylimits);
%
% Inputs:
% EEG - Input dataset
% typeplot - Type dat... |
95535379ad511cec0e716e9dd03ef72a26ba4a1d74dd0e00e1c06f481571ec7e | MATLAB | 7,617 | 183 | function [any_scanevent_repaired, ons, dur, index] ...
= tapas_physio_repair_scan_events_PHILIPS(ons, sqpar, verbose)
% repairs the temporal structure of the sequence of scan events
% (time-stamps when slice was acquired) by filling up holes of missing
% slice acquisition or volume acquisition starts
%
% USAGE
% ... |
840861be473449d363b2c8ede52e470559dbc2198327b24b8a42165bed0746e6 | MATLAB | 7,619 | 249 | function P = sammon(D, P, varargin)
%SAMMON Computes Sammon's mapping of a data set.
%
% P = sammon(D, P, [value], [mode], [alpha], [Mdist])
%
% P = sammon(D,2); % projection to 2-dim space
% P = sammon(sMap,3); % projects the codebook vectors
% P = sammon(sMap,3,[],[],[],Md) % uses distance matr... |
122b0a7981d5cbdcd0dfc06ac584ce2e042dedd46a92f723f3d2927bbc79053d | MATLAB | 7,621 | 211 | function [filename, headerfile, datafile] = dataset2files(filename, format)
% DATASET2FILES manages the filenames for the dataset, headerfile, datafile and eventfile
% and tries to maintain a consistent mapping between them for each of the known fileformats
%
% Use as
% [filename, headerfile, datafile] = dataset2fil... |
2d6bfa8326578e3a4310a8168a7ee328bfcc22c44ac3675137f55a0b8ab04f35 | MATLAB | 7,621 | 272 | function [traj, infStates] = tapas_ehgf_ar1_binary(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_ehgf_ar1_binary(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in... |
75ef7e016da2c9701ffd8b37dc65ae219741d8954099c576bd8a527780efe909 | MATLAB | 7,629 | 212 | % pop_dipfit_loreta() - localize ICA components using eLoreta
%
% Usage:
% >> EEGOUT = pop_dipfit_gridsearch( EEGIN ); % pop up interactive window
% >> EEGOUT = pop_dipfit_gridsearch( EEGIN, comps );
%
% Inputs:
% EEGIN - input dataset
% comps - [integer array] component indices
%
% Outputs:
% EEGOUT ... |
3da68a17d4c32026b47b84f24eff4186351f5052d23d2a3c787410e1be11c0df | MATLAB | 7,630 | 175 | function out = EN_DistributionEntropy(y, histOrKS, numBins, olremp)
% EN_DistributionEntropy Distributional entropy.
%
% Estimates of entropy from the distribution of a data vector. The
% distribution is estimated either using a histogram with numBins bins, or as a
% kernel-smoothed distribution, using the ksdensity... |
c6cd9f25ce272f43fb6ec5991f32eda5127db8520570efdb1b01d939a2d41050 | MATLAB | 7,632 | 65 | %Admin functions (adminfunc folder):
% <a href="matlab:helpwin abouteeglab">abouteeglab</a> - Script for compiled EEGLAB version about button...
% <a href="matlab:helpwin biosigpathfirst">biosigpathfirst</a> - Add BIOSIG at the beginning of the path...
% <a href="matlab:helpwin biosigpathlast">biosigpa... |
95ee0f2200bbf4adea7afa8d1636e708fd3adf3ddb82f9bb2452c170ac4d9c78 | MATLAB | 7,637 | 184 | % EPOCH - Extract epochs time locked to specified events from continuous EEG data.
%
% Usage:
% >> epocheddata = epoch( data, events, timelim);
% >> [epocheddata, newtime, indices, rerefevent, rereflatencies ] = ...
% epoch( data, events, timelim, 'key1', value1, ... );
%
% Inputs:
% data ... |
d9cfffa5c134f77e2374220fee9f9b916fc81a86f4f7615723dc82b8b5330c25 | MATLAB | 7,637 | 191 | function [hub_peripheral_xy, hub_metrics, hub_score_index] = ...
fcn_find_hubs_wu(channels, raster, adjM, fs)
percentile_threshold = 80; % percent
fr_thresh = 0.1; % Hz
makePlots = 0; % whether to make plots from this function (off for now)
% calculate nodal metrics based on Schroeter 2015... |
c281d6b5b13905626370ada95c5c113544df1e1c4e91316d9a2a5388a13e5eb1 | MATLAB | 7,643 | 123 | % userOptions --- The options struct.
% userOptions.analysisName
% A string which is prepended to the saved files.
% userOptions.rootPath
% A string describing the root path where files will be
% saved (inside crea... |
0cf4535175313490acd4c8d6ce7a8a8b660f523616e9dff5143455b1a3ca5a50 | MATLAB | 7,651 | 166 | function [OS, OSVersion] = detectOS
%DETECTOS Name and version number of the operating system.
% OS = DETECTOS returns the name of the operating system as one of the
% following character vectors: 'windows', 'macos' (which includes OS X),
% 'solaris', 'aix', or another Unix/Linux distro in all lowercase
% chara... |
4d4275bb0830ca69b70547b5278f7c1bde151de8473b63c7a53dc84053327afd | MATLAB | 7,653 | 185 | function c = tapas_ehgf_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the enhanced Hierarchical Gaussian Filter (eHGF)
% for continuous inputs.
%
% The HGF is the model introduced in
%
% Mathys C, Daunizeau J, Friston, KJ,... |
c645bc42cd11b2f2bf8887addb7d249f9235eabff6bccf34b4d30c10b2dab68d | MATLAB | 7,654 | 198 | function c = tapas_hgf_whichworld_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF) for binary inputs restricted
% to 3 levels, no drift, and no inputs at irregular intervals, in the absen... |
9d4ed276b50815d4ad5566ac3b61adc12a899f0cf74413f74cc6ab859306515f | MATLAB | 7,658 | 234 | function [metadata]=getRawMetadata(allPaths,varargin)
% [metadata]=getMetaData(folderpath)
% [metadata]=getMetaData(folderpath,'parameter',value,...)
%
% Created by Simon Haziza, Stanford University, 2019
% To Do > save the file name as well. Usefull for downstream analysis
%% SET ALL OPTIONS
[options]=metadataStructu... |
2ebeb14897361bc3b80bad5a323fea6dbdb82737f3835406db3e6c5e44203cad | MATLAB | 7,659 | 232 | function nsdfaceprf(subjix,p,q,rr,hhs)
% function nsdfaceprf(subjix,p,q,rr,hhs)
%
% For subject <subjix>, model <p>, version <q>, resampling <rr>, and <hhs> vector,
% try to find chunks to do, do them, and keep trying.
%
% Call analyzePRF on appropriate prepared data and save results of different chunks.
%% %%%%% S... |
4cd82ff60a7792f51d5738c63e3df3498683217cb5754aec6f9ece4fbf27254a | MATLAB | 7,665 | 244 | % EEGPLOTSOLD - display data in a clinical format without scrolling
%
% Usage:
% >> eegplotsold(data, srate, 'chanfile', 'title', ...
% yscaling, epoch, linecolor,xstart,vertmark)
%
% Inputs:
% data - data matrix (chans,frames)
% srate - EEG sampling rate in Hz (0 -> 256 Hz)
%... |
f2730ac282587f53f536d564bd89764bf85d8597507a29513a85b846aca5091f | MATLAB | 7,665 | 230 | function plotStats(statsTable, plotSaveFolder, Params, oneFigureHandle)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
pValThreshold = Params.pValThreshold;
% find metrics that were specified to be plot in settings
subsetMetrics = intersect(Params.networkLevelNetMetToPlot, statsTabl... |
e51693cb1593ca5b7f2a87931773bdefac3c69a7f12ff759cf0344883fd79781 | MATLAB | 7,667 | 140 | function osp_updatequantOvWindow(gui)
%% osp_updatequantOvWindow
% This function updates the quantify overview tab.
%
%
% USAGE:
% osp_updatequantOvWindow(gui);
%
% INPUT:
% gui = gui class containing all handles and the MRSCont
%
%
% AUTHORS:
% Dr. Helge Zoellner (John... |
ed74f6925be1766471e99866832d31804529752b5a14180ee7b631674e00a3c4 | MATLAB | 7,674 | 239 | function sR=icassoCluster(sR,varargin)
%function sR=icassoCluster(sR,['identifier1',value1,'identifier2',value2,...])
%
%PURPOSE
%
%To cluster the ICA estimates and to compute a relative clustering validity
%index (R-index)
%
%EXAMPLE OF BASIC USAGE
%
% sR=icassoCluster(sR);
%
%where sR is an Icasso result structure... |
74d471743a89fb7a33e5297fa7547c8cf2fc2289a7c403f3eac0cba525c193a5 | MATLAB | 7,677 | 188 | function [object] = ft_convert_units(object, target, varargin)
% FT_CONVERT_UNITS changes the geometrical dimension to the specified SI unit.
% The units of the input object is determined from the structure field
% object.unit, or is estimated based on the spatial extend of the structure,
% e.g. a volume conduction mo... |
b693e0ab1111730daf2f046e732817edde8a0b8934adbcf2d83f05336f4135c4 | MATLAB | 7,680 | 171 | %% jobTesting.m
% This function is a jobTesting.m file .
%
% 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) data files
% ... |
35a22c787ece962e61d63fa43ec64dc7e7d93fe07c5c63a09c7b904bd3ce5ab0 | MATLAB | 7,682 | 187 | % fig3_noGUI.m
% RF parameters:
% C/S size ratio: 1.5 : 11.4 deg (resulting center frequency: 0.04 cpd)
% surround amplitude: 0.8
clear
close all
% simulated response parameters
deltaFMax = 1;
noiseStd = 0.01;
smoothingSigmaVis = 0.44; % std of visual smoothing kernel, in deg
smoothingSigmaAnat = 0.0083; % std of an... |
c71eb95ca85f1a3884712354b335700e5463371289cb1a808b75d74fe084583d | MATLAB | 7,682 | 192 | function c = tapas_hgf_jget_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF) model for the jumping
% Gaussian estimation task (JGET).
%
% The HGF is the model introduced in
%
% Mathys C,... |
270599a1eb3ab5b91338ce2d9c125e05fee880810ebfb5f8bd3c8f3962e821e4 | MATLAB | 7,685 | 244 | % CHANPROJ - make a detailed plot of data returned from PLOTPROJ
% for given channel. Returns the data plotted.
% Usage:
% >> [chandata] = chanproj(projdata,chan);
% >> [chandata] = chanproj(projdata,chan,ncomps,framelist,limits,title,colors);
%
% Inputs:
% projdata = data returned from PLOTPROJ
%... |
4498bb82bd2e190239eba22f1163d4544395d2958a1dce6d2b7380710cb19e89 | MATLAB | 7,687 | 193 | function out = CO_Embed2_Shapes(y, tau, shape, r, theilerWin)
% CO_Embed2_Shapes Shape-based statistics in a 2-d embedding space
%
% Takes a shape and places it on each point in the two-dimensional time-delay
% embedding space sequentially. This function counts the points inside this shape
% as a function of time, and ... |
e4454555c1eabb3e2bb98455fc1a267e6d5d10646cc3357f82266078be04eb9c | MATLAB | 7,687 | 276 | function [traj, infStates] = tapas_ehgf_binary_pu(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_ehgf_binary(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in nati... |
888c1d5623153eea464bd386f09f12de302007d1db022b5f405b33c1d3b6eeb1 | MATLAB | 7,688 | 178 | function plot_all_surface(testregion,coordfile,testcondition,region,namecode,donumbers,varargin)
% plot_all_surface(testregion,coordfile,cdef,testcondition,region,namecode,donumbers,[opt] cdef)
%
% Here's how this works:
% You need to make a text file that has fields for x, y, and z elements, and a column to define
% ... |
ba5cbe8aa4729557064e51e515be27c388cf4d78788d1d503e0b966ce3572a70 | MATLAB | 7,697 | 165 | % POP_FINDMATCHINGCOMPS - Find components with the highest
% absolute scalp map correlation to components provided or tagged for
% rejection in another dataset.
%
% % Usage:
% >> OUTEEG = pop_findmatchingcomps( INEEG, 'key', val, . . . );
%
% Inputs:
% INEEG - Input dataset
%
%... |
1398cda601a02a611d995d065e5b649adb0856c09d81d76379f7ebbbf870c787 | MATLAB | 7,699 | 189 | % FORCELOCS - rotate location in 3-D so specified electrodes
% match specified locations.
% CAUTION: Only for use on electrodes in
% and remaining in the upper spherical hemisphere,
% otherwise it will work improperly. Written primarily for
% adjust... |
6e50ecb429ed2b083bb90e608fc9a5ca819c32eba898864f84a65e44020f5fdd | MATLAB | 7,701 | 247 | function Fig4Sup3b_pH_dFF_AllSensors(varargin)
% Fig4Sup3b_pH_dFF_AllSensors
% Plots ΔF/F vs pH for all sensors overlayed on a single plot.
% ΔF/F = (F_sat - F_apo) / F_apo
% Shows how GABA response magnitude changes with pH.
%
% USAGE:
% Fig4Sup3b_pH_dFF_AllSensors() % process all CSV files in current dir
% ... |
8bb7826cab02da0f1aae528a66306eceacf50f4e168db5faeaa6296fce5f03c6 | MATLAB | 7,704 | 195 | function [timelock] = ft_datatype_timelock(timelock, varargin)
% FT_DATATYPE_TIMELOCK describes the FieldTrip MATLAB structure for timelock data
%
% The timelock data structure represents averaged or non-averaged event-releted
% potentials (ERPs, in case of EEG) or ERFs (in case of MEG). This data structure is
% usual... |
39338842fc53415429fae54c557835f618e640aa2940a3b08ea9b5d331607b09 | MATLAB | 7,710 | 188 | function spectra = spectra_stft_sessions(params, trials)
% computes spectra for each trial using STFT
% trials =
% data: [3073x125x500 double]
% time: [3073x1 double]
% sessTime: [3073x500 double]
% labels: [1x500 double]
% sessNumber: [1x500 double]
% (c) Jiri, May16
disp('Comp... |
594a29b038a51d40ac56d867fedba2abca2444b0b507ef8d1d1237ccea1c5b33 | MATLAB | 7,711 | 205 | function outputImage = perform_unary_operation(this, functionHandle, ...
applicationDimensions, doApplicationLoopExplicitly)
% Performs unary operation (i.e. 1 input) on image for given dimension
%
% Y = MrImage()
% outputImage = perform_unary_operation(this, functionHandle, ...
% applicationDimensions)
%
% ... |
c241713f7bd5ed697f0a3cf4f2b392045283fc435739e72a93015d8968c07fab | MATLAB | 7,712 | 256 | function result = doxysearch(query,filename)
%DOXYSEARCH Search a query in a 'search.idx' file
% RESULT = DOXYSEARCH(QUERY,FILENAME) looks for request QUERY
% in FILENAME (Doxygen search.idx format) and returns a list of
% files responding to the request in RESULT.
%
% See also DOXYREAD, DOXYWRITE
% Copyright (C)... |
3256dfe1a5767e057854e6a66924d71d84c310de5a6643ab2a04466f34681adb | MATLAB | 7,714 | 191 | function ProcessData_Figure3(datadir, savedir, codedir)
%ProcessData_Figure3 - Process raw data saved under datadir such that it can be plotted by PlotFigure3.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_Figure3.mat' from Zenodo was saved
% codedir - Local directory where code (e.g., publishe... |
64b001553018ac69dc4d96929d20e982874a8e927b8f154235ab48c44aabea97 | MATLAB | 7,714 | 296 | function [vol, M, mr_parms, volsz] = load_mgh(fname,slices,frames,headeronly)
% [vol, M, mr_parms, volsz] = load_mgh(fname,<slices>,<frames>,<headeronly>)
%
% fname - path of the mgh file
%
% slices - list of one-based slice numbers to load. All
% slices are loaded if slices is not specified, or
% if slices... |
bc1fdf1edaf13213aa584a4cffeb1dfef1046b4bc8d51168105f99cd80140180 | MATLAB | 7,716 | 171 | %% jobMEGAPRESSrawdata_CI.m
% This function is a jobMEGAPRESSrawdata_CI.m file .
%
% 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... |
7754bff2565815ce2ee736258443eb09ca74fdec0b735d1b5e68f392c68de171 | MATLAB | 7,718 | 214 | function ni = niftiCreate(varargin)
%Initialize a nifti data structure used in Vistasoft
%
% This function should replace dtiWriteNiftiWrapper and niftiGetStruct
% Those are special cases. This function should create default nii, and
% allow setting the parameters using a (param,val) set of arguments in
% vararg... |
c80be1ef74a277c75d7662be2360037cdac87a25afbd3eb19c173740e00db8b0 | MATLAB | 7,720 | 185 | function tapas_BLT_runPredictionScale(params, iTrial)
% tapas_BLT_runPrediction is showing the prediction screen with scaled prediction between 0 and 100
screenw = 2*params.screen.xCenter;
screenh = 2*params.screen.yCenter;
% horizontal line
horizonLineh = screenh*0.008;
horizonLinew = screenw*0.6;
hori... |
461951cbe22201f55471f9078d11577dca6bef99503de18b969c85e446200b29 | MATLAB | 7,722 | 173 | function out = CO_AutoCorrX2Shape(y, maxLag)
% CO_AutoCorrX2Shape Shape of the time-reversibility profile of a time series.
%
% CO_AutoCorrX2 computes two asymmetric, 'leverage'-type lag-profiles:
%
% forward(tau): <x_t.x_{t+tau}^2> (signed value now, energy later)
% backward(tau): <x_t^2.x_{t+tau}> (energy ... |
e924df35907ff69fa670975eae5a7eb952e1dcbcfaa776ca78eeeb85659c60c3 | MATLAB | 7,723 | 203 | function [C2,cfg] = mahal_twoclass_trialwise2(dat,labels,cfg)
% [C2,cfg] = mahal_twoclass_trialwise2(dat,labels,cfg)
if nargin < 3
help mahal_twoclass_trialwise2
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,2); % number of M/EEG sensor... |
ab3515023fc2423bb280059234fcfedc764232e2c33d48091d299f64b3f2dfaa | MATLAB | 7,729 | 245 | function [plotData] = prep_plotData(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% prep_plotData prepares data for simulation plots. Data can be used by
% gen_SimFigures function to plot results. The files generated using this
% function can be used by prep_plotData function.
% ... |
6c63067056f9386403972c05dec414fabf27242c8c27973981c96c8801079ac8 | MATLAB | 7,731 | 195 | function info = step1RunSearchlightCrossModalAnatBoth(opt)
% Step 1 : running searchlight (SL)
% get the smoothing parameter for 4D map
funcFWHM = opt.funcFWHM;
% set output folder/name
savefileMat = fullfile(opt.pathOutput, ...
[opt.taskName, ...
'_SL_... |
fc8723d116db81a059552704ef1d362c185a9d5c4a41815bb7e850cb4d6661ba | MATLAB | 7,731 | 238 | function dm = mask2density(mask,radius,varargin)
% function dm = mask2density(mask,radius,[opt] searchmask, [opt] sphere_vol)
%
% mask is the mask with ones where activation points are
% radius is in voxels
%
% optional arguments:
% 1 searchmask
% searchmask is the whole brain search space [optional]
% Mask and sea... |
63d39f5f37aae3c143e4f805aa0f726336eec62d31228481c6d0b96417e78ec2 | MATLAB | 7,738 | 189 | function shuffle_icaReacCCG_exHFO_baseCond(basename)
[rootPath,sesName,~]=fileparts(basename);
fprintf('%s load files for %s\n',datestr(now),sesName);
load(fullfile(rootPath,'data',[sesName '-icaReac.mat']))
load(fullfile(rootPath,'data',[sesName '.sleepstate.states.mat']))
load(fullfile(rootPath,'data',[sesName '.ses... |
e8c2a1835905d4db82a60fb96527259fae8bebd8757df599a11055bff8089f34 | MATLAB | 7,740 | 207 | function [result, tracked, myelin, spatial] = main_function( ...
save_spatial, intervention, relapse_schedule, step_cap)
% MAIN_FUNCTION
%
% Runs a single stochastic simulation of the agent-based model.
%
% INPUTS:
% save_spatial - (logical) check if saving spatial data
% intervention - intervention pa... |
4770584a2b9f4d8d6df69c3c9a95836c781e20bae3934d3c9d92a529c6e14887 | MATLAB | 7,742 | 199 | function M = sympositivedefinitefactory(n)
% Manifold of n-by-n symmetric positive definite matrices with
% the bi-invariant geometry.
%
% function M = sympositivedefinitefactory(n)
%
% A point X on the manifold is represented as a symmetric positive definite
% matrix X (nxn). Tangent vectors are symmetric matrices of ... |
5284e5959d8aa0ca42672081116efbf22ac7e7b4427e3e881ae25235871d401e | MATLAB | 7,742 | 233 | function [ subject_status, subject ] = nmri_check_subject_status( subject , params )
%[ subject_status, subject ] = nmri_check_subject_status( subject )
% Will deterime if this subject is processed and return the flags
% check if subject struct is okay
if ~isfield(subject,'id') || ~isfield(subject,'exam_id') || ~isf... |
937b97413aaed47d7d9846764158b57b188118d0fe127da8c36ef82321251546 | MATLAB | 7,745 | 186 | function [outputImage, outputParameters] = apply_spm_method_on_many_4d_splits(this, ...
methodHandle, representationIndexArray, varargin)
% Applies SPM-related method of MrImageSpm4D to a higher-dimensional MrImage ...
% using representational 4D images as input to SPM to execute
% the method, runs a related method... |
757568f07c6b4503d3272af68620f5bb2c2d15d65f360f20fd2f1a72cce453c0 | MATLAB | 7,749 | 241 | %*************************************************************************%
%*************************************************************************%
%PreprocessData: Filter, whiten the raw data
%and provide if needed the pc projectionsused to initialize the template
%Simplified and commented by Madeny belkhiri 29/0... |
6fd91eaf79edfb191e80fa1ca753b3586300fb4aec74cf0b0651f29c31d23549 | MATLAB | 7,755 | 167 | function calculateCurrent = calculateCurrent(recordingData, pulseRange, mult, show_plots)
for iWave = 1:length(pulseRange)
wave = pulseRange(iWave);
% Assign cycPos
userData = getWave(['AD1_' num2str(wave)], 'UserData');
if mult == 1
cycPos = ['p' num2str(valueFromHeaderString('state.... |
067e107d35fc616a2e4dc1deb57a895a83567ff130e5bb4fa4f809a9c96f8b89 | MATLAB | 7,766 | 198 | function [tab_lo,tab_hi] = dominance_interaction(X,y,mdlspec)
%% function for conducitng domiance analysis based on multiple regression
% --- INPUT:
% X : matrix with columns holding the explanatory variables
% y : vector holding the response variable
% mdlspec : model terms in Wilkinson Notation (should h... |
5626b9b88a4b86e40f2c00c08a74506b3d2b380bd2f68420a83a54d0a0202a70 | MATLAB | 7,769 | 221 | function [stat,p,ci,stats,dist] = permuvartest(x,v,varargin)
%PERMUVARTEST Bootstrap-based one-sample test of variance.
% STAT = PERMUVARTEST(X,V) performs a one-sample bootstrap test based on
% the Chi-squared statistic of the the null hypothesis that the data in X
% come from a distribution with variance V, an... |
31381eb44fa3a84c489fe7b6b15ccfa418f1b63672f4127b094e9a833a0769f0 | MATLAB | 7,775 | 288 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add paths
currloc=string(pwd);
homeDir=('C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC');
% For outputs
str='\Outputs';
outputpath=strcat(homeDir,str);
ad... |
381a8d97e0522a2d535e103ff02fbbc533564e6c3c8297d1f30767724447712c | MATLAB | 7,781 | 188 | % fig4_noGUI.m
% RF parameters:
% C/S size ratio: 0.8 : 4.7 deg (resulting center frequency: 0.08 cpd)
% surround amplitude: 0.4
clear
close all
% simulated response parameters
deltaFMax = 1;
noiseStd = 0.01;
smoothingSigmaVis = 0.44; % std of visual smoothing kernel, in deg
smoothingSigmaAnat = 0.0083; % std of ana... |
566ec916d583cb662a72b84a36deddd157f3652fc7b92e07f68bb2a841aed666 | MATLAB | 7,783 | 171 | % This MATLAB script can be used to reproduce the hemodynamic response in dataset A (Figure 6)
% Please download BBCItoolbox to 'MyToolboxDir'
% Please download dataset to 'NirsMyDataDir' and 'EegMyDataDir'
% The authors would be grateful if published reports of research using this code
% (or a modified version, mainta... |
82b573b1afed1ae3276a78092f15cf3a7f9b5cd0bfa8697ea5c6c2a02f502ff9 | MATLAB | 7,791 | 194 | function out = MF_ResidualAnalysis(e, y, summaryLevel)
% MF_ResidualAnalysis Canonical summary of the residuals from a model fit.
%
% This is the shared residual-summary contract for hctsa's time-series model-fitting
% and forecasting operations. Every operation that produces a residual series should
% report it thro... |
88b886cef365553e662ff75715e9eb33a45e0afa3f571c7f777369c36fe233bf | MATLAB | 7,793 | 192 | function [data_table, log_parts] = tapas_physio_siemens_line2table(lineData, cardiacModality)
% transforms data line of Siemens log file (before linebreak after 5003
% signal for recording end) into table (sorting amplitude and trigger signals)
%
% data_table = tapas_physio_siemens_line2table(input)
%
% IN
% lineDa... |
a7f25b755339699c20b6d75c28a837af5c92ec1e1b5ebc9cc1beb01b53354589 | MATLAB | 7,795 | 197 | %% [chi] = Wrapper_QSM_FANSI(localField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of the data... |
80a089eb6419b71d69fd95c1e60e262acc2ef56c8174bc4271f0837fb04efd8d | MATLAB | 7,800 | 170 | %% jobTesting.m
% This function is a jobTesting.m file .
%
% 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) data files
% ... |
a5ee85125a5b8efaecc43e91fbf03767280ef9a9692d22a121c4244ee7a75b1b | MATLAB | 7,801 | 205 | function out = CO_AutoCorr(y, tau, whatMethod)
% CO_AutoCorr Compute the autocorrelation of an input time series
%
% ---INPUTS:
% y, a scalar time series column vector.
%
% tau, the time-delay. If tau is a scalar, returns autocorrelation for y at that
% lag. If tau is a vector, returns autocorrelations for y at... |
c838bf97b49ecb49ec29e87b631b2ee172a2e1a49e37d064ce67f837d17b45ae | MATLAB | 7,805 | 225 | function res = hlp_aggregatestructs(structs,defaultop,varargin)
% Aggregate structs (recursively), using the given combiner operations.
% Result = hlp_aggregatestructs(Structs,Default-Op,Field-Ops...)
%
% This results in a single 1x1 struct which has aggregated values in its fields (e.g., arrays,
% averages, etc.). Fo... |
e4c17ab232d4b2f4e8f12d353e2b6453d8fb75ef2ca058789c3ca06c9ed122eb | MATLAB | 7,812 | 273 | % COMPDSP - Display standard info figures for a data decomposition
% Creates four figure windows showing: Component amplitudes,
% scalp maps, activations and activation spectra.
% Usage:
% >> compdsp(data,weights,locfile,[srate],[title],[compnums],[amps],[act]);
%
% Inputs:
% data = d... |
6fb5939d795fd6956609e9d7b96c30128d54d0d1c4c36520f893c216a435e8c8 | MATLAB | 7,814 | 153 | % Main script for computing group-mean fsaverage surface maps of
% laminar SANDI metrics across subjects
%
% Reference:
% Lee H, ..., Huang S, Communications Biology, 2026
%
% Requirements:
% - FreeSurfer installed and configured
% - FreeSurfer recon-all completed for each subject
% - Subject-specific SANDI surface ov... |
c696b5dfd6ec92acd93fdc01318f694be3a25c7fb2acff50efcdc662d204198a | MATLAB | 7,830 | 208 | function [J,h,func_evals,f_0,E,S,F,X]=jacobianlim(func,x,varargin)
% JACOBIAN CALCULATION AS A LIMITING PROCESS
%
% evaluates the jacobian of a function func at point x as a converging
% limiting process. It respects bounds, can accept a baseline evaluation
% (e.g. f_0=func(x)), and will provide it f... |
f78e4d168e2437533e97156dc772b50f4807c1daccfecaef2e08be6e74bc290c | MATLAB | 7,830 | 265 | function [] = PlotFigure2(datadir, codedir)
%PlotFigure2 - Plots Figure 2. Must be run after ProcessData_Figure2.
% INPUTS:
% datadir - Directory where output from ProcessData_Figure2 was saved
% codedir - Directory of code (e.g., published/dynamic_learning_rate/)
%% Set Path and Load Data
s = pathsep;
pathStr = ... |
408157ea5dc0b49864cffd328ab77d2f2e9d555ffee77503ac5f0350c49abb04 | MATLAB | 7,834 | 225 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells. Fraction of cells are selected
% according to their phase suh that grid cells with closer phases are averaged within the same voxels
% and fraction that is selected randomly.
% n... |
1141d92c703964a999a6b3288c6e0031f733e7fd7c9c25cddbb1ee6c2d985206 | MATLAB | 7,838 | 277 | function [traj, infStates] = tapas_hgf_binary(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_hgf_binary(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in native sp... |
5f904e6f2c0281f9d1e81043c9f4c2937173512a2d41ba70f0a49ca87dfbc661 | MATLAB | 7,842 | 151 | function triggers = getTriggers_zeroMove(params)
% detects events of zero speed (pauses) as continuous data payches whose
% |velocity| < thr [std]
% pauses -> trials
% binned pauses -> classes
% (c) Jiri, Dec12
%% try to load the processed dataset
if ismember('triggers', who('-file', params.storage.cacheFile))
... |
09b738e608fa4a14be6329101bdecec537aca84c28729503da8d36970998301f | MATLAB | 7,843 | 178 | %*************************************************************************%
%*************************************************************************%
%fitTemplates: Detect spike and calculate the templates
%Simplified and commented by Madeny belkhiri 30/01/18.
%********************************************************... |
7aba4e8b800701cbcb0eb3a765fb638b3937f84e50bd79486fa6d2ff33f4b688 | MATLAB | 7,843 | 181 | function out = ST_LocalExtrema(y, howToWindow, n)
% ST_LocalExtrema How local maximums and minimums vary across the time series.
%
% Finds maximums and minimums within given segments of the time series and
% analyses the results.
%
% ---INPUTS:
% y, the input time series
%
% howToWindow, whether to use:
% (i) 'l'... |
2c1a8b59a91c330a7ce42900e8b4a503bb48db350139f18a9a9ba06b0f18d205 | MATLAB | 7,845 | 174 | function [hasSPM,OspreyVersion] = osp_Toolbox_Check (Module,ToolChecked)
%% [hasSPM] = osp_Toolbox_Check (Module,ToolChecked)
% This function checks the availabilty of the required MATLAB toolboxes
% and SPM versions. Adds the version number of Osprey.
%
% USAGE:
% [hasSPM] = osp_Toolbox_Check (Module,ToolCh... |
a3905a343fa0e0241661c977d1c2634ab727cf28ce189ef8ccd1e1e3988c2d3c | MATLAB | 7,848 | 205 | function [LR,all_SU,align_spikes]=getOpticalResponse_allcells(all_SU,all_S,all_index, win, which, bins, pt_choice)
% this finds the times of all spikes within the optical stimluation window
% input:
% all_SU = all cells that have optical stimulation
% all_pt = the pulse times of all animals
% all_index = the indexing o... |
aa3a3d50569823966c013f8dd80cdba907ae369ae815bbbe6b5493d76ec37538 | MATLAB | 7,851 | 208 | function PlotExtendedData6(datadir, codedir)
%PlotExtendedData6 - Plots Extended Data 4.
% INPUTS:
% datadir - Local directory where ProcessData_ExtendedData6.mat was saved after running ProcessData_ExtendedData6
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = pa... |
1314f46cfbbb41818c9429da4678b579bff31bdc87fb9f9a19f1874bcd38b6e7 | MATLAB | 7,853 | 210 | % function [ROL]= ROLbootstrap_NC(data,ROL_params)
% INPUTS:
% data: epoched data
% .wave: actual data
% .time: timepoint corresponding to each data pt
% .fsample: sampling rate
% params (see genROLparams_chao.m)
% Chao Zhang - LBCN: https://github.com/LBCN-Stanford/lbcn_preproc/blob/master/ROL/RO... |
e91f47ec80d39c21efc718acb8c8167180c37e89f666043c25ee7bd534c1187a | MATLAB | 7,855 | 278 | function [traj, infStates] = tapas_ehgf_binary_pu_tbt(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_ehgf_binary_pu_tbt(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vec... |
276408c718588231bcc0e98e78d1208fdf9e28b35636ff43f742759d14c9a785 | MATLAB | 7,859 | 232 | function [f,p,ci,stats,dist] = permuvartest2(x,y,varargin)
%PERMUVARTEST2 Unpaired two-sample permutation-based F-test.
% F = PERMUVARTEST2(X,Y) performs a two-sample permutation test based on
% the F-statistic of the null hypothesis that the data in X and Y come
% from distributions with equal variances, and re... |
8a6e05b2021a7e8dd9dace3455150dfd64a4233c96dda3d3d6320c2efa8f2fba | MATLAB | 7,888 | 200 | % generateRFSpace.m - generate an orientation-invariant receptive field in the space domain
%
% Usage: rf = generateRFSpace(fovPix,fovDeg,gaussSigma,xCenter,yCenter,g2_amp,theta)
%
% Input: fovPix - field of view containing the receptive field in pixels
% fovDeg - same as above in degrees of visual angle
% ... |
ba2af2370972c9fe364edef03ace8d06f62433977964a33eb162bbf03e57a52d | MATLAB | 7,890 | 232 | %% SortedPETH_Scripts
% Scripts for drawing and refining Peak Sorted PETH
load('..\AllUnitData.mat')
%output = loadAllUnitData();
output_PL = output(output.Area == "PL", :);
output_IL = output(output.Area == "IL", :);
addpath('..\FeatureImportance\');
ClassifyUnits;
loadxkcd;
%% Responsiveness calculation
unitData = ... |
ec1454f50031a45823201d3a65137fdfc188ee57422ab7c2c2a708aa1c39f7d4 | MATLAB | 7,891 | 194 | function [headmodel] = ft_datatype_headmodel(headmodel, varargin)
% FT_DATATYPE_HEADMODEL describes the FieldTrip MATLAB structure for a volume
% conduction model of the head that can be used for forward computations of the EEG
% potentials or the MEG fields. The volume conduction model represents the
% geometrical an... |
a67a7c450705f40b7fdeccc6a96b57a5fee41a412f24c4ca36fd32fd3f2b1953 | MATLAB | 7,898 | 202 | % pop_firpm() - Filter data using Parks-McClellan FIR filter
%
% Usage:
% >> [EEG, com, b] = pop_firpm(EEG); % pop-up window mode
% >> [EEG, com, b] = pop_firpm(EEG, 'key1', value1, 'key2', ...
% value2, 'keyn', valuen);
%
% Inputs:
% EEG - EEGLAB EEG structure
% 'fcutoff' -... |
77bee0db2ce29bb9447caf640c5c56c011d04d386e8cb528eef2ba3ce75e1732 | MATLAB | 7,900 | 229 | %
% Compute heart and respiratory rates in Hz.
%
% Parameters
% ----------
% participant: integral number
% Participant to process.
%
% Outputs
% -------
% The outputs are saved as .csv files.
%
% Author
% -------
% Ségolène M. R. Guérin
% March 11, 2025
% URePSSS, ULCO
%
function motimus_compute_hr_respi(particip... |
441b62a6bbe7cf137d9f1ad70cf389014d984eeebb137fc7033ab0747dd2dc43 | MATLAB | 7,903 | 225 | %% Non-negative least-squares (NNLS) using L-BFBS-B
%
% Non-negative least-squares solves the following problem:
% $$ \min_x \|Ax \textrm{--} b\|^2_2 \quad\textrm{such that}\quad x \ge 0 $$
%
% The matrix 'A' may have more columns than rows (the 'underdetermined' case),
% or more rows than columns (the 'overdeterm... |
592e8f5ba9113030fc3fbf885211472f37160fba90038aec93c616023e232634 | MATLAB | 7,903 | 177 | function [F, F1, F2] = generate_Gabor_filter(ori_map_V11, ori_map_V12, varargin)
% GENERATE_GABOR_FILTER Build population Gabor filters from two orientation maps.
%
% Syntax
% [F, F1, F2] = generate_Gabor_filter(ori_map_V11, ori_map_V12, Name,Value, ...)
%
% Description
% This function constructs bank(s) of Gabor... |
26ca55eb9e22426154fa1b59d293d72db0f3c581cc7b1e72702836b78341f5d6 | MATLAB | 7,908 | 191 | function shuffle_icaReacCCG_dropPfcRip_baseCond(basename)
[rootPath,sesName,~]=fileparts(basename);
fprintf('%s for %s started\n',mfilename,sesName)
fprintf('%s load files for %s\n',datestr(now),sesName);
load(fullfile(rootPath,'data', [sesName '-icaReac.mat']))
load(fullfile(rootPath,'data', [sesName '.sleepstate.stat... |
5d7f50892669063960832b789015df3c8908ab49db5b274f6678fef6bd05c587 | MATLAB | 7,915 | 183 | function ITIbyBlock = ITIbyBlock_estrous(f_ratlist, RatBehaviorData)
%Create variables
cycle = {'Proestrus', 'Estrus', 'Metestrus', 'Diestrus'};
nback = 7;
prctile_cutoff = 98;
frats = length(f_ratlist);
%Create functions
block_avg = @(x, blocks) arrayfun(@(y) mean(x(blocks==y), 'omitnan'), 1:3);
block_err = @(x, blo... |
c026af07452abf9bef6ec14137f571e80d7a7cd4b536b91eeb3038c80d51ff2f | MATLAB | 7,918 | 227 | function [OUT] = db_cluster_burt_table(clusters,fnames,DB)
% function [OUT] = db_cluster_burt_table(clusters,field list (cell array of strings),DB)
%
% tor wager
% Prints table of studies and lists whether they found activation in each cluster\
%
% warning: does not count separate CONTRASTS, just STUDIES.
% DB is a str... |
76dc298b10844e7e8f75636b5b43dcd6e04cfb9172c6dcb1e7fe62cbc32c6418 | MATLAB | 7,924 | 191 | function shuffle_icaReacCCG_exPfcRip_baseCond(basename)
[rootPath,sesName,~]=fileparts(basename);
fprintf('%s for %s started\n',mfilename,sesName)
fprintf('%s load files for %s\n',datestr(now),sesName);
load(fullfile(rootPath,'data',[sesName '-icaReac.mat']))
load(fullfile(rootPath,'data',[sesName '.sleepstate.states.m... |
8707955d77397388abc3c34806c1813aab0248ff9685bdd75a6e492be73f8dd7 | MATLAB | 7,924 | 190 | function spectra = spectra_stft_trials(params, trials)
% computes spectra for each trial using STFT
% trials =
% data: [3073x125x500 double]
% time: [3073x1 double]
% sessTime: [3073x500 double]
% labels: [1x500 double]
% sessNumber: [1x500 double]
% (c) Jiri, May16
display('Com... |
2c347fc0e26bbe7fdac3928e4299633964bcb432092a70a469d6bf4beb3aed9e | MATLAB | 7,925 | 183 | function [dimInfoCombined, indSamplingPointCombined] = combine(this, ...
dimInfoArray, combineDims, tolerance)
% Combines an array of dimInfos along a combination dimension or with
% pre-created selections
%
% Y = MrDimInfo()
% [dimInfoCombined, indSamplingPointCombined] = ...
% Y.combine(di... |
dbea945768d9b351dee891b0c720028602f06659493da689ee56747b9aa73716 | MATLAB | 7,925 | 157 | % STD_ERPIMAGEPLOT - Commandline function to plot cluster ERPimage or channel erpimage.
%
% Usage:
% >> [STUDY] = std_erpimageplot(STUDY, ALLEEG, key1, val1, key2, val2);
% >> [STUDY data times freqs pgroup pcond pinter] = ...
% std_erpimageplot(STUDY, ALLEEG ...);
% Inputs:
% STUDY - EEGLAB S... |
f4434b8f6c5b48061d4270718fb52ec7acba413ebde8b6c752c941eb821de2d6 | MATLAB | 7,925 | 237 | function run_permuglm_examples
%RUN_PERMUGLM_EXAMPLES Run permutation generalized linear model examples.
% Generates random multivariate binary data for a predictor sample X and
% dependent variables Y. Y contains 20 variables, each with a
% relationship of 0 to X, except for the first 5 variables which have a
%... |
b08d85c542c0ae71a89d8facb8cc49e624190e3d85431e88ca26fbe5b8e4c6a5 | MATLAB | 7,930 | 195 | % EEG_INSERTBOUND - insert boundary event in an EEG event structure.
%
% Usage:
% >> [eventout indnew] = eeg_insertbound( eventin, pnts, ...
% abslatency, duration);
% Required Inputs:
% eventin - EEGLAB event structure (EEG.event)
% pnts - data points i... |
30d9c57f1ba6134993e5ebd208af0e9feecde6020bf85c2f2e09441dffa42bfe | MATLAB | 7,943 | 210 | % eegfilt() - (high|low|band)-pass filter data using two-way least-squares
% FIR filtering. Optionally uses the window method instead of
% least-squares. Multiple data channels and epochs supported.
% Requires the MATLAB Signal Processing Toolbox.
% Usage:
% >> [smoothdata] = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.