sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
087f96797a8ada466a680082be529604fbb9d7ae3093bd17d143f097eccea68c
MATLAB
3,827
114
function [hdr] = ft_fetch_header(data) % FT_FETCH_HEADER mimics the behavior of FT_READ_HEADER, but for a FieldTrip % raw data structure instead of a file on disk. % % Use as % hdr = ft_fetch_header(data) % % See also FT_READ_HEADER, FT_FETCH_DATA, FT_FETCH_EVENT % Copyright (C) 2008, Esther Meeuwissen % % This fil...
751bf8d70ebe312a9dfd129a834ecf9364b593aaac49232038b67d24c9207ea1
MATLAB
3,828
119
close all clear all clc %% compute choose connecting node for wrong answer %% show that this number is significantly larger than 0.5 exp_root = 'C:\Users\User\Documents\fMRI_EXP\'; root = 'C:\Users\User\Documents\fMRI_EXP\Alon\'; behvioural_analysis_codes = 'C:\Users\User\Documents\psychExpLaptopOld'; addpath(genpat...
e75797ecc6a7e10b086b46ac2d76a7e86973d8192d96a7305084858715fc4ea9
MATLAB
3,828
137
function [pairs,p_pairs,pairs_ref,meanvals_dat,meanvals] = ... PAIRS(fet_proc,kval,nset,saveops) %calculates projection angle of response similarity statistic % %INPUTS: % fet_proc: (nn x dim) features space for nn neurons, dim features. % should processed features with pca to have zero mean and diag co...
0bb106782c63a2beec45d44946d8fabf127260b5b73e32eb25a8e1cdba7ee8ab
MATLAB
3,829
112
function [RDM_fdtFolded_ltv, cv2RDM_fdt_sq] = fisherDiscrTRDM(Xa, Ya, Xb, Yb, condPredIs, RDMmask) % USAGE % [RDM_fdtFolded, sdRDM_fdt] = fisherDiscrTRDM(Xa, Ya, Xb, Yb[, condPredIs, RDMmask) % % % computes a lower-triangular vector of Linear Discriminat t-statistics % (RDM_fdtFolded_ltv) and a folded symmetric ...
bdce0ecf452dd3cbdb684ca759f61326e6524d1b36b3eae549da09013f35af91
MATLAB
3,829
128
%% bin10 mypath = '/Users/bo/Documents/data_liujia_lab/manuscript_gridcell3hz/analysis_liuP1_greeble'; fold1 = 3; fold2 = 12; num_bin = 9; timeFile = fopen([mypath, '/MRI_result_sinusoid/txt_barchart_',num2str(fold1),'_fold_effect_2025.txt'],'rt'); table_time = textscan(timeFile,'%s %s %s'); fclose(timeFile); data...
6da16a9dee1945826b40275d9c05e5e478d64b39f3d989b5d879da9000339fa9
MATLAB
3,830
132
% op_alignISIS.m % Jamie Near, McGill University 2014. % % USAGE: % [out,fs,phs]=op_alignISIS(in,tmax,initPars); % % DESCRIPTION: % Apply spectral registration to align ISIS subspectra prior to % subtraction. This is intended to be used prior to averaging, so that the % alignment can be performed independently for ...
b8cbc535af7f04562bb7d00b2f243853de20c4e499eda74334f064a47b926cb5
MATLAB
3,830
96
% STD_FINDSAMEICA - find groups of datasets with identical ICA decomposiotions % (search identical weight*sphere matrices) % % Usage: % >> clusters = std_findsameica(ALLEEG); % >> clusters = std_findsameica(ALLEEG,icathreshold); % Inputs: % ALLEEG - a vector of loaded EEG ...
bf46e5f58e8fd5eb739144ce5c867dc0ac68dfe245f217fd90e3ec70c91e7a0e
MATLAB
3,830
103
function [fitted_data] =improved_LFP_fit(name_of_data_file,epoch_length,fitting_range,frequency_resolution) %Find power spectra for each epoch and run 1/f fit for average spectra per animal % Output it a data structure with all spectra and fit information % Input is name of data file to analyze, length of epochs...
70aea0f891590aa1b3d65b4500a329f3fa7fa1bd33e387224064089473d61703
MATLAB
3,831
114
function [pulseCleanedTemplate, cpulse2ndGuess, averageHeartRateInSamples, verbose] = ... tapas_physio_get_cardiac_pulse_template(t, c, verbose, ... varargin) % determines cardiac template by a 2-pass peak detection and averaging of % closest matches to mean and refinements % % [pulseCleanedTemplate, cpulse2ndG...
99ac07687c75e6bb918b857ba20f96eb17ebb8b7b2af0c9eb5d1e1b93f50b144
MATLAB
3,831
88
function [sequence,shuffled] = ReplayScore(matrix,varargin) % ReplayScore % This is a structure wrapper which calls "FindReplayScore" % % USAGE % % [r,p,a,b,rShuffled,c,cShuffled,jump,jumpShuffled,maxJump, maxJumpShuffled] = ReplayScore(matrix,threshold,<options>); % % INPUT % % matrix probability matrix fo...
49b1c38eebaf7e470b369181ef2d925312be9d21bce74dbd0937d3bb3fe523e5
MATLAB
3,832
110
function [coordidx,D,scoords,vORr]= surfing_circleROI(coords,faces,centervertex_idx,radius,distancemetric,n2f) % Creates a circular region of interest (ROI) on the surface given a radius % % [coordidx,D,scoords]=surfing_circleROI(coords,faces,centervertex_idx,radius,distmetric,n2f) % INPUTS: % coords: 3xN coordi...
2c380a357afceba6f0be954d25f4f75356c2fdde979ad237469f3757d9e01ea3
MATLAB
3,833
82
function this = plot3d(this, varargin) % Plots 3 orthogonal sections (with CrossHair) of 3D image interactively % % Y = MrImage() % Y.plot3d(inputs) % % This is a method of class MrImage. % This method interfaces with the general 3d plot utility of tapas_uniqc_view3d, % offering similar capabilities in terms of dat...
ea1ede1f7bd74134c42e6a27cdf97a321755494528f21a22a61e1beaf11f0b26
MATLAB
3,834
83
% load anatomical data from the brainstorm_db folder, convert to MNI, % extrapolate to high res, make leadfield, save to bs_results for each % subject anat_folder = [BrainstormDbDir '/anat/']; data_folder = [BrainstormDbDir '/data/']; AD_dir =main_path; bs_dir = dir([anat_folder 'RSID*']); bs_names = {bs_dir.name}'...
2b4eb100a110f995218f4c9b51394dc255b935799158d8cd05ec8b5cf8526fcf
MATLAB
3,835
109
function figHandles = arrangeFigures(varargin) % ARRANGEFIGURES Arrange multiple figure windows in a grid % % Syntax: % arrangeFigures() % arrangeFigures('Name', Value, ...) % handles = arrangeFigures(...) % % Description: % Automatically arranges open figure windows in a grid layout. % % Inputs (Nam...
3ac6f52a457f58bbf1e663ccc8f45e0cf416969ea81b6876bdcab103c1c74278
MATLAB
3,836
111
function [lamda,dif_av,Data]=SolveEquations(op,rate,nt,dif,tp,T,K,SName,app,Cb,clim,NameMask) C0=app.Cin; f=app.DiffusionModel; ds2=app.ds.^2; S0 = app.S0; dt = app.dt; M = app.M; BC = app. bounds; alpha=app.Alpha.Value; aux=app.Aux.Value; freq=app.freq; %uni...
744b602765b83008a95e515928f17d06699e5bb80506e08cb0e171883bc41367
MATLAB
3,836
137
%fits a sample GLM %written by dlh, Oct. 2021 %runtime is about 15 mintes on a laptop, with hyperparameter search incl. %% add paths and set up load and save directories %redefine these for your local machine! %where the repo lives codedir = '/Users/dhocker/projects/constantinoplelab/published/ofc_glm/'; %where y...
d0062cc21d751de83dcb39cd3983006562d57e7f27ea9d941977f23fa526c1e2
MATLAB
3,836
151
clear all close all clc % Replace with your file name filename = 'Data\wt1\ROT1\2023-01-09_10_28_55_048_+0100\output.h5'; % Get physical constants speed_of_light = physconst('LightSpeed'); f_info= h5info(filename); % Not all measurements contain both radar channels % Check if channel 2 is available in this file ...
029d5c47948448cc2b500f1c1fd528fb129b6cdb773d1bbdd10f3c888be2308f
MATLAB
3,838
112
function [refShift, refFWHM] = osp_CrChoReferencing(dataToFit) %% [refShift, refFWHM] = osp_CrChoReferencing(dataToFit) % Calculates the reference shift and full-width half-maximum (FWHM) of a % spectrum according to the LCModel algorithm. The algorithm is described in: % S.W. Provencher, "Estimation of metab...
57371da36564cfe677b93bbf031219ef865307d82f923724515f3e8b2b752e5a
MATLAB
3,839
116
function Tmed = runMediation_simple_numeric_ageTOI_EIGC(EIG, T, sigAgeMask, outName) % EIG: [Nobs x Ncomp x Nep x Ntime] (soggetti, componenti, epoche, tempo) % T: table con almeno T.Age (numerico) e T.meanBIS % sigAgeMask: logical 3D con TRUE dove Age è significativo nel tempo. % Ammessi...
bd5a4c5e45c7eab6f91b887aed4ebf92a6a719791a575c3d21ebcb272b34432b
MATLAB
3,840
104
function glscf = CO_GLSCF(y, alpha, beta, tau) % CO_GLSCF The generalized linear self-correlation function of a time series. % % This function was introduced in Queiros and Moyano in Physica A, Vol. 383, pp. % 10--15 (2007) in the paper "Yet on statistical properties of traded volume: % Correlation and mutual informat...
831ccf96bce8ee72cbf558b5d025dab1452a9779964e81cbdd51156bf7adfa17
MATLAB
3,847
104
function initialize_display(hObject, eventdata, handles) % Remove anything currently in the axes cla(handles.contourWindow); cla(handles.detectionAxes); cla(handles.focusWindow); cla(handles.spectogramWindow); cla(handles.waveformWindow); % handles.data.currentcall = 1; handles.data.current_call_valid = true; handle...
5474673e25764e17eb5cac6464fed76b64364d3f7675b32192c5fc7720c62bb7
MATLAB
3,848
131
function plot_nodes_in_cortex_new (V) figure hold on % % PLOT CORTEX % cortex.path='C:\Users\dk00549\OneDrive - University of Surrey\Documents\Surrey\MATLAB\PluginsProgramsToolboxes\LEiDA-master\LEiDA\TIDES\Atlas\MNI152_T1_2mm_brain_mask.nii'; cortex.pial=mapPial(cortex.path); cortex.color=[0.9 0.9 0.9]; ...
a70e7326fa81ac771906fe0b4e2c48247060ebeef238d8412d655bfeb3e4cb3c
MATLAB
3,848
143
function a = circ_plot(alpha, format, formats, varargin) % % r = circ_plot(alpha, ...) % Plotting routines for circular data. % % Input: % alpha sample of angles in radians % [format specifies style of plot % pretty, histogram, density, [] % [formats standard matlab string for plot...
c6af196b6ff3956d6da6d38077758b9a6feae7bdbc95050ac783a9bdf2f17e55
MATLAB
3,850
102
function ChangeBinaryGain(filename,varargin) %ChangeBinaryGain - Change gain in a multiplexed binary file. % % USAGE % % ChangeBinaryGain(filename,<options>) % % filename file to read % <options> optional list of property-value pairs (see table below) % % =======================================...
df2a76a8062a97fa5c284bea29b7419810a9add83acb8b8244b29721fce5f82c
MATLAB
3,852
133
function [hdlMeanSem,hdlDots,hdlLeg] = meanErrPlotDots(data,varargin) % function [hdlMeanSem,hdlDots,hdlLeg] = meanErrPlotDots(data,varargin) % % Plots mean, all datapoints, and error in 3 possible forms: SEM, STD and % 95% CI. % Display variables marker = '__os^v><dph*'; linespec = 'ob'; errorType = 'CI'; % alternat...
efdd82a971b54c7bb3750c0e64ede3297f5661e5944117a1f5b68bbac60e1138
MATLAB
3,852
105
function hess = getHessian(problem, x, d, storedb, key) % Computes the Hessian of the cost function at x along d. % % function hess = getHessian(problem, x, d) % function hess = getHessian(problem, x, d, storedb) % function hess = getHessian(problem, x, d, storedb, key) % % Returns the Hessian at x along d of the cost ...
97f53f96e572275a9ded7ddf2571b992bed7135d361a224a2ffcfe7c2fb4f89a
MATLAB
3,853
117
function [uniqueEntries,numberOfOccurences,whereIdx] = countEntries(m,isRow, keepNaN) %COUNTENTRIES returns all unique entries (sorted) in the array m and how many times the respective entries occured % %SYNOPSIS [uniqueEntries,numberOfOccurences] = countEntries(m,isRow) % %INPUT m : any matrix (not cells or ...
beb27cc373c56908973a57426e1dd6f15b10397c27fcb27e23fdef0c47ec5c57
MATLAB
3,853
147
function slopeFit = plotChVals_linFit(params, dataStruct) % plots values per channels with a linear fit % returns slope of linear fits % (c) Jiri, Sep16 %% basic check nCh = size(dataStruct.yVals,2); assert(size(dataStruct.yVals,1) == size(dataStruct.xVals,1)); %% load 'H' load(params.storage.cacheFile, 'H'); %% y-...
3c5e23d12f56636cf003e02c96cadbac463fbfc50dbbaeeabda7d8b9e9fcbd71
MATLAB
3,854
125
function aaName = anatomicalArea_getName(atlasName, AA_list, H_ch, addLateralization, maxDist) % based on atlasName & assignments in header H, returns name of the assigned anatomical area aaName % works for multiple atlases (Yeo, Destrieux, neurologists labels = LabelsAK) % assignment is NOT case sensitive (Visual = vi...
64a95b19926d5edcd1aa03ec723add9b775d05f8ac04c1d0c426b4e8f930b13d
MATLAB
3,854
105
function [data, annotations, layer_numbers, layer_names, colours, colour_scheme] = RegionAnalysis_Unbiased(data, I, source, layer_numbers, layer_names) % by Julia Becker, 01/04/2020 %REGIONANALYSIS_UNBIASED User assigns ROIs without seeing the measurement %points % - annotations add up on top of each other (you ca...
ad8f77ae4ed81726164f4c745364afe7718b5a86393d477840b8a34f6297c9d8
MATLAB
3,854
100
function convertGallant(directory, stimuliType, dryRun) if ~exist('dryRun', 'var') dryRun = false; end if ~exist('stimuliType', 'var') stimuliType = 'NatRev'; end if ~exist('directory', 'var') directory = 'V2Data'; end fprintf('directory=%s, stimuliType=%s, dryRun=%b\n', directory, stimuliType, dryRun); add...
724f38bccfb3b63cba85632a65562bf2dbb044e72e5db8dacfb169be31b75177
MATLAB
3,856
129
% notes: inherit some from examples_fullanalysis2.m %%%%%%%%%%%%%%%%%%%%%%%%% Analyze, looping over subjects. % define totalnsdsessions = [40 40 32 30 40 32 40 30]; hemis = {'lh' 'rh'}; % do it alltvals = {}; for subjix=1:8 nn = totalnsdsessions(subjix); % load betas (b2, in PSC units) alldata = zeros(327684,...
a01821736fcea30608e49ead8ff638a63810f520e4da59149d0b0c185899d318
MATLAB
3,856
148
function nmri_combine_exports(inputExports,pathOut) %nmri_combine_exports(inputExports,pathOut) % Function to combine multiple (>=2) export EEG/MEG export directories % into a single one % % inputExports = cell array of paths to exports to combine % pathOut = new output path to be generated if ~exist('inputE...
0bcf8df84bca728e1cf03687fda977d26fd7ba3b5a310eab0b9890c49d769408
MATLAB
3,857
107
function [events,info] = FindSpikeTrains(spikes,varargin); %FindSpikeTrains - Split long spike trains into 'active' periods. % % Split spike trains into 'active' events in which consecutive spikes remain % in close temporal proximity. These events are separated by periods of % silence, cannot exceed a certain duration...
3ede46f95d7b6ebe3c8a44a920799d1b49888fad52d1080fc569f5b1b2043739
MATLAB
3,858
78
function [fit, FitResults, gof, output, op] = setup_fitting(Params,res_step,sz) %setup_fitting(Params 'struct', res_step 'double', sz 'double') % setup variables for fitted parameters % % Params : Parameter struct % res_step: idx for current step % sz : is the final matrix size fit = struct(); ...
c446b77086fc34ece064444633fce9eb06612940dbcd96164be0b1e71c6d4433
MATLAB
3,858
72
%% load libraries run('set_library_paths.m'); addpath(SPM_PATH); % per spm docs, do not genpath it addpath(genpath(CANLABTOOLS_PATH)); pattern_mask_dir = CANLABMASKS_PATH; % store in var bc called later addpath(genpath(pattern_mask_dir)); %% VARIABLES THAT MUST BE DEFINED BEFORE THE SCRIPT IS SOURCED % THIS SCRIPT IS ...
1a808f236e4274b7bf1ca39f5571ffa4011ad12be1530b3c7b735bdd6da42819
MATLAB
3,861
132
% gridSearch - Perform a grid search to find the best mu and sigma for the pSFT model % % Syntax % [best_params, best_sse] = gridSearch(init_params, fixed_params, which_search, param_bounds) % % Input Arguments % init_params – initial pSFT parameters % fixed_params – fixed parameters % which...
b764e587c627acd61495538ae642ed94f82693123824757e3247bd352d89f9a1
MATLAB
3,862
107
function PlotSync(synchronized,indices,varargin) %PlotSync - Plot successive occurrences of a multidimensional variable. % % Plot resynchronized samples such as spike rasters or successive evoked % potentials. % % USAGE % % PlotSync(synchronized,indices,<options>) % % synchronized synchronized <a href="matlab...
55f1d023428fc7a797e38857404ced806eaf8f1c4cc9519b384a4162cb8dd22d
MATLAB
3,864
123
function fig = ARTwarp_gui_csv_to_ctr % This function generates a graphical user interface to enter the % parameters for converting some .csv files to .ctr % Initialise the freqCol and Tempres as empty arrays so their UI fields % show as empty initially freqCol = []; tempres = []; % Get folder_name from the user fold...
70106c2c8b5977332cec34615c247082bc6c1f80a0d15944050fffbb0da3ea8a
MATLAB
3,865
111
function [iti,iti_npv,iti_pv,startTime] = getITI(S) % Calculates inter-trial interval and start time for each trial in a % session. SSS 05/2020 %INPUTS: % S = screened sessions from get_data (using poolRats to screen for % current criteria 05/2020) %OUTPUTS: % iti = cell for each session containing the ITI ...
a62b00e0ffd3bdef1fb3617035998d79c811b450b79b5b8722a6e9ed504434c0
MATLAB
3,866
107
function run_match_indegree_simulation(params, options) % RUN_MATCH_INDEGREE_SIMULATION - Run with in-degree matched connectivity % % H1 Line: Execute simulation with heterogeneous in-degrees % % Syntax: % run_match_indegree_simulation(params, options) % % Description: % Runs simulation where neurons have variable ...
3f22c21387d7086a1f02728981d327d5d187d4707e8ab93c9efefac2af98f024
MATLAB
3,867
105
function [data, annotations, layer_numbers, layer_names, colours, colour_scheme] = RegionAnalysis_Unbiased(data, I, source, layer_numbers, layer_names) % by Julia Becker, 01/04/2020 %REGIONANALYSIS_UNBIASED User assigns ROIs without seeing the measurement %points % - annotations add up on top of each other (you ca...
3af34b03add41554cc5d531d3109924c87f8fc13d1bd7b02db410c2886fff135
MATLAB
3,870
108
%op_iterativeWaterFilter.m %Georg Oeltzschner, Johns Hopkins University 2020. % % USAGE: % out=op_iterativeWaterFilter(out,wlim,Kinit,M,plot_bool); % % DESCRIPTION: % This function is a wrapper to attempt error-free water removal using % multiple instances of the op_removeWater function. This is necessary % because at...
3f5eb5447736a6d56254ef59ee6cdc5d30a47b7950e85dccb689445e27e0d575
MATLAB
3,870
132
function [ choice ] = nf_uidialog( cfg ) %make our own dialog functions, maybe this can avoid MAtlab freezing the %RDP interface on NMRI % this one based on a figure NOT the dialog interface if ~exist('cfg','var') cfg=[]; end if ~isfield(cfg,'title') cfg.title='Dialog Box'; end if ~isfiel...
a950cc9a402ecaec39a185b37bb9ff3d00b2c99ce2d8a13127d4073b9924084b
MATLAB
3,871
117
function [m,aprime,corr,far,misclass, mprop, statstable] = confusion_matrix(true,cla) % [m,aprime,corr,far,missclass, mprop, statstable] = confusion_matrix(true,cla) % % calculates a confusion matrix (m, mprop) and a-prime scores (AUC % effect size) from true class assignments (true) and estimated class assignments (cl...
5ec3e759cb43f4e49684f0412369b3062620f969602aadebdc9f73efac6e5171
MATLAB
3,872
98
function [net, info] = cnn_stn_cluttered_mnist(varargin) %CNN_STN_CLUTTERED_MNIST Demonstrates training a spatial transformer % The spatial transformer network (STN) is trained on the % cluttered MNIST dataset. run(fullfile(fileparts(mfilename('fullpath')),... '..', '..', 'matlab', 'vl_setupnn.m')) ; opts.data...
ebd5024ee746bf4ef478fc585035a8fddddd6b55165163b82e2cf51bf76d3321
MATLAB
3,872
94
function [results] = analysis03A(config) % Runs analysis 03A: Are human connectomes more emergent and/or better % performing than randomly connected reservoirs? Load results from % analysis01A and let the best individual from "sister" populations compete % (evaluate on a set of train/test data). Sister populations were...
10ad5a5fa2a7a3dda161e77ae80c7ad682e2574a646184ac155ac70e5537d334
MATLAB
3,876
145
function [avr] = read_besa_avr(filename) % READ_BESA_AVR reads average EEG data in BESA format % % Use as % [avr] = read_besa_avr(filename) % % This will return a structure with the header information in % avr.npnt % avr.tsb % avr.di % avr.sb % avr.sc % avr.Nchan (optional) % avr.label (optional) %...
71fb311a01dff8e3bd8f44865e29ef43d92c28031c08ec9c00252a6cee8d551e
MATLAB
3,876
98
function [ord,R,keepers] = BF_ClusterReorder(dataMatrix,distanceMetric,linkageMethod) % BF_ClusterReorder A clustered reordering of the rows of an input data matrix. % % Computes a reordering of the rows of an input data matrix (under a given % distance metric), placing similar rows close together in the output % p...
80639e2833adc0e59e9c1ef30e1f8f94ca8f5230ef68b39d3e42e06afa335043
MATLAB
3,878
124
function h = plotbarcounts(countmat,numplots,testregion,varargin) % function h = plotbarcounts(countmat,numplots,testregion,varargin) % case 'critical', critical = varargin{i+1};,index = index+2; % case 'title', mytitle = varargin{i+1};,i = i+2; % case 'legend', mylegend = varargin{i+1};,i = i+2; % case 'ylabel', myyla...
4458962303a2dbe6c9f1419e7e9281cfc48e24795f2d7aa798bfc5427deeb214
MATLAB
3,880
93
function [struct,filename] = getStruct(basepath,extension,fieldName) %getStruct - Load custom data extensions associated with a given session. % This is a helper function similar to CellExplorer's loadStruct. % If multiple .mat files match your query, the function will return % the first one (in alphabetical order). ...
f6cb9ff5e8178fa17835cb409128f79b4c6ed576c3170f5d0fd832aa28c415bd
MATLAB
3,880
99
% CORRECTFIT - correct fit using observed p-values. Use this function % if for some reason, the distribution of p values is % not uniform between 0 and 1 % % Usage: % >> [p phat pci zerofreq] = correctfit(pval, 'key', 'val'); % % Inputs: % pval - input p value % % Optional inputs: ...
b2eae57e80d3a2001990095e13105edf324795d50df26b348e3d7c7bae3bd059
MATLAB
3,884
120
function cost = getCost(problem, x, storedb, key) % Computes the cost function at x. % % function cost = getCost(problem, x) % function cost = getCost(problem, x, storedb) % function cost = getCost(problem, x, storedb, key) % % Returns the value at x of the cost function described in the problem % structure. % % stored...
ea886fe151de38e926ba27276b237f6a9600202deb2f1b9b2af4acd315c0104a
MATLAB
3,884
108
% setting parameters dt = 0.01; T_total = 1000; t = 0:dt:T_total; % Intrinsic angular velocities omega_A = 2 * pi / 22.7; % A: AVP % change here (22.7 -> 23.7) for Sup. Fig. 11d omega_B = 2 * pi / 24.3; % B: non-AVP (nA) % Parameter search ranges K_BtoA_values = linspace(0, 0.2, 41); % = K_nA_...
f7141527cafb66215e63e2ce9b158abc300980944b0deb52861dea81cdbeeb5e
MATLAB
3,885
109
function F = spm_Tcdf(x,v) % Cumulative Distribution Function (CDF) of Students t distribution % FORMAT p = spm_Tcdf(x,v) % % x - T-variate (Student's t has range (-Inf,Inf) % v - degrees of freedom (v>0, non-integer d.f. accepted) % F - CDF of Student's t-distribution with v degrees of freedom at points x %___________...
278e14b3476d07da5759d7452f6dd24ed2fadfcd42bd2ac8acf479b9142333e0
MATLAB
3,887
66
function [gui, MRSCont] = osp_processingWindow(gui,MRSCont) %% osp_processingWindow %This functions finds the handle to update the window in progress % % % USAGE: % osp_processingWindow(gui); % % INPUT: % gui = gui class containing all handles and the MRSCont % MRSCont = MRS co...
67c93c242bcf66fb8a5a041db030511099103ee4c4537f30f4aa79677e8319d8
MATLAB
3,887
112
function fitParams = readLCMFitParams(MRSCont, which, kk) % Fall back to defaults if not provided if nargin < 3 which = 'A'; if nargin < 2 kk = 1; if nargin < 1 error('ERROR: no input Osprey container specified. Aborting!!'); end end end % Determine output file strings...
74c31521ef3db7215c97bea7ded8304bc2e85d80fefe29a209b117db66197a5f
MATLAB
3,887
100
function h=plplot(x, xmin, alpha) % PLPLOT visualizes a power-law distributional model with empirical data. % Source: http://www.santafe.edu/~aaronc/powerlaws/ % % PLPLOT(x, xmin, alpha) plots (on log axes) the data contained in x % and a power-law distribution of the form p(x) ~ x^-alpha for % x >= xmin...
dea2d7215ef26b753b0bfff0a6ded5d9e7a47ab9b4e6bc94db087e5cdef41542
MATLAB
3,887
103
function [ nfe ] = vb_nfe( obj ) % Evaluate negative free energy for HUGE model given current parameter % estimates. % % This is a protected method of the tapas_Huge class. It cannot be called % from outside the class. % % Author: Yu Yao (yao@biomed.ee.ethz.ch) % Copyright (C) 2019 Translational Neuromodeling Unit %...
c32655d0a2f8b2e8a14346aefd46ea262101c0c6c976a94f5d0e0b0ad9064f29
MATLAB
3,888
162
function sol = prox_tv(b, gamma, param) % Start the time counter if ~isfield(param, 'tol'), param.tol = 10e-4; end if ~isfield(param, 'verbose'), param.verbose = 0; end if ~isfield(param, 'maxit'), param.maxit = 50; end if ~isfield(param, 'weights'), param.weights = [1, 1]; end [r, s] = gradient_op(b*0); pold = r; qol...
489af15f78378fa43c0bd2fafa15a67d3b2d2bc1f33bec9bc9436416fcb8bc8d
MATLAB
3,889
135
function tapas_uniqc_new_script(varargin) % Creates a new script (e.g. tests/examples) including header. % tapas_uniqc_new_script(funname) opens the editor and pastes the content % of a user-defined template into the file funname.m. % Note that the prefix tapas_uniqc_ is automatically added to the filename. % % Exa...
9801d18faf7e041b7eeb333ca4f3115a9ae1772baeee8f4533debab78429e391
MATLAB
3,889
85
classdef McsCmosFilterSource < handle % Holds the contents of a CMOS-MEA filter source % % The filters in the filter pipeline are stored in the Pipeline field % % (c) 2017 by Multi Channel Systems MCS GmbH properties (SetAccess = private) Pipeline = {}; % (cell array) The filters in the pipeline ...
c7d391e4c726f60ee97c24bf22f2211905efaee2cfcedf4a5cfd9d51f8d8cec7
MATLAB
3,889
104
clear; close; %specify ages to include in analysis ages = {'05', '08', '12', '18', '24'}; %specify other info about data tasks = {'hand', 'social'}; cohorts = {'gm', 'uk'}; % create empty table columnNames = {'ID', 'Cohort', 'Task', 'Age', 'Channels', 'ROI_SNR'}; variableTypes = {'string', 'string', 'string', 'doubl...
ef97533f22b4c4becd7f80daf758f834294701202e4e82d8727ff7b3be7df3ec
MATLAB
3,889
84
function [rgb hex] = wes_palettes(palettename) %colors = wes_palettes(palettename) %get color palettes from Wes Anderson movies. Available: % 'GrandBudapest', 'Moonrise', 'Royal', 'Moonrise2', 'Cavalcanti', % 'Royal2', 'GrandBudapest2', 'Moonrise3', 'Chevalier', 'Zissou', % 'FantasticFox', 'Darjeeling', 'Rushmore', 'Bo...
3bb2e3de7f1546c1f34b7102756f5775b30b2bbb1dd3ded356aed2d8115ee791
MATLAB
3,892
93
function pool_chnls2table(params, groupInfo) % writes a list of iEEG into Excel table % 1 row = 1 channel % (c) Jiri, Oct23 %% check if output dir exists if exist([params.storage.dir_results filesep params.storage.outName],'dir') ~= 7 error(['output directory for results not found, dir = ' params.storage.dir_resu...
352026e40fe47b545023a30acad4825601ae6bd72032367be700db500ce747ff
MATLAB
3,895
126
function plot_nodes_in_cortex_new (V) figure hold on % % PLOT CORTEX cortex.path='C:\Users\dk00549\OneDrive - University of Surrey\Documents\Surrey\MATLAB\PluginsProgramsToolboxes\LEiDA-master\LEiDA\TIDES\Atlas\MNI152_T1_2mm_brain_mask.nii'; cortex.pial=mapPial(cortex.path); cortex.color=[0.9 0.9 0.9]; corte...
5cabe1ec40e80baaeca552b1d6a2ae1b335ff31f5c816ce877228f58b01d9181
MATLAB
3,895
135
function [WTOpt, WTMdl, BlkInf, Belief, Kappa, Prior] =... GenerateSynthData_Bayes_subopt_onlylambda_nonflat(params, ratTrial,... noise_arg, gen_arg, noise_params) %GenerateSynthData_Bayes_subopt_onlylambda_nonflat - generates synthetic % wait times for Bayes SubOpt model with lambda over a WEAKLY INFORMATIVE ...
f15f08d465b5bb4f5fe3b9d94de2dc9659803b366382ee5c7601ecc14c9c1f0a
MATLAB
3,898
104
classdef MrCompare < MrCopyData % This class loads and compares different objects, e.g. images/rois % % EXAMPLE % MrCompare(imageArray, extraDimInfo) % % See also MrDimInfo MrImage % Author: Saskia Klein & Lars Kasper % Created: 2019-02-25 % Copyright (C) 2019 Institute f...
2a0a64ae684df561c1e86efe31794885a84380108fe565f31e6a25d09afc36b7
MATLAB
3,899
124
% op_get_Multispectra_LW.m % Helge Zoellner, Johns Hopkins University 2014. % % USAGE: % [FWHM]=op_get_Multispectra_LW(in); % % DESCRIPTION: % Estimates the linewidth of a reference peak in the spectrum. By default, % the reference peak is water, between 4.4 and 5.0 ppm. Two methods are % used to estimate the linewid...
3778e5ef15b04cae51b16b5242e0b7c27331fb9a1fb290ca33669f11fde1e542
MATLAB
3,900
126
function plot_nodes_in_cortex_SchaeferShen_2016ROI (V) figure hold on % % PLOT CORTEX cortex.path='C:\Users\dk818\OneDrive - Imperial College London\INS\TIrsfMRI_BrainStateTopologyAndDynamics\AtlasAndOtherInputs\MNI152_T1_2mm_brain_mask.nii'; cortex.pial=mapPial(cortex.path); cortex.color=[0.9 0.9 0.9]; cort...
58140fd5309c1ae14a9d4a69326bc22cffc4aa0cc54cb50d848bbb1b238417be
MATLAB
3,900
133
function [xc,mode] = XCorr1(x,y,varargin) %XCorr1 - Compute cross-correlograms and their modes for pairs of curves. % % USAGE % % [xc,mode] = XCorr1(x,y,<options>) % % x first set of curves (MxN matrix: M curves, N bins) % y second set of curves % <options> optional list of ...
616190cb59060614bf3402d591f58fce77dee61186434dd1ded1432da72ad27d
MATLAB
3,900
126
%%% Create Video and save it %%% function SaveVideo(Data,NameVideo,ECS,nt,rate,dt,originalTime,unitC,unitT,clim,Cbasal,fps,NameMask,MS) % Define scaling factors for time and concentration units scale=convertFromSIunit(unitC); scaleT=convertFromSIunit(unitT); % Convert basal concentration units fro...
b7ff3926e7daefdb5b0c46be117eb3c8124e44e5fea678f60679f533232cc38c
MATLAB
3,900
145
function signal=MPRAGEfunc(nimages,MPRAGE_tr,inversiontimes,nZslices,FLASH_tr,flipangle,sequence,T1s,varargin); if strcmp(sequence,'normal') normalsequence=true; waterexcitation=false; else normalsequence=false; waterexcitation=true; B0=7; FatWaterCSppm=3.3;% ppm gamma=42.576;%MHz/T pulseSpace=1/2...
1ca7389985bf3c5567db074a26d6bbff5830df8438a5cfb7a3d0c19586955ff6
MATLAB
3,903
193
function Pipeline_plotData(params, plt) % For plotting of general timeseries data analysisDir = getAnalysisDir(params); ExpInfoFn = getFileName(params, 'ExpInfo'); tsFn = getFileName(params, 'TS'); wsFn = getFileName(params, 'WSData'); load(fullfile(analysisDir, ExpInfoFn)); load(fullfile(analysisDir, ts...
59947dd02bd0e749c3dd574fe2467480232551bff4b6a85692182ab94fd05a91
MATLAB
3,904
156
function [err,ErrMessage, NameList] = zglobb (Identifiers, Opt) % % [err, ErrMessage, List] = zglobb (Identifiers, [Opt]) %or % [List] = zglobb (Identifiers, [Opt]) %Purpose: % returns the list of files specified in Identifiers % % %Input Parameters: % Identifiers is a cellstr identifying which briks to use % ...
47e562adfe2342cca7a0460fbadde9d696b1d2ea38c35cdbc8263fc433b57af5
MATLAB
3,907
101
%Global metrics % using subset1 as an example % For multicenter fitting, using multi_center_multimodelnlm_global.m instead of multimodelnlm_global.m % For multicenter fitting, network atrriobutes should be harmonized (Adj_site_effect.m) before using multi_center_multimodelnlm_global.m % % load graph theoritica...
4cc8dea9fc9671f2cc2490e888aac88f7eaa2068581a71c466f0f1ba67bbd96b
MATLAB
3,908
122
% CORRCOEF_CELL - compute pairwise correlations using arrays and % cell array inputs. % % Usage: % >> c = corrcoef_cell( data ); % >> c = corrcoef_cell( data ); % % Inputs: % data - [cell array] data consisting of PAIRED arrays to be compared. % The last dimension of emb...
0ec2c9b1abf5e1009310ca6e7b4d0fa58e63e65a719f02342487fb57e39f6bb0
MATLAB
3,909
112
function [varargout] = rfAnatVisInterp(interParams,varargin) if length(varargin) == 2 interpHSVA = 1; hsvImageMatrix = varargin{1}; alphaImageMatrix = varargin{2}; elseif length(varargin) == 1 interpHSVA = 0; valuesImageMatrix = varargin{1}; else error('(rfAnatVisInterp) Wrong number of varargi...
410761d4ee6dfc80b18348f4e4276b1653541166b3ba9c6f7241de4f95eeb292
MATLAB
3,909
119
function [spikeMatrix,spikeTimes,Params,Info] = formatSpikeTimes(File, ... Params, Info, spikeDataFolder, expMatData, electrodesToGround) % this function loads in the spike detection result and creates a % spike matrix and spike times structure for the chosen spike detection % method and chosen length of record...
766af7cd0f4f37565f8c26dc48eb20ca53c2cec23976d0ce8cc795b2acf96a1d
MATLAB
3,909
114
% assign circles to each point in a rectangle % for each point in the matirx, create a list of circle centers that it % belongs to % save the file at base path % filename = imagewidth_imageheight_radius.mat classdef assigncircles < handle properties width = 0 ; height = 0 ; radius...
906e543f03171948b3dad3a841364cbd743ccb8f04b40f16097bbaf63dc82161
MATLAB
3,910
130
function [c, r, t, cpulse] = tapas_physio_read_physlogfiles_custom(log_files, ... verbose) % reads out physiological time series and timing vector from custom-made logfiles % of peripheral cardiac monitoring (ECG % or pulse oximetry) % % [c, r, t, cpulse] = tapas_physio_read_physlogfiles_custom(logfiles) % % I...
ec760df44983264b29692413c8eedcf97287cdcecd82512522430d2978658617
MATLAB
3,910
82
% Main script for the SANDI analysis using random forest regression % % Reference: % Lee H, ..., Huang S, Communications Biology, 2026 % Based on Palombo M. et al. Neuroimage 2020: https://doi.org/10.1016/j.neuroimage.2020.116835 % % Requirements: % - SANDI-Matlab-Toolbox v1.0 (https://github.com/palombom/SANDI-Matlab-...
ff158dfaa638392d1c6349553b726cb4304141e81fbabf8aff677edb14edd029
MATLAB
3,910
74
% "surfing" toolbox for surface-based voxel selection, useful for % SURFace-based information mappING" of the cerebral cortex. % % Authors: Nikolaas N. oosterhof [NNO] <n.oosterhof@bangor.ac.uk> % Tobias Wiestler [TW] <tobias.wiestler.09@acl.ac.uk> % Joern Diedrichsen [JD] <j.diedri...
5cfe1f021bf001bf0f688ef1558026b8167708cb6df710770687bef05f1fcdde
MATLAB
3,911
111
function getTriggers_emoReco_stimuliTypes(params) % determines trials which contained the selected keyword (in params.thisCategory) % saves result into respective column of 'trials_events' in each sessionCacheFile % - rows = trials % - values = zeros (event not found) and ones (event found) % (c) Jiri, Mar16 disp...
f207460286f33aec90dad18a54184949cf30ad69dfe6d914f525505d48b622ec
MATLAB
3,912
112
function fast_rcnn_demo(varargin) %FAST_RCNN_DEMO Demonstrates Fast-RCNN % % Copyright (C) 2016 Abhishek Dutta and Hakan Bilen. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). run(fullfile(fileparts(mfilename('fullpa...
038ecf6a84a757ae256cb1964b648c261746bfb56f17057ff1387936f370ac87
MATLAB
3,914
114
function GenCocktailList(CodedVectors) % Function converts coded target and trial vector factor-dose % combinations that require testing (in numFact x numComb array V) and % output 'to test' list as excel spreadsheet. global numFact destRowWells destColWells numDose run CombList DoseList global Factors w...
fb3bfcb01bac8bc4d1944cfd9d3ff5e66ee1c86275f2e6e7fe0bc0ced7b30e15
MATLAB
3,916
112
function [err,XYZdic] = AFNI_Index2XYZcontinuous (Indx, Info, CoordCode) % % [err,XYZdic] = AFNI_Index2XYZcontinuous (Indx, Info, [CoordCode]) % %Purpose: % Change from voxel XYZindex (called Voxel Coords in AFNI) to XYZ in mm % The mm and voxel coordinates refer to the values displayed % on the top left corner...
44659db058949f1ea0baa9288ce89af8869edc7d7dc3a28168202261db574486
MATLAB
3,918
103
function [rt,intervalID] = RelativeTimes(t,intervals,values) %Relative times - compute the relative times of samples within intervals % For example, a sample with a timestamp in the middle of an interval % would have relative time 0.5. A sample that falls outside of the provided % intervals would return as NaN. Multip...
aa86b4d1d94963577dc8df2e20e754e398a86a22aaf357851377ade8a0b93c0a
MATLAB
3,919
138
function [ odorOrder, ORNOrder ] = GetBestOrder( data3D ) % use simulated annealing algorithm to find the order of ORN and odor to % gather the large responses close to the diagonal. %% design a punishment matrix [odorNum, ornNum, zDim] = size(data3D); pM = zeros(odorNum, ornNum); for i = 1: odorNum for j = 1: o...
d4e9960d60f47020a04bafdc0279feb966ac0d558b11b82bb1c714384789577f
MATLAB
3,919
137
%script Test_TellAfni % % % %Purpose: % % A script to demonstrate the use of the matlab AFNI driver tools (TellAfni). % Make sure no current AFNI session is running with the -yesplugouts option. % % The script is not fancy and some steps might go by too quickly but it should % be a simple read to figure it all ...
a27eae03125d9a3cf2648e0012dec422181256de08457b0e1f98cc920c3ff690
MATLAB
3,921
94
function params = initialize_network_parameters() % INITIALIZE_NETWORK_PARAMETERS - Set up default network parameters % % H1 Line: Initialize default parameters for spiking neural network % % Syntax: % params = initialize_network_parameters() % % Description: % Creates a structure containing all default parameters ...
de39af137598d45cf9c1bf175b3565b5f97fbdff7196db60b8ea4d4c0d3e6421
MATLAB
3,922
88
function placefield = place_field_dombeck(dFoT,ytrace,bins,movingAverage,... Foutfield,Finfield,minwidth,Ftransient,dFrelThresh) % Function to detect place fields according to Dombeck et al., 2010,2014. % Parameters: 'minwidth' in bins, 'dFabsThresh': minimum mean dF that must % occur in at least one bin in the...
83e0df48c422b4e48506292936a69747d1f6d55ce870a1b84b2cf1e4fd2d3be9
MATLAB
3,923
148
function plotTrials(params, trialsData) % plots values in 'trialsData' struct with fields: % yVals: [sample x ch x clz] % yErrs: [sample x ch x clz] -> optional (plotband) % xVals: x-Axis values (vector), typically time in [s] % info: struct with supplementary information % (c) Jiri, Jan11 (in whitenoise),...
9e1cacb5c4b0b4d49756f9a68bab405dd90e05719d84bfecf682854e9d03f040
MATLAB
3,923
111
function PlotExtendedData9(datadir, codedir) %PlotExtendedData9 - Plots Extended Data 4. % INPUTS: % datadir - Local directory where ProcessData_ExtendedData9.mat was saved after running ProcessData_ExtendedData9 % codedir - Local directory where code (e.g., published/EstrousRPE/) was saved %% Set up paths s = pa...
a4dca75ad616fcfb4eb975ab46cf54d54175129be6d128216ce827e2797e926d
MATLAB
3,923
99
function [dimInfoArray, sfxArray, selectionArray] = split(this, splitDims) % splits dimInfo along specified dimensions, creating an array of reduced % dimInfos and corresponding string suffixes for index-specific object naming % % Y = MrDimInfo() % Y.split(splitDims) % % This is a method of class MrDimInfo. % % IN ...
384f71c886c34631acebf2ab03ec2729c239aa27fcc9df455d7c48b599f53c0d
MATLAB
3,924
121
function [Y, I, J] = randswap(X, dimmode) % RANDSWAP - randomly swap elements of a matrix % % For vectors, Y = RANDSWAP(X) randomly swaps the elements of X. For % N-D matrices, RANDSWAP(X) randomly swaps the elements along the first % non-singleton dimension of X. % % RANDSWAP(X,DIM) randomly swaps the ...
33c17f1cf329a1002751eff37b582dcb62c3cd5230caf8c6c227965521e04987
MATLAB
3,925
136
% parse up the beliefs into a 2d discrete distribution function [output] = dSTR_decode_parsedata(varargin) %% general appraoch that should work for all cases % for each neuron, get the following % session_id % neurons' average firing over time (2s after reward) % p_mix and p_high for that trial % which bin it is in...
c97f08e90fc8c472828f7733f311a43a9e9f39b412937678d9b9422dd274ff31
MATLAB
3,925
141
function [h5cropIndex,imcropRect]=h5movieCropping(h5Path,varargin) options.BandPx=[3 25]; options.verbose=true; options.autoCropping=false; options.windowsize=1000; options.dataset='mov'; options.diary=true; options.diary_name='diary_crop'; options.processWholeMovie=true; disps('Starting movie cropping') if isstr...
e70406f27148901404754cf233a063207d806854b2609619fd93917e5393e20b
MATLAB
3,928
139
function [summaryLoading] = loading(allPaths,varargin) % converting two dcimg movies to h5 files and passing all metadata % this is a high-level functions outputting diagnostic data too! % % SYNTAX % [movieG,movieR,summary] = loadingMovies(dcimgpathG,dcimgpathR,varargin) % [movieG,movieR,summary] = loadingMovies(dcimgp...
0ffe380657d0f945f0e75f2ba6377b9c3c223d4f118ed428f68ac467bb2b041d
MATLAB
3,931
148
% Batch script for sparse prediction clear all % --- training method for variable sample size data method_id = 1; %case 1 linear_sparse_space_sw %case 2 linear_sparse_space_vec_sw %case 3 linear_sparse_stepwise_sw %case 4 linear_sparse_stepwise_em_sw % --- Basic Learning Parameters parm.Ntrain = 2000; % # ...