sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2c3891a0fb28a687b0b36cdf286e8ab14d26656e8b699848448a27c3ba9bab6b
MATLAB
6,619
154
% PLOT THETA SEQUENCE SCORES PER LAP % MH 2020 % Load extracted averaged theta sequence scores per lap and session. Uses only unidirectional laps scores (so, merged both directions). % Each subplot is a different quantification method, where x axis represent laps and y axis are scores % Scores per lap are calculated us...
3273a1d51089669cf52362f0d9e4144d81791fde971a94da94067d30e98af50b
MATLAB
6,626
177
function [roiHSV,peakParameter,peakResponse,peakParameterStd,im,totalCells,mapData,roiHSVRescaled,peakResponseLabels,peakParameterStdLabels,cellper,pixROIs,mx,cutUp,cutDown,offset,traces,onsets,offsets,responses,responsesStd,prevFrame,eventDuration,params,plotRows,transpa,mapParams,fnameOut,hIm]=MapResponses(); [filena...
75788a198a6d71e369de563fb88d22e77d4b8677dc63bdffbf997373d8432be0
MATLAB
6,627
201
% [succeeded,outmatname,trx] = cadabra2ctrax(featname,roiname,moviename,[outmatname],[doflipup],[dofliplr],[rot]) % inputs cadabra mat file output names, loads in the trajectories, and % converts to ctrax trx format. these trx will be saved to the file % outmatname (user will be prompted for this name if none given). ...
e49d1b84eac798e844a9aba99fda1b0c25a4faf0af3ba83a935015354f0467f7
MATLAB
6,627
172
% Generate the control and IPD models model conditions with different conditions using the % function XomicsToMultipleModels. The current conditions are divided in 9 % groups: % % 1. Generic model: noLumpedRxns - wLumpedRxns % 2. cobraSolver: gurobi - ibm_cplex % 3. activeGenesApproach: deleteModelGenes - oneRxnP...
6fdf4f34fd84f6576be7e3837123939980e50134ae0876bca0ad399a35b47c9e
MATLAB
6,633
58
close all clear variables clc %Varun Mannam %date: taken from 29th Sep 2019 %date: 30th May 2020 %DnCNN model with diff lr in keras %calculate the PSNR on test-mix data raw nbn %new result with lr=1e-3 and diff LR values and weights initalization %new result with lr=1e-4 and diff LR values and weights initalization %...
954dc48ba5cbfb312d3153c6f9e9415d71aef827430c3a9647252f5f58e80ae1
MATLAB
6,634
116
% 1. c0001_d0001__dnSamp: Import, Update Channel Information and Downsample (=256 Hz) % FILES_SOURCE - output of dir() function in directory with files to be preprocessed % Brain Vision Recorder data EEG = pop_loadbv(FILES_SOURCE(ii).folder, FILES_SOURCE(ii).name); % sample Biosig data temp_refChan = 47; % 47 FCz tem...
e4281499696c55f796d30d6839fffb95406a56612caa671a55484b0bfe12d4fe
MATLAB
6,637
150
function [fNum] = plotF_df_SpacePlots(f_orcoAll,fNum,border) alldSpk = [];allSpk = [];allRPos = []; alldSpkSmooth = [];allSpkSmooth = []; dF_thresh = 20;F_thresh = 15; for g = 1:numel(f_orcoAll) f_orco = f_orcoAll{g}; gen = f_orco.id; hist = ceil(0.2.*f_orco.fs)-1;%200 ms history % calcu...
08e28f6ed92e5f48952c7e0ba69704e4bb54a9e91f5822facc183148c7aacffa
MATLAB
6,642
57
close all clear variables clc %Varun Mannam %date: taken from 29th Sep 2019 %date: 30th May 2020 %DnCNN model with diff lr in keras %calculate the PSNR on test-mix data raw nbn %new result with lr=1e-3 and diff LR values and weights initalization %new result with lr=1e-4 and diff LR values and weights initalization %...
502ef11b7f81cca6f4315ee5d6d6ba474708f425de8f9703a5fc9dc21f9f8eea
MATLAB
6,646
276
function [ err ] = mmwrite(filename,A,comment,field,precision) % % Function: mmwrite(filename,A,comment,field,precision) % % Writes the sparse or dense matrix A to a Matrix Market (MM) % formatted file. % % Required arguments: % % filename - destination file % % A - sp...
931499a8b3e36e02f3f2f072350c596d3e1fde93775f842b32cc525ed0e8863d
MATLAB
6,650
146
% Evaluation of S-BLIF model output in respect to the neurophysiological % data (Heffer et al., 2010) about influence of facilitation and accommodation on % onset-spiking probability when an auditory nerve fiber is stimulated with a pulsatile % stimulus. The details are given in Takanen and Seeber: “A Phenom...
a69f3febf18e51e2094cf5301612fe3e80c497c10a3f01a7914bceacc02b898e
MATLAB
6,653
138
function [bestDprimeSVM,bestRR,score] = diliCCAnested(stim,eeg,nCompStimAll,nCompEEGAll,shifts,prefixTmpFile) if ~exist('prefixTmpFile') prefixTmpFile = ''; end % Precalculating covariance matrices % disp('Pre-computing covariance matrices') % for iEEG = 1:length(nCompEEGAll) % ...
217e3e345ec887d9b605b94f790c881ff7dddee87ade776a739d41b4d1891d60
MATLAB
6,654
121
%% IR94 Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if isempty(strfind(path,'fieldtrip')); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = 'IR94'; SBJ_vars.raw_file = {'IR94_erro...
477686d8cb732e086047f4d363502cb85439d34a0e41653f07dcdc27705803d0
MATLAB
6,656
279
function ugibb = ugibb_form(pic, varargin) %function ugibb = ugibb_form(pic, [options]) %| %| form a "ugibb" structure from a 2D or 3D picture, %| of potential use for regularization with side information. %| Specifically can be used with ASPIRE 'ugibb' regularization option. %| See Fessler et al, IEEE Tr. Nuc. Scienc...
d086997bcf04ffbefb5c119579ed6ce57f744fd660fa486a11cdbceacfbe095a
MATLAB
6,656
174
close all; clear; load('U:\rg-yoshida\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\Space_bin_filt30Kalman.mat') load('U:\rg-yoshida\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\GLchc_epoch10.mat') load('U:\rg...
4a455bcbb78499d59d669c4f585c2334f7af5b5c78a14378e0d67c32f21dcb3b
MATLAB
6,658
188
% The script plots the averaged max firing rate of each run vs the velocity % For Time Cells and Distance Cells close all; clear global; load('G:\Dropbox (Personal)\Brain\Project\Paper\DataForPaper\AnalyzedData_Onset+5sec_100msBins.mat') Trials=[1:18]; TrialType = R(:,1); % 1-9 are fixed-Distance trials, 10...
729e83ed99da39189ea62b64673ce85664ef47dad4f8299075a22a03764165bb
MATLAB
6,660
185
function [vertices, label, colortable] = fs_read_annotation(filename, varargin) % % NAME % % function [vertices, label, colortable] = ... % read_annotation(filename [, verbosity]) % % ARGUMENTS % INPUT % filename string name of annotation file to read % ...
436d0393c8de3561d4f09b6e25c371f28cf0ef002ce3ea842a4ef5b3bed0604f
MATLAB
6,663
157
%% Script to visualize searchlight analysis results %% Load data suggested_fname = 'searchlight_results_S*R*_gen*.mat'; title_string = 'Select searchlight results to visualize.'; disp(title_string); [filename, filepath] = uigetfile(fullfile(get_data_path('path_type', 'output'), ... suggested_fname), title_string);...
4567b6d71f76a4da03eb53881477db16221af68148156fa8d8b1df7ac0987f2c
MATLAB
6,670
216
function [Acc, Y_hat, Score, Gini, features_names] = RandomForest_HER_validation(set1_avg, set1_var, set2_avg, set2_var, set3_avg, set3_var, Y_tst, time_onset, time_offset) % This function performs a Random Forest validation classification. This % function uses Random Forest console as implemented in: % https://code.go...
4a6b2ae1f63193ed1d01ee66bb36e7a8efe4f89947f0d43d4d1c767e7ca4df08
MATLAB
6,672
163
function [] = genDataSyntheticBootCIrand(nParallel,nEXP,nBoots,nTrials,Contrasts,p) % Generate synthetic data to investigate parametric inference in the model with respect to bootstrapping % Must be done in parallel in order to be completed in a reasonable timespan. %% INPUT % nParallel - number of cores (mu...
18ff3284a276f207d3cb3243c4aaeeb7696b70a02f50a8cb3ef2b07b807b0c3b
MATLAB
6,674
150
function [] = network_params_RMonly(binsize, maxlag) addpath(genpath('D:\kate_dropbox\Dropbox\Rutgers\Matlab - Rutgers\Firestein Lab\BCT\')); %parameters totaltime = 300; %options raster = 0; plotme = 0; extracalcs = 1; % *** change each time! *** % % chooseData = 2; %glu injury + BDNF recovery % *** ...
47601c357dc87fe881ddaa0fff203db3af1182aa2ca877161ddc0a4cdc14ff7d
MATLAB
6,676
177
function [f_orco] = getLeavingBoundaryParam(f_orco,fe,plotFig) % getLeavingBoundaryParam calculates the speed, curvature, and angle at % which flies leave the physical arena boundary % % Inputs: f_orco = fly object % fe = vector of first entry for each fly % % Output: f_orco = fly object updated with t...
c3307b6de45a8af2e97e4ca8255bf136355574e4da289422fa3e09cae4b1007b
MATLAB
6,680
181
function [params] = model_parameters(need_set) persistent params_p if nargin < 1 || ~need_set params = params_p; return; end params = struct; % Self-Repairing modulation of astrocyte params.SelfRepair = 1; % Active (1), Inactive (0) params.GluType = 2; % Type 1 Glu is...
409ef23a724d898ef177c49bf098271752a9d7a6165ad2086a4745045055aafc
MATLAB
6,689
251
function wbdcb(src,evnt) global nvr %nvr.curve_handle % % nvr.top_thresh_handle % nvr.bottom_thresh_handle if strcmp(get(src,'SelectionType'),'normal') nvr.thresh_pause =1; yd = get(nvr.thresh_handle,'YData'); threshold=mean(yd); xd = get(nvr.top_thresh_handle,'XData'); yd =...
698a98aef95938e1f45441a148e924cc86c5905102b6d503abd1e959188029d7
MATLAB
6,704
247
% combine gf & mm nn (newest) %% gf_vs_m clear all close all clc nrmz=10000; sp=1; %% load mouse-new (my) disp('mm-new') load('/bigdata/all_mouse_dataset/loom_nn.mat','mnn_matrix','mnn_genes','mnn_region','mnn_marker','mnn_location','mnn_cl','mnn_cln','mnn_id','mnn_dev','mnn_ts','mnn_nt','mnn_t3'); m_nt=mnn_nt; m_data...
7af021b353f5611a6ec05cbc326f9ed7930790e9860d5b0c839968848e64def2
MATLAB
6,704
203
function D = tnueeg_spm_eeg_spatial_confounds(S) %TNUEEG_SPM_EEG_SPATIAL_CONFOUNDS Modified SPM function. % This function defines spatial confounds and adds them to MEEG dataset. % FORMAT D = spm_eeg_spatial_confounds(S) % % S - optional input struct % fields of S: % D - MEEG object or filename of M/EE...
45136bc1b31eb2b8f7002d15da3bc761b64e58060f6dae13c50dfff87d1540fa
MATLAB
6,706
197
function [meta] = Initialize_Params(Destination_path) % clc % clear all; % close all; % Dataset = 'Dataset' % if ~exist(Dataset, 'dir') % mkdir(Dataset); % end addpath(genpath([pwd '/Util'])) addpath(genpath([pwd '/Subroutines'])) addpath(genpath([pwd '/Main Analysis'])) ...
fd904842aeee5a554413c6e226a6ae36ded64facd9d0e384da926250ab31ac9c
MATLAB
6,708
137
function lap_thetaseq_shuffles(computer) if isempty(computer) sessions = data_folders; elseif strcmp(computer,'GPU') sessions = data_folders_GPU; elseif strcmp(computer,'08') sessions = data_folders_08; end session_names = fieldnames(sessions); num_shuffles = 1000; for p = 1 : length(session_names...
abe5b97579e2813fc936232cc1e54364b5a921e87d6a793c4210500588e5101b
MATLAB
6,711
183
function varargout = IPEMReadSoundFile (varargin) % Usage: % [outSignal,outSampleFreq,outSize,outFile] = ... % IPEMReadSoundFile(inFileName,inFilePath,inSection,inPlotFlag) % % Description: % Reads (part of) a sound file into memory. % % Input arguments: % inFileName = name of the sound file (with ex...
8ddbac6b317d55b653b96b3d080feec9d5e94e9684cc373e8f8e9eef4661bc27
MATLAB
6,722
105
% BATCH ANALYSIS FOR REPLAY CONTROL FOR 1 LAP TRACK % MH_2020 % For 1 lap session, this code takes each lap from T1, calculate it's place fields and compares it to T2 1 LAP (e.g. ratemaps Lap 5 T1 vs Lap1 T2). % Then it used these new place fields to decode replay events, and runs the same shuffle analysis as for norma...
f314e147ec9da1b9c629482392a97f24c7bf732db556664a4a8eaccce1c8f3ce
MATLAB
6,725
341
function hh = cbar(varargin) %function hh = cbar(varargin) %| %| colorbar with options %| 'h' 'horiz' horizontal %| 'v' 'vert' vertical %| 'below' horizontal colorbar below current plot (jf) %| 'hide' make room for it, but hide it (invisible) %| 'fSIZE' font size %| 1d-array ytick %| 'notick' disable tick marks %| ...
6932927bb61fa2277f5ebbc304e4266c7f94d28d03a07d6d77311995d58fc94d
MATLAB
6,733
185
function [vertices, label, colortable] = Read_Brain_Annotation(filename, varargin) % % NAME % % function [vertices, label, colortable] = ... % read_annotation(filename [, verbosity]) % % ARGUMENTS % INPUT % filename string name of annotation file to read...
8def4f1a47ed6d6c15ff58fe6f43f9e2c8da4649744077b0ccb97fd7cd5698aa
MATLAB
6,733
180
function [baseline] = getBaselineKinematics2(f_orco,border,condNdx,key) % getBaselineKinematics2 calculates the speed, curvature, and duration of % each state instance that occur when the fly is experiencing baseline % firing rate. This is split between before first entry and after first % entry. % % Inputs: f...
b1889ed4bb4c260eb70249a13c58db87d34d2b1cdacdc29db0e89fbb14a8c313
MATLAB
6,735
146
% Evaluation of S-BLIF model output in respect to the neurophysiological % data (Hartmann and Klinke, 1990; Dynes and Delgutte, 1992; Miller et al., 2008) about % synchronization (vector-strength) between neuron's input and spiking output % as described in Takanen and Seeber: “A Phenomenological Model Repro...
732a4a07be5463660910219b0c71231f68dfbbc2436ba6424be79fc9efb9b0e8
MATLAB
6,737
142
function create_configs(varargin) % Expects to be run in the working directory % Remove old config files system('rm -f config*.m'); system('rm -f yeti_config.sh'); % guarantees folders exist system('mkdir -p job_logs'); system('mkdir -p results'); system('mkdir -p yeti_logs'); parser =...
30bb7e19f020742ba1b385145bb7b89603ee46c813b73d8e7b5456b10ac2ab69
MATLAB
6,742
182
% NOTE: this script is meant to be run with the matlab GUI to make figures clear all % Add package to read NPY files into matlab addpath('/Users/askeller/Documents/npy-matlab/') %% Get predicted scores -- NULL model (ADI only) % Load in prediction results folder_name='/Users/askeller/Documents/Kellernet_PrelimAna...
354b2295a2c4ac7927b9ff513cf2fbb5aae23530390d79ecd0326d975232396e
MATLAB
6,743
251
master_startup; saving = true; datapath = fullfile(path.data_save,'pbupsRT/'); filenames = get_reaction_time_filenames(datapath); [gamma, pokedR, T, RT, hits] = deal([]); nquantiles = 6; %% Initialize figure for plotting fig = figure('Name', 'data'); hold on; ax_rts = subplot(1,6,1); hold on; ax_pc = subplot(1,...
8cb64d71fb73cae583eb14726a1ac0693f99c4404c660bde3ab6719aa73af10b
MATLAB
6,746
202
%% Script to create output for Supp Fig. 2 - analysis of triangle lenghts % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Calculate length of outbound paths and visualize them in boxplots for % different groups % Preparing the data GLAMPI_PrepareBaseConfig % Preprocessing the data GLAMPI_PreprocessData ...
95bfbe3bd5a9b81b5099504cd19d65b1b397b82a61c912a87a292734892ddea0
MATLAB
6,750
237
function pot = potential_func(type, delta, param) %function pot = potential_func(type, delta, param) %| %| Define roughness penalty potential functions (using function handles). %| %| The penalty will have the form %| R(x) = sum_k w_k * potential_k([Cx]_k, delta_k) %| where w_k is provided elsewhere, not here! %| %| i...
de34cfa6d2b50d2ff8e9991958ba28dbb7ce55ab268d2c3ae55320604a1e3ff7
MATLAB
6,753
221
%| ir_mri_sensemap_admm_test %| A test script for the toolbox version of ir_mri_sensemap_admm. %| Note: This function is not optimized like the one in the paper %| (uses Fatrix etc.) so the test results will not match those published. %| %| See M.J. Allison et al., IEEE TMI, 32(3), 556-564, Mar. 2013. %| %| Copyright 2...
14fbae6faf89b5276ef370ece049d8113a707186128cfe41563da18b3b078785
MATLAB
6,759
136
function plots_bayesian_controls(computer) % Load name of data folders if strcmp(computer,'GPU') sessions = data_folders_GPU; session_names = fieldnames(sessions); else sessions = data_folders; session_names = fieldnames(sessions); end for p = 1 : length(session_names) folders = sessions.(sprint...
fb5cbd7ea24cafa7e96d03bc14951884402f38fddb178570cb8b8bd787aacffa
MATLAB
6,759
213
%% PLV Analysis % Compute the PLV between a seed motor electrode that explains most of the % behavioral variance and electrodes within frontal cortex % ########################################################################## % Input: % - cleaned and segmented data and HFA signal after ANOVA in order to % quanitfy w...
39787979488b424fa0b8b592ee0db6fe0bddd128974a1684b1b482bbf41dc9bf
MATLAB
6,760
195
% by Sathish Ramani function [xnew, CAL, TAL, EAL, ERR] = ... SENSERecon_ALP2(img, SP3, Data, recon_F, d, z, xnew, params) %% Compute SER at current estimate dispitr = params.dispitr; dispitrnum = params.dispitrnum; dispfig = params.dispfig; Npix = params.Npix; mn = params.mn; mx = params.mx; rs = params.rs; cs = pa...
b36b6f80e986f4724c84ba7a1d917b82567c63643358a6c96bba78d33499d32e
MATLAB
6,765
165
function [raftery_lewis] = rafteryLewis(runs,q,r,s) % function raftery_lewis(runs,q,r,s) % Computes the convergence diagnostics of Raftery and Lewis (1992), i.e. the % number of draws needed in MCMC to estimate the posterior cdf of the q-quantile % within an accuracy r with probability s % % Inputs: % - draws [n_dra...
5909aec9e4e18e0f65daccb18e47f55ec0ae3ddf5fe2fa46aac8523f7d7e0c0d
MATLAB
6,771
216
function [smap, sinit] = ir_mri_sensemap_admm_3D_linear(ykj, varargin) %function [smap, sinit] = ir_mri_sensemap_admm_3D_linear(ykj, [options]) %| %| Regularized estimation of sensitivity maps for parallel MRI %| using augmented Lagrangian methods with variable splitting. %| See M.J. Allison et al., IEEE TMI, 32(3), 5...
ce921ba8722b2dccab8ac7fd6ce5cc1498e593b977fd7b571f4f8edf33d58f07
MATLAB
6,774
140
function [] = agentModelHandle(genAll,meta,agentModelMeta,generateFlies) delay = agentModelMeta.delay; dur = agentModelMeta.dur; for g = 1:numel(genAll) gen = genAll{g}; for ii = 1:numel(dur) for jj = 1:numel(delay) currDur = dur(ii); currDelay = delay(jj); cond = ...
06247d3c8fd49eadee763e7a24a0baf5eca32a9a246036dbe3efe9839aea4090
MATLAB
6,779
163
function SBJ08b_HFA_plot_crRT_nANOVA_single(SBJ, elec_lab, an_id, stat_id, plt_id, save_fig, fig_vis, fig_ftype) % Plots ANOVA results % clear all; %close all; % fig_filetype = 'png'; if ischar(save_fig); save_fig = str2num(save_fig); end %% Data Preparation % Set up paths if exist('/home/knight/hoycw/','dir');root_di...
df19f9c768cfdb86f1c3fed4008f0f65ab082e25ba4413c6fb6e2def16333536
MATLAB
6,779
189
function [str, sts] = gencode_rvalue(item, cflag) % GENCODE_RVALUE Code for right hand side of MATLAB assignment % Generate the right hand side for a valid MATLAB variable % assignment. This function is a helper to GENCODE, but can be used on % its own to generate code for the following types of variables: % * scalar...
3eb9496c5ff78e22b1a0eea07410e99f68f020ccd1ebad6cfaae327d0ee624aa
MATLAB
6,784
197
function [Old_audio_buffer,Old_spikes_buff ]=draw_spikes(chans,thresh,pre_sipke,post_spike,seg_spikes,seg_spikes1,pre_seg,sr,AD_step,debug_flag1,OldEEG,Speaker,src1,Old_audio_buffer,Old_spikes_buff) % draw_spikes(chans,pre_sipke,post_spike,seg_spikes,pre_seg,sr,AD_step,debug_flag1); global nvr figure(100...
61d7757eda69bc86e44739d1d4b36c9fb26eff94db651ab6cd442e40f2fca519
MATLAB
6,787
290
function coef = bspline_1d_coef(fn, varargin) %function coef = bspline_1d_coef(fn, varargin) %| %| Given f[n], uniformly spaced samples of a 1D signal f(t), %| compute the bspline coefficients so that the following model interpolates: %| f(t) = \sum_{k=0}^{N-1} coef[k] b(t - k) %| %| in %| fn [N (L)] 1d signal(s) of ...
8f08968558d18ce855dd9a175fbc7663115c9eb3c26e487ef7a71ad1f16d6dae
MATLAB
6,793
241
function img = feldkamp(proj, window, mask, args, varargin) %function img = feldkamp(proj, window, mask, args, [options]) % % FBP reconstruction of cone-beam tomography data collected with % a circular source trajectory. % See feldkamp_example.m for example. % % in: % proj [nh,nv,na] cone-beam projectons (line integ...
e7ad422ec45410e2c88c16e68c1cc794ba97da0edcf2e979905188fb38dd4943
MATLAB
6,799
289
% qpwls_sps_example.m % % Complete example m-file illustrating QPWLS-SPS algorithm and its relatives. % % Copyright 1999-4, Jeff Fessler, The University of Michigan % % generate data % if ~isvar('yi'), disp 'setup qpwls_sps_example' em_wls_test_setup % wi = ones(size(wi)); warning 'uniform wi' % test circulant precon...
bde6303c5ac01d1e403bf0a62767181a9e5fa22826f4bc5c2a6fd69b7720b9c9
MATLAB
6,804
157
function [slope,pearson_rho] = findAttractorDynamics_figure(cells,save_figs,sf) % A functioning attractor network should preserve correlations between % pairs of cells. % E.g. So pairs of cells that are well correlated in trial 1 through 25 % should also be well correlated in trials 26 through 50 slope = nan; pearson...
996c1507e5d990908f618e1c06f10dafc6577b94b890bf97c028683ca360cdb8
MATLAB
6,805
142
function [negLogLik prWord_log] = hills2015_model_decay_softmax_hybrid_concat_wordECDF(best_params, obs); % SOFTMAX local search model (allows saliencies <= 0) % but allowing arbitration between lexical and semantic similarity in the 'activation' calculation % _concat version takes in the concatenated [LETTER, CATEGORY...
ec139f3af8f709671776caa8ce884781c3498267298ada39fecba8a021f66181
MATLAB
6,806
258
function st = nufft1_build(J, varargin) %function st = nufft1_build(J, [option]) %| Build 1D LS-NUFFT interpolation coefficients by brute force. %| %| in %| J neighborhood size: [-J/2,J/2] %| option %| om [M 1] frequency locations, if not provided build fine table %| N # of signal values (default: 2^8) %| K # of DF...
06a796379aaba655bb0e108de3c8b453f98ecd923160d53676b91cbf81b2f4f4
MATLAB
6,808
195
%% Script to create output for Supp Fig. 2 - analysis of time for completing outbound duration % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Display outbound path duration for different groups. % Calculate difference between group means. For details of how duration has % been calculated please refer to C...
0b801f9bf39ee20866ba076a72267e47f908009689b8cb655164def3acfa77b0
MATLAB
6,808
267
function h = c_subplot(varargin) % c_subplot - wrapper around subplot() with added features % Beyond normal subplot features and alternate input formats, adds a right-click context menu % option to "pop out" specific subplots into their own figure. % % Input can be: % c_subplot(numRows, numColumns, row, column) % or ...
27afc23bcefec0d759d84736d2f5efafe8c05b818a26271832b0ab6116626b7e
MATLAB
6,815
104
% AVERAGE THETA SEQUENCE PER LAP SIGNIFICANCE %MH 2020 % Compares average theta sequence scores to shuffles. Takes the 95% for each shuffle (pre spike train circ shuffle, position circ shuffle & time % bin suffle), and takes the maximum value between the three of them. A theta sequence will be significant if it's highe...
04b00c6efd9e9f64ad22a716a9a064ba178411bb3d840f2ba3fca19a4b88952c
MATLAB
6,824
193
function [CVA] = spm_cva(Y,X,X0,c,U) % Canonical Variate Analysis % FORMAT [CVA] = spm_cva(Y,X,X0,c,[U]) % Y - data % X - design % X0 - null space % c - contrast weights % U - dimension reduction (projection matrix) % % % CVA.c - contrast weights % CVA.X ...
bd8759341831afb1a865067fe0a4fd872e8221854ecb6e1b1ce4ab9f98bdf17c
MATLAB
6,828
238
function spm_DEM_qU(qU,pU) % displays conditional estimates of states (qU) % FORMAT spm_DEM_qU(qU,pU); % % qU.v{i} - causal states (V{1} = y = predicted response) % qU.x{i} - hidden states % qU.e{i} - prediction error % qU.C{N} - conditional covariance - [causal states] for N samples % qU.S{N} - conditio...
1ec9f4a0e464f94dfe661077feecb7b0f28b3b4c46ac13d2873ff6ea78063968
MATLAB
6,831
216
clc;clear;close all; root='..\'; addpath(genpath([root,'NeuralCorrelateEvidenceAcc'])) %% settings -------------------------------------------------------------- subdir='total'; clusterName='clusterArea_paper'; regCluster=1; if(regCluster) subdir=[subdir,'_',clusterName]; end type='evidence';% cp,dp,evidence all_u...
5da6d0ecec34270a2f339c813ed820259e6292b530e78982501e55d897ba7c16
MATLAB
6,838
186
function[]=BaSiC_shading_and_ref_stitch(id,P2path, datapath, ntiles, depth, thickness,stitch, aip_threshold, Xoverlap, Yoverlap) % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbssmic/s/Matlab_code/PSOC...
9e26d03628cf643d9624f2d670a0f38f9a974e107e68704cb78cfee6821e3573
MATLAB
6,850
195
function rezToPhy(rez, savePath) % pull out results from kilosort's rez to either return to workspace or to % save in the appropriate format for the phy GUI to run on. If you provide % a savePath it should be a folder, and you will need to have npy-matlab % available (https://github.com/kwikteam/npy-matlab) % spikeT...
71bb05f2f67b3cb8196b618b6143ee28933a0843fe71469b5b3ff55a82749121
MATLAB
6,851
201
function [f_orco] = getTransitionRate2(f_orco,plotFig) n = -5;%-2 deltaf = 1; deltaDf = 0.1; dSpk = f_orco.calcDeltaFR; % xGrid = [0:deltaf:50]; % yGrid = [-5:deltaDf:5]; xGrid = (-5:deltaDf:5).*f_orco.fs; yGrid = 0:deltaf:50; [XX,YY] = meshgrid(xGrid,yGrid); f = [-deltaf./2:deltaf:50+deltaf./2]; df = ...
08e79521ee197c764acbba8f3fa6d0f2c65906ad64bc0893cb90edc6a571b4c8
MATLAB
6,852
241
%Code for obtaining myonuclei and myocyte counts and density from %myogenin and DAPI nuclei staining. %Includes estimate of cell width clearvars -except MCmean0 %input image variables prompt = {'Pixel width (microns):','Day:','Position:','Enhancement factor:','image length:','Dilation factor:','% Myogenin threshol...
b6346a5feece60a1da6b39300191cc508aeea4a8f2d33ed5ad6c01be94f7192e
MATLAB
6,853
155
% This operator is only used for FAE calculation and not for the smoothing % of T2 distributions function Dstr = getSpatialDerivOperator3D_wt_MaskingGeneral(Filter, Sz, Mask_ROI, Resol) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % input: 3-D size of T2_Scale spectrum - nrows x ...
54473d4c71011a5f5206639a723c7cbb5d6598bfb5dd783bf5491a5ec1ba568c
MATLAB
6,855
181
% function MAP_fig_1_multi(mname,config) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NO...
06bb29d77a18874c4ade72c46d5635184e7a75396a1db5e927e85dc37429fa0c
MATLAB
6,861
181
%% Plot Figure g and h %% Define Paths of Loading Files and Save Files currentFolder = mfilename('fullpath'); % determine the filepath based on where the script locates scriptFN = mfilename; filePath = erase(erase(currentFolder, scriptFN), strcat('scripts', filesep)); searchPath = strcat(filePath, 'data', filesep, 'Fi...
52e0b645fb4ac4a322c274ee6efbc7f74a8d83cb672399e6ec711fe0f1b055ac
MATLAB
6,868
207
%%load data dataset = load('/Users/KeiMasuda/Desktop/fkm_analysis/AA_190830_1_0927_baseline+ketamine.mat'); % dataset = load('/Users/KeiMasuda/Desktop/fkm_analysis/AA_190709_2_0812_baseline+ketamine.mat'); % dataset = load('/Users/KeiMasuda/Desktop/fkm_analysis/AA_190709_4_RSC_baseline+ketamine.mat'); %% compute metric...
2023d3b3db02c1fea3b969822f096cb640cb87f05b44b55ca938cd5e4420a871
MATLAB
6,870
189
function SBJ08c_HFA_grp_errbar_ROI_nANOVA(SBJs,stat_id,proc_id,an_id,atlas_id,roi_id,... plot_scat,save_fig,fig_vis,fig_ftype) % Load HFA analysis results for active, RT correlation, and ANOVA epochs % RT correlation: any significance in stat_lim % ANOVA factors: any signif...
14082fa86d74d2e1555381a73762655ebf293cc4d73ddd3d56c3f908fdf7dbb9
MATLAB
6,877
256
% Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for % 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t]. % Optional parameters can also be included, such as: voxel_size, % origin, datatype, and description. % % Once the NIfTI structure is made, it can be saved into NIfTI fil...
1e9e898780a86e9706195cf8e3863548b9e54c8d72054ceec589edb47cc0351d
MATLAB
6,880
197
function [signal, accept, typeeeg, rt, response, chan_names, pnts, nsweeps, rate, xmin, xmax]=loadeeg( FILENAME, chanlist, TrialList, typerange, acceptype, rtrange, responsetype) % usage [signal, accept, typeeeg, rt, response, chan_names, pnts, nsweeps, rate, xmin, xmax]=loadeeg( FILENAME, chanlist, TrialList, typeran...
cd68d9bd8c7c3fb57dc073034c37e84915106643a95e3005552ca4b4e4f69e4b
MATLAB
6,880
215
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
62161d6211a853e3f59643ec1db88125f0a2898a513f30ff94d843949f92bdde
MATLAB
6,884
155
function dth_pseudotrials_SVM_full_experiment_cross_validated(subject,task) %DTH_PSEUDOTRIALS_SVM_FULL_EXPERIMENT_CROSS_VALIDATED Performs the distance-to-hyperplane analysis using SVM on %a balanced dataset. Instead of creating pseudoconditions out of scenes, %the trials from across conditions are lumped into pseudotr...
eaf17fab371827f72ee212d8236fc60c802c15b0a60f315567363a6db54be92a
MATLAB
6,885
145
%{ HOW TO USE THIS TEMPLATE Edit only the three ZONE blocks below: ZONE 1 set numVar, your parameter labels, and optional default values ZONE 2 unpack your parameters from UserVar ZONE 3 write your detection method and fill the outputs Everything else is handled for you by createPluginFigure. Opti...
a2b7ed1b540019a52bbfb436d0ae54785cb6a2e1f1c58080de45699067b6763e
MATLAB
6,886
191
function paths_added = DEV_INITIALIZE(varargin) % SYNTAX: paths_added = DEV_INITIALIZE(varargin) % % METHOD: This script is used for project management in matlab. It is % placed in the base folder of a matlab project and when executed will % initialize it for development. % % Initialization Step include: % 1. Reset...
bf7f5ed1b1aaec78a23d96a9a95d259bed98e2484dac0edb3bd6e98b01c4acbc
MATLAB
6,888
180
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); listname=['targetRight']; cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{1}],[cn1{2}]}; condnames=li...
0a587577d1ea75dbb47d23886bfd673b1ec8873d3e2ad2630ae0940d63ef2f5b
MATLAB
6,891
228
clear all; FileNum = 2:10; zf_true0 = (0:50:490); zf_true = zf_true0(FileNum-1); load('/space/vault/3/users/Hui/ThorlabsCalibration_101416/sensitivity_10x/rolloff'); Rolloff = (rolloff); % 1.1; 1.1; 1.1; 0.95; 0.9; SubPath = 'Dil5/'; FileMus = 2; zoff1 = 30; for ii = 1:length(FileNum) load(strcat([SubPath 'dBI_...
9ae69a20779222083a43d193f032313035149c31107a5e3a55be8dbac7d4bcfc
MATLAB
6,892
165
function trial = getBasicInformation % Returns a struct with basic information about the experimental % computer, the user, the date and time when the experiment was % started, and the software versions in use. Pass this struct into your % saved result so that the recording is self-documenting -- months or % years late...
7c6198fbad8d556feaf6ac340f1b250d0f4b88369c7c00c526c801f63af3ce52
MATLAB
6,897
213
function varargout = spm_colourmap(varargin) % Colourmap multi-function % FORMAT map = spm_colourmap % Return the colourmap of the current figure as a three-column matrix of % RGB triplets (between 0.0 and 1.0). % % FORMAT [map =] spm_colourmap(map) % Define a colourmap or set it to the current figure. % map - ...
a7037a6bc31f8c73e576d18ad26c7046984dfd3286790cb27e5be9e0291dc948
MATLAB
6,903
149
function loop_str = fun_analysis_get_loops_in_graph_by_link_label(graph_str, link_label, distance_type) % fun_analysis_get_loops_in_graph finds loops for the specified link in the % graph and compute loop length % Input: % graph_str: structure generated by fun_analysis_get_connectivity_graph % link_label: numerica...
3aadd8e35b50d2d179376fa6a887c6b92af59db664103eeed57925584ced3c83
MATLAB
6,911
193
%% Load simulation results subjects = {''}; results_folder = fullfile('simulations_FC6_TP8-P8_FC5_TP7-P7', 'fsavg_overlays'); fsavg_msh_name = '_TDCS_1_scalar_fsavg.msh'; field_name = 'E_normal'; fields = {}; for i = 1:length(subjects) sub = subjects{i}; % load mesh with results transformed to fsaverage space ...
ae5cb85bcab2efa9c4bf5d9c5e0149b8a49e6f7d83a0c5bc3ff208b3142fdd4b
MATLAB
6,912
159
function [TPP, half_laps_times] = phase_precession_absolute_location load('extracted_CSC.mat') load('extracted_place_fields.mat') load('extracted_clusters.mat') load('extracted_position.mat') load('extracted_laps.mat') %Get timestamps for each half lap half_laps_times = extract_running_laps(position,lap_times); ...
7ff577adc7390154012baca87a36edd23e8e213030bbe9ec90a6421ac2353223
MATLAB
6,915
286
function varargout=notBoxPlot(y,x,jitter,style) % notBoxPlot - Doesn't plot box plots! % % function notBoxPlot(y,x,jitter,style) % % % Purpose % An alternative to a box plot, where the focus is on showing raw % data. Plots columns of y as different groups located at points % along the x axis defined by the optional vec...
e0009de6623b62e6057f8fa2ac4d2098954382d196571f830c8c6e93ae63e0f6
MATLAB
6,920
166
%% PC1 - test in subsample A (Discovery) clear all % note: the coefs matrix is 1010004 (weights at each of 59,412 vertices for each of 17 networks) coefs = load('/Users/askeller/Documents/Kellernet_PrelimAnalysis/RidgeResults/results_matchedsamples_081822/all_network/thompson_PC1_coefs_testA.mat'); coefs = coefs.PC1_...
fd9e3a9c79d2fd31d8319c1c0048d79d7169275a5ef3bab7167082e2caabcf01
MATLAB
6,921
214
% input-outptu TF: cortex-HC clear all; close all;clc subj = '39' % load data cd ( ['/media/SSanDra/Pattern_Separation/subj_' subj ]) load(['behavior_subj' subj '.mat']) load(['trial_data_subj_onset_' subj '_select_chan_3.mat']) load(['baseline_info_wavelet_32num_20logdb_3hz_350hz_notched_artifact_reject_subj_' subj '...
5198533f118e2b94bdb7f38fde50238d6aad3785cd6bf352b5f2580045d2d77a
MATLAB
6,932
224
function spm_plot_ci(E,C,x,j,s) % Plot mean and conditional confidence intervals % FORMAT spm_plot_ci(E,C,x,j,s) % E - expectation (structure or array) % C - variance or covariance (structure or array) % x - domain % j - rows of E to plot % s - string to specify plot type:e.g. '--r' or 'exp' % % If E is a row vector wi...
fe7aedc2b244e3918265910eb7783b5a934c02d335fa58116addafc41ffe53df
MATLAB
6,940
262
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% 4-level multiresulution nonrigid image registration with Jacobian penalty %% Conjugate gradient with Newton's first step was used %% Cubic B-spline bases are used for both image and deformation models %% %% Copyright April 2008, ...
ebe0ed20361f4d066741c7a6c0e519c4b3c6ee9bc9f2eebd860ff498436457b1
MATLAB
6,942
241
%Code for obtaining myonuclei and myocyte counts and density from %myogenin and DAPI nuclei staining. %Includes estimate of cell width clearvars -except MCmean0 %input image variables prompt = {'Pixel width (microns):','Day:','Position:','Enhancement factor:','image length:','Dilation factor:','% Pericentrin thres...
7b7f2f0e7a2fa3b7c2ea8a9508de2f4004d8aad390e0ecbd97952790123a62c2
MATLAB
6,947
197
%% Check which root directory if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end %% Set Up Directories addpath([root_dir 'PRJ_Error/scripts/']); addpath([root_dir 'PRJ_Error/sc...
61cf1270b280bbd6400ab31e09369c2af0ba5ad69279dc7debd42d06b25f9954
MATLAB
6,951
146
%{ OnOffsetDetectionPluginExample - simple example script to show users how to make onset/offset detection plugins HOW TO USE THIS TEMPLATE Edit only the three ZONE blocks below: ZONE 1 set numVar, your parameter labels, and optional default values ZONE 2 unpack your parameters from UserVar ZONE 3 wri...
485d6a9c07faee8cb5da088ed1adc87448d4c803089c4b37202a79be9bbf5c59
MATLAB
6,958
274
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 is emp...
3a2f58a408ba5d1d038a61ec294d8cd5b4ad97c9d3990ce1dd48854aa904a00b
MATLAB
6,959
171
function [outChords,outToneCenters,outContextuality1,outContextuality2,outContextuality3] = IPEMContextualityIndex(varargin) % Usage: % [outChords,outToneCenters,... % outContextuality1,outContextuality2,outContextuality3] = ... % IPEMContextualityIndex(inPeriodicityPitch,inSampleFreq,inPeriods,... % ...
c2e10968ef59dfda2c66b8bb9bf38fb8d72c6ac99191d7d8f4871f4cf9507908
MATLAB
6,959
267
function [xs, info] = ir_pwls_os_rlalm(x, Ab, yi, R, varargin) %function [xs, info] = ir_pwls_os_rlalm(x, Ab, yi, R, [options]) %| %| penalized weighted least squares estimation / image reconstruction %| using relaxed linearized augmented lagrangian method with %| (optionally relaxed) ordered subsets. (relaxed OS-LALM...
90d14f3892958db53c6d11ac1801691fe51e084e3fb1838cbf0f987b5c7a1d13
MATLAB
6,960
140
function [OFC_chan_idx,fro_chan_idx,temp_chan_idx,insula_chan_idx,cingulate_chan_idx,... ACC_chan_idx,EC_chan_idx, HC_chan_idx ,CA3_chan_idx,CA1_chan_idx, MTL_chan_idx, NC_chan_idx] = get_elecs_clean(subj) % will provide chan indices for each subj if strcmp('39', subj) OFC_chan_idx = [1:2, 58:59]; fr...
444827cb844679c7e37a87df57fe0a6332a860edd3ed65d8dbf0d95b06471a7b
MATLAB
6,961
276
function [T, reuse] = nufft_gram(ob, W, reuse) %function [T, reuse] = nufft_gram(ob, W, reuse) % construct Toeplitz matrix object T = G'WG for a Gnufft object % in % ob Fatrix a [M,np] Gnufft object % W [M,M] W = diag_sp(wi) (often simply "1" or []) % reuse struct stuff from the last call that can be reused % out %...
899d4ea7e0378cc1065799a9e1b4ee771861f0cfdcefbaccef96a96882177da9
MATLAB
6,964
207
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % % Inputs (required) % x - vec...
2e63c1539ad5a810b54effa735d5dff0fa0a6e860537a160bfb6b2d8a9834c25
MATLAB
6,967
189
clc; clear; addpath('/data/hu_esraal/Documents/eeglab2019_0/') addpath('/data/pt_02333/esra_codes/') eeglab %% eegfolder= '/data/p_02186/TMS_ECG2/analyses/EEGsham/merge/'; cd(eegfolder); save2folder= '/data/p_02186/TMS_ECG2/analyses/EEGsham/merge/reref/cardiacphase_fakecorr/'; mkdir(save2folder); cd(save2folder); subj...
226d8d636537dd1dd92b4e5bfc8858299f6fe217a6f2e3ca02b64658dc7c8913
MATLAB
6,976
148
% do mixed effect analysis on degree centrality on sad vs. rum, as the % reviewer suggested % % % Xiao Chen 230228 % chenxiaophd@gmail.com %% initialization clear; clc; work_dir = 'working directory'; data_dir = 'DPABISurf Preprocessing Files'; TemplateDir = 'DPABISurf surf template directory'; load([work_dir, '/sub...
d3afdea72e0a75f6fc9e57930cd08e8ac9996b6538fa8dee0c271cf448c43a37
MATLAB
6,984
164
function SBJ09a_TFR_stats(SBJ,conditions,proc_id,an_id) % Calculates time frequency representation and saves the results % INPUTS: % SBJ [str] - dataset to be processed % proc_id [str] - which processed data pipeline to get the data % an_id [str] - which analysis variables to use %% Check which root directory if...
118ccf788c2348f121cbcbc7a0df54abbade74a3cf338e6904d2020146bd0945
MATLAB
6,985
165
%% Set variables for saved design info & target directory (to save .txt files) % This script assumes that in your GA output your trait-categories rotate % first, and then the prompt types. E.g., with 3 trait-categories and Self % and change prompts, we'd get conditions 1 2 3 for self, and 4 5 6 for % change. pathtofile...