sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3f998f56678b40735ad56c27130fa5d1c77c2346bb331a15e601865a129cac14
MATLAB
4,430
150
%This script will generate data and then fit pibdfc as an example. %% addpath('pibdfc_functions'); rng(34); %% Generating the data run('create_gaussian_simset.m'); %% Setting Up for the MCMC nsims = 1000; %Number of simulations total nburn = 1000; %Number of burn-in sims S = 3; a0 = 0.01; %Prior variance for rho/xi...
9b2658c3059a7a83211ae05da1f4fe9c473e89c671887e7fe07d2d66a7b29e7c
MATLAB
4,431
120
function [spMat_src spMat_targ] = GrappaReco3D_arb_idx(sigDims,kernel,stepSize,startPos) % function out = GrappaReco3D_arb_idx(sig,kernel,ws,stepSize,startPos) % % Daniel Gallichan, December 2012. Small modification to code from % bernd.jung@uniklinik-freiburg.de to allow arbitrary GRAPPA kernel % and multiple 'startPo...
5f4f25912839abe3a0d899469d418c019e15b48835b61199abcc1e1cc422ae99
MATLAB
4,435
146
function coeff = calc_energy_coeff(dim,N,s,energy) %CALC_ENERGY_COEFF Coefficient of second term in expansion of energy % %Syntax % coeff = calc_energy_coeff(d,N,s,energy); % %Description % COEFF = CALC_ENERGY_COEFF(dim,N,s,ENERGY) sets COEFF to be the coefficient of % the second term of an expansion of ENERGY with the...
0d4050d1bbb0743e0b73d916d4db58251d2aa7bade74375a2cc43ee45b7ab10e
MATLAB
4,438
189
function plot_diff(f1,f2,tit) param.mean_line_broadening = 1; param.xlim=[0 4.5];param.ylim=[-2000 14000]; param.diff_y_lim=[-2000 3500]; param.save_file = '/home/romain/Doc/spectro_doc/Dysto/aaa'; param.xlim=[2.5 4.3]; param.xlim=[0 4.5]; %param.diff_y_lim=[-300 1500]; param.display_var = 0; param.same_fig=1; param....
55a22d36453385c811a6d8c2d9d016e3c931b93dd020c329ff71101a2c23152c
MATLAB
4,441
136
clear; close all; cd 'C:\Users\Admin\Git\repo\ZS-DeconvNet\Python_MATLAB_Codes\data_augment_recorrupt_matlab'; % change this path to your cloned path addpath(genpath('./XxUtils')); addpath(genpath('./GenData4ZS-DeconvNet-SIM')) % It should be noted that, the raw data loading code of this demo is based on the file stru...
f01ac3ede023aa61cf2632119c1d19c7cd5c7db00a0c1692545b7e44d47f2aa7
MATLAB
4,442
140
function []=mnl_TracesChannelMIPs_Processed_TracesAndSomas(dim,efPxTrace,Somas) %function that creates MIPs for each channel based on the traces from %neurolucida % Inputs % dim - dimensions of the original image [x y c z] % efPxTrace - structure containg the relevant inforation % data - the image matrix nTrace=size...
be3d9bf76d6457df5c7db4a2afd1fae7bf59585078809d2db0c61329dfb7c728
MATLAB
4,444
108
function rescaleFigProj(hFigProj, projScale, hCfg) %RESCALEFIGPROJ rescaleUpdate(hFigProj, projScale, hCfg); hFigProj.figData.boundScale = projScale; if strcmp(hCfg.dispFeature, 'vpp') XLabel = 'Site # (%0.0f \\muV; upper: V_{min}; lower: V_{max})'; YLabel = 'Site # (%0.0f \\muV_{min})'...
eb3e0a2c663ebf66ed41d2c56ebfeaeced495d238b2697248c7558f59fb7ed2a
MATLAB
4,444
134
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice...
574c6a744db5ce7ea27500b078b4d1613497d763b41978144ecbded3efb19b9f
MATLAB
4,449
121
function [spatial, temporal, S] = compute_pca_joint( p,thisSub ) % to be able to work with large movies, we calculate the covariance % matrix batchwise, in order to avoid loading the whole movie into % memory %% get info on movie batches (session movies) sub = find(p.subjects == thisSub); used_sessions = s...
4e6b9e07dd4326179cdf1dc8f544b1cbca941d36b2106bcd352d1399bc47aadb
MATLAB
4,452
149
% plot distributions of some characteristics of accepted and rejected cells % - diameter % - symmetry of mean peak % - n events per session % - std of events per session % - mse of snapshots %% get necessary data clear p = params_2DAA; fpath = fullfile(p.rootDir,'results','allData.mat'); load(fpath,'evs') % needed fo...
55c9888507d509fa675bc3ff4ee87b0791df331985f446da8de2771a6bb22f8d
MATLAB
4,452
125
function [pitchsig,yanalframelen_out,ystep_out,nframes_out] = ... get_sig_pitch(sig,fs,pitchlimits,yanalframe_ms,yanalstep_ms,yes_verbose) % function [pitchsig,[yanalframelen_out],[ystep_out],[nframes_out]] = ... % getwavepitch(sig,fs,pitchlimits,[yanalframe_ms],[yanalstep_ms],[yes_verbose]) % for example: % pi...
1e70e1eb0f03e3f5b7de29746c14aafb6ce4baa54b763e6a8f30dead5c1c9976
MATLAB
4,457
120
clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData.mat'); load(fpath,'evs','tis','bvs','traces') [cols,alpha] = chooseColors; %% run DR and decoding procedure for different trial samples fpath = fullfile(p.data_dir,'identification_of_tone_dim'); saveData = 1; saveFigs = 1; n_rep = 80; % ~80 sec. per...
4c0a2dd03a4aaa83098e3522ce83d966eb10a9f20ec66feaf19f6c9ff49e6626
MATLAB
4,461
75
function par = set_parameters() % LOAD PARAMS par.segments_length = 5; % length (in minutes) of segments in which the data is cutted (default 5min). % PLOTTING PARAMETERS par.cont_segment = true; par.max_spikes_plot = 1000; % max. number of spikes to be plotted par.print2file = true; % If ...
cef520d1ccb8932f4bd061ed6318757cf21cb70962656c6b33983bd71a9c9036
MATLAB
4,461
75
function par = set_parameters() % LOAD PARAMS par.segments_length = 5; % length (in minutes) of segments in which the data is cutted (default 5min). % PLOTTING PARAMETERS par.cont_segment = true; par.max_spikes_plot = 1000; % max. number of spikes to be plotted par.print2file = true; % If ...
4f74a61428feda6311d9008cb13425742408e52208a03bb57c0350d7a638ce7a
MATLAB
4,462
147
function [ output_args ] = plot_summary_dim_projections_iti( proj_a, proj_e, dim_ves, saveFigs,out_dir) n_dims = 5; % leave out PC2 lims = [-2.5 7.5]; cols = chooseColors; rep_mean_a = squeeze(mean(cat(3,proj_a{:}),3)); rep_mean_e = squeeze(mean(cat(3,proj_e{:}),3)); rep_mean_ve = squeeze...
91f667217edd68b9e73b73f3b3ea204adb2c6d143adbde2cc3101434974e5cc3
MATLAB
4,464
150
function varargout = runOnAllInDir(runDir,testDir,settings) % Run auto-find test on all structures in runDir % % function testDirThisSession = autoROI.tests.runOnAllInDir(runDir,settings) % % Purpose % Batch run of autoROI.test.runOnStackStruc % Looks for pStack structures in the current dir...
fdfb8c7f709de25ad67536499397b7f0854f6473acd9c6a46099527822f0d60f
MATLAB
4,465
120
classdef adi % % Class: % adi % % This class is meant to hold simple helpers for the package. methods (Static) function view() % % adi.view(*file_path) % % This is %TODO: Run the viewer file_path = adi....
9d90c236349f1aa3b3a5f9177d0a86504cfd8478a7c88114674e9411206e3039
MATLAB
4,468
118
function avg_psth_PV(cellids1,cellids2,responsespec,resdir,spike) %AVG_PSTH_PV Average normalized peri-event time histograms. % AVG_PSTH_PV(CELLIDS1,CELLIDS2,RESPONSESPEC, RESDIR) calculates normalized % average PSTHs aligned to RESPONSESPEC (cue, reward or punishment) for % CELLIDS1 and CELLIDS2, respectiv...
aa801f92204f5c8a23104378b8193fdaecd05c37546443da73be407221aed660
MATLAB
4,470
99
function [myArbitrator]=Bayesian_Arb_Init(N_state,N_action,N_transition) %% create arbitrator + set all initial parameters myArbitrator.K=3; %trichonomy of PE myArbitrator.T=10; %memory size = 10 myArbitrator.T_half=6; %half-life myArbitrator.T_current1=0; % # of accumulated events. cannot exceed T. myArbitra...
51eb1777ec4999cb4e0e67293a66e7334c2e278ad5bad36715cc6b2dbe10a94d
MATLAB
4,471
149
function [kb, alpha, kb_m] = kaiser_bessel(x, J, alpha, kb_m, K_N) %function [kb, alpha, kb_m] = kaiser_bessel(x, J, alpha, kb_m) %function [kb, alpha, kb_m] = kaiser_bessel(x, J, 'best', 0, K_N) %| %| generalized Kaiser-Bessel function for x in support [-J/2,J/2] %| shape parameter "alpha" (default 2.34 J) %| order p...
f05776adb86c721c33aad6018a59ad26a0df67e0812c8f8721d3b24ae4c9a203
MATLAB
4,474
135
%% BOXPLOTS - FW in TISSUES HC vs MS N1 = length(HCsubj); N2 = length(MSsubj); g2 = repmat({'GM-hc'},N1,1); g3 = repmat({'WM-hc'},N1,1); g5 = repmat({'GM-ms'},N2,1); g6 = repmat({'WM-ms'},N2,1); g7 = repmat({'NAWM-ms'},N2,1); g8 = repmat({'T1L'},N2,1); g9 = repmat({'T2L'},N2,1); g10 = repmat({'periles'},N2,1); x2...
3f865aa76cc6678ba973ebd5e613755e88562388e6d3d673b239d61c959a918b
MATLAB
4,475
132
% This function computes the fluence in the 10-2.5 locations on the % volumetric head mesh with Toast % % INPUTS: % % headVolumeMesh The multi-layer volume mesh structure. % Contains fields: node, face, elem, labels % % landmarks A matrix containing the landmarks coordi...
01759da50f7996cc4e14e620b929dc8a519cf1af272b482bd13dc7c8e20e3bd2
MATLAB
4,478
131
clear clc %% add togethter meny WF files [filename path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. datafile = fullfile(path, filename); %save path all_wf.fr = []; all_wf.mean = []; for i = 1:length(datafile) ...
87b3b1e8f80bcd4f9895d014e58406b13baa89684dea5ae62aea7b3744c85ffd
MATLAB
4,479
166
function ob = fatrix2_mtimes2(ob1, ob2, varargin) %function ob = fatrix2_mtimes2(ob1, ob2, options) %| %| Construct fatrix2 object that is the product of two objects: %| ob = ob1 * ob2. %| Requires size(ob1,2) == size(ob2,1) as in matrix multiplication. %| %| in %| ob1 *atrix any object that can do "mtimes" and "size...
d87ab1e7d542d24591450365ec427a27147615367485b4d08f316c10d2da73a2
MATLAB
4,479
112
function ROI_indices = select_ROIs_from_full_AAL(cfg); % function ROI_indices = select_ROIs_from_full_AAL(cfg); % % Gives the indices of the ROIs in the AAL atlas that are needed for % further analysis -- only cortical ROIs % % ROI order is the same as in Gong et al. 2009 (Figure 1g and Supplementary Table 1), a...
007aa95477e210008834fe340273989c3a04dbe379097c131649b4aba88d4645
MATLAB
4,491
169
classdef circularFit<ellipticalFit %A class for executing and managing 2D circle fits properties (Dependent) radius end properties(Dependent,Hidden) rad end methods %Accessors function val=get.radius(obj) val=obj.minorDiam/2; end...
ac9f2f6f1ace628a002a5fc4e2767aa982167fcb1aebaf643838d5602dab5cfa
MATLAB
4,492
157
function SpikeArray1=GetSpike global StartTime FinishTime Spname % StartTime % FinishTime DurationB=FinishTime-StartTime; CurrentPath=pwd; % cd C:\Users\B133\Desktop\WR_LVdata\6721_160218 % load 6721_160218.mat cd C:\Users\B133_2\Desktop\CheetahData %dpath='C:\Documents and Settings\kit\ƒfƒXƒNƒgƒbƒv\WR L...
f6cab42e72aba09dc48b73ce4f6e955212af9c9cc16fadeee94f2cb0e7c48cfb
MATLAB
4,495
160
% nufft_tune_kaiser % tune the shape parameter for kaiser-bessel interpolation in 1D NUFFT % to minimize the worst-case error % explore scaling factors if ~isvar('N') && 0 N = 2^8; K = 2*N; J = 6; alpha = 2.34 * J; kb_m = 0; n = [0:(N-1)]'-(N-1)/2; kernel = kaiser_bessel('inline', [], alpha, kb_m, K/N); sn_zn = r...
62cf1ae4b0d437284f736cc1038fc5835c031191edaf142ad33fe33a32c4933c
MATLAB
4,498
117
function [UC, UC_onsets, UC_counts, UC_counts_avg, Tachysystolic] = UterineContractions(UA, input_type, Fs, alpha, UC_iden_wlen, UC_avg_wlen, Tachysystolic_th, plotflag, varargin) % % [UC, UC_onsets, UC_counts, UC_counts_avg, Tachysystolic] = UterineContractions(UA, input_type, Fs, alpha, UC_iden_wlen, UC_avg_wlen, Tac...
961680d641c3a6d15b722d29ef97ecf8d1d6df3025837b9d0460d8e34048aed0
MATLAB
4,501
169
clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData.mat'); load(fpath,'evs','tis','bvs','traces') [cols,alpha] = chooseColors; speed_control = 0; saveFigs = 1; this_ses = 7; %% [av_trials_all, err_trials_all, trans_data_all, trans_data_err_all, err_trials_full_all, trans_data_all_dr, tone_idx] = ......
301bf922ee0889b07c5f5f70dd55611a04dd3f06644f87351eadf56498c24c3b
MATLAB
4,503
140
function [bestParams, char, bestR2] = fitGaussianTemplates_meanPSTH(response,customOffset, plotFlag) %% template matching gaussian fits gaussFun = @(params,xdata) params(1) + params(2).*exp(-(((xdata-params(3)).^2)/(2*(params(4).^2)))); opts = optimset('Display','off'); %% get x and y train vals ytrainvals = respons...
10f1da2e1abf2ad41bebf3a8cd72dcdfd8c23bcc08a51ef7a42daea9c92d84c4
MATLAB
4,505
108
% Script to MERGE Datasets of the Following Caterogry of Features: % 'Raster Activity': Nerual Activity % 'General Ensembles': Neural Ensembles Features % 'Detailed Ensembles': Single Neural Ensembles Features %% Intro fprintf('\n\nGet CSV Tables from Analsysis Features.\n') fprintf('Table_Raster_Featur...
af2dd6ab925b4ac6292580364c1c02b2cc74f0a0b54895e749942af251ccaa5e
MATLAB
4,509
144
function [count edges mid loc] = histcn(X, varargin) % function [count edges mid loc] = histcn(X, edge1, edge2, ..., edgeN) % % Purpose: compute n-dimensional histogram % % INPUT % - X: is (M x N) array, represents M data points in R^N % - edgek: are the bin vectors on dimension k, k=1...N. % If it is a...
3d985e2ee492b4757ba087326cfab95bca8983d5da48c222c8e5aec6af47d556
MATLAB
4,513
136
%{ ---------------------------------------------------------------------------- First_take number of frames in each tif files Analyzing imaging data simply At least for the correct rate ---------------------------------------------------------------------------- %} function Figure3e_Task_kaiseki_tokyo1_2022021...
d66261d2691fe3f6c64a22f806126d17a57bb039a06b0ab34b7dadbfe8b48803
MATLAB
4,517
125
function loadParams(obj, filename) %LOADPARAMS Load parameters from file if nargin < 2 filename = obj.configFile; end if ischar(filename) filename_ = jrclust.utils.absPath(filename); userParams = jrclust.utils.mToStruct(filename_); % raises error if not a file elseif isstruc...
a3b09c58d15ec309a0655c3d61ff0c6072f47989e5be4a9a18ef7c1cd29e35cc
MATLAB
4,518
144
%% Date: 03-03-2022 Programmed by: Deirdre BOLGER % Script to isolate choosen conditions in already segmented data. % This script should run for several datasets. % %********************************************************************** %% LOAD IN ALL THE DATASETS THAT YOU WISH TO SEPARATE. % You can select tho...
e86f9b1468d677bac1e42ec633b1339fb89adac286cd7ef229d3de58b338dc6b
MATLAB
4,518
114
function [spikeTimes, spikeAmps, spikeSites] = mergePeaks(spikesBySite, ampsBySite, hCfg) %MERGEPEAKS Merge duplicate peak events nSites = numel(spikesBySite); spikeTimes = jrclust.utils.neCell2mat(spikesBySite); spikeAmps = jrclust.utils.neCell2mat(ampsBySite); spikeSites = jrclust.utils.neCell2mat...
c0dff762c882f8725ed4d0ca00460fe94d10610cc7ceb9825d5d15be411326d1
MATLAB
4,523
82
function [fig_touch PTpegHistoCell PegTouchBypegCell]=TouchAlignByPeg(PegTouchCell,pegTimeArray2D,yhight) %TouchAlignByPeg(PegTouchCell,pegTimeArray2D,100,30) %Called by PegTouch,Detach %Touch aligned By Pegs global PTpegHistoCell ShowFig PegTouchBypeg1=[];PegTouchBypeg2=[];PegTouchBypeg3=[];PegTouchBypeg4=[];P...
d63be3e48e582966d2f133659c6b250b5d8e29811dcb46077600db327a0826f7
MATLAB
4,523
150
% Sample fetal-maternal ECG generator clc clear; close all; fs = 500; N = 10000; dim1 = 8; SIR = -10; SNR = 30; % beta = 2; beta = 1.5; % noise color (for noisetype = 1) w_bw = 1; % weight of baseline wander noise in the generated noise (for noisetype = 5) w_em = 1; % weight of elect...
8ef2097e1fb7860284494920c00bb5372e9d5be5326320111c15f5db1a491534
MATLAB
4,524
164
% read .COORD file and plot data % PGH Oct 2001 function lcmodelresults=readcoord(filename) % define output structure for results %lcmodelresults=struct('spectrumppm',0,'spectrumdata',0,'spectrumfit',0,'spectrumbasl',0,'metabconc',0,'linewidth',0,'SN',0); %lcmodelresults.metabconc=struct('name',0,'relconc',0,'abscon...
720d9545e29c5f552c84bacaa6795ee9102510f50aaa1ab71fd1f1553e34a182
MATLAB
4,527
116
function V = model_ther_tIVI(param, time, t_start, k_e, Ci, Vc, tI, VI) % param: alpha0, beta, k. time > tI alpha0 = param(1); % relative growth rate at size V0 = 1 cell beta = param(2); k = param(3); M = length(Ci); % note: length of Ci defines number of administrations and total treatment duration Ci ...
90250525c08c72d735055dbd1f551f412291fd9637372d293f6a204e79d22b4b
MATLAB
4,530
110
% This script reproduces Figures 8 and 9 of the main article. %% load('SPMap_features.mat'); % Loading SP map features extracted from MNI and CHUGA addpath('functions'); addpath('demo_data') addpath('perturbation') addpath(genpath('results_figures\sp_results')) % Specify center (1=MNI,2=CHUGA) center = 1; ...
e8f19486613cd9b072bb54abcfc32ced99ad382dd7399e8cf04e0796d541d2b7
MATLAB
4,530
152
function Stats = paired_ttest(Data1, Data2, StatsP) % Calculates t-tests, p values, fdr corrected p values, and effect sizes. % Input options: % A) Data1 = P x S, Data2 = []: t-tests done for every S with every S. Returns % a S x S matrix, filled only in the upper triangle. Used in % ConfettiSpaghetti. % B) Data1 = P x...
a0a4458a2b51c35dc4fd0691237a11e81072c29e405559b2d791695c1fc1b2fd
MATLAB
4,532
106
function [ p, yhat, ci ] = polypredci( x, y, n, alfa, xv ) % POLYPREDCI Calculates the prediction intervals for a polynomial % regression produced by ‘polyfit’. % % DESCRIPTION: % The function takes the vector data in ‘x’ and ‘y’ arguments, % polynomial degree ‘n’, and significance level ‘alfa’...
8d266ef286e842b6067832d81259c0cee74a73fbcfda7faa5578c791b18c1458
MATLAB
4,533
105
% Example end-to-end pipeline of extracting data, preprocessing, % feature extraction and spatial perturbation. The first part of the script % reads five minutes of MNI SEEG data that was downsampled to 200Hz due % to file size limitations. The data is notch filtered, and the Janca % detector [1] is used to detec...
282535169e41a94488bdf87034a966a55753365fd5f674fbf5aa179b86f0c4cb
MATLAB
4,536
112
function Both_RLt_Pattern_3Seq_20200304 path=['C:\Users\C238\Desktop\touchcellLtRt_terashita']; cd(path); LS=ls; RLtouchPoint=zeros(1,8); RLtouchFire=zeros(1,8); X=[]; RLtouchUnit=[]; RLtouchPointUnit=[]; for i=1:length(LS(:,1)) TrimFolder=strtrim(LS(i,:)); if ~strcmp(TrimFolder,'.') &&...
c9d80abd78360bec26e08265d752d03518525c05e82535f5253d4bda7f7a4cb6
MATLAB
4,538
111
%% msBatchRun2018 % Version 1.0 GE % Updated version of the msBatchRun script originally proposed by Daniel B % Aharoni to analyse miniscope 1p calcium imaging data on large batches of % data. % This version is build on top of the original package to maximize compatibility. % It includes NormCorre for image registratio...
07ffe6975164b1d7f88010218db293bbe11f27c71d440c836f3796554bf82849
MATLAB
4,540
110
function [peaks, peak_indexes, peak_indexes_consensus, qrs_likelihood] = peak_det_likelihood_long_recs(data, fs, varargin) % PEAK_DET_LIKELIHOOD_LONG_RECS - Block-wise ECG R-peak detector for long records. % % This function is an efficient version of peak_det_likelihood, % designed for long ECG records. It processes th...
66f8b22a9c936515663a88f02493d1c95876f0e947455cbf0162c30153765d31
MATLAB
4,540
163
function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be...
77546239ee0dc43c4242e483054ae9cdba7515db97f0ddf0bc994ee9886f6d94
MATLAB
4,540
170
function mnl_DisplayShiftsOfChosenBead(f2Beads,ChosenBead,Scale,Zrange_um) %Function designed to plot the effects of chromatic aberration in each %channel as RGB components %Initial Set up Bead=f2Beads(ChosenBead); nChan=size(Bead.ChromaticAberration,2); nplots=2+nChan; cmap=colormap(lines(nChan)); BeadLocation=Bead.Be...
f189760ab7757aec11b9197fe979821af9e0fa798fa25214bbc113f48fba5df6
MATLAB
4,540
99
function [ av_trials,err_trials,tone_idx ] = collect_ae_trials_all_ses(p, traces, evs, bvs, tis, speed_control,tone_start_control) spd_dims = 18:22; %dlc pre_steps = 15; post_steps = 5; for sub = 1:p.nSubjects % first collect all av trials and keep track of the action % start times ...
2f008494d235934fcda72b6cd117ea1a319f734a3427a7a8bd7dc4b743dbf3f2
MATLAB
4,543
141
close all;clear %addpath(genpath('..\Entropy_measures\')) display('Calcul duree activite-silence par cellule'); prompt = {'frequence echantillonage(Herz):'}; dlg_title = 'Calcul duree activite-silence par cellule'; num_lines = [1 30]; def = {'2'}; opts.Resize='on'; opts.WindowStyle='normal'; answer = inpu...
3678c60faffc391be69e884808a79998045d99129311464cfba403a02426a685
MATLAB
4,547
136
function [y_smoothed, a, y_hat, y_bar] = lp_filter_kalman(y, fc, varargin) % % Applies lowpass filtering using a first-order Kalman Smoother. % % Usage: % [y_smoothed, a, y_hat, y_bar] = lp_filter_kalman(y, fc, VarWinlen, VarWinlen1, gamma) % % Inputs: % y: Vector or matrix of input data (channels x sample...
cae90bf25b9a0cd1daeccbbd9d51d90cd624d17547412ca8c8e27f1128b12e7e
MATLAB
4,547
93
clear all eegdir_orig = 'D:\Bori\BEDREST\RENDEZETT\Bedrest_RawEEG\'; %raw eeg data eegdir_new = 'D:\Bori\BEDREST\RENDEZETT\Bedrest_PreEEG\EEGLocs\'; % matlab will not create this folder automatically, you need to create it manually eegl_dir = 'D:\Bori\eeglab12_0_1_0b'; %eeglab toolbox directory %HDBR first campai...
21869f4d9a0ace9e1e8b8a3b2032b99eb2990169aa9208bd2e30c9a4e33dba99
MATLAB
4,549
125
function [ind, rank] = ECGChannelRanking(x, fs) % Ranking channels based on multiple indexes % Reza Sameni, Copyright % December 2008 % L1 = size(x,1); L2 = size(x,2); t = (0:L2-1)/fs; %////////////////////////////////////////////////////////////////////////// % preprocessing % mean removal (not really ne...
2de1618556e477af1353ccdb318c3b34894e0ff845aa0c3ea7ef21dd2f869ef2
MATLAB
4,549
178
function fid = import_brucker_raw(fi) if ~exist('fi') fi = get_subdir_regex; end if iscell(fi) %ff = get_subdir_regex_files(fi,'fid$'); ff = get_subdir_regex_files(fi,'fid.raw$'); if isempty(ff) ff = get_subdir_regex_files(fi,'fid$'); end for kk=1:length(ff) fid(kk) = import_brucker_raw(ff{kk}); end return en...
a28c46031fb0b152a452d282796d70af8d74f720931fc395b97a8ce68773f28b
MATLAB
4,550
121
% A script for generating illustrations in the following publication: % Sameni, R. (2017). Online filtering using piecewise smoothness priors: % Application to normal and abnormal electrocardiogram denoising. In % Signal Processing (Vol. 133, pp. 52–63). Elsevier BV. % https://doi.org/10.1016/j.s...
46124313aa39a6f6d9985dc7284cd0b5fda0d5cdd29caa96afe2a6dd6f9b7e95
MATLAB
4,555
143
%% Date: 03-03-2022 Programmed by: Deirdre BOLGER % Script to isolate choosen conditions in already segmented data. % This script should run for several datasets. % %********************************************************************** %% LOAD IN ALL THE DATASETS THAT YOU WISH TO SEPARATE. % You can select tho...
265edf70279abf954fbbb77b860e43f2d045e467531fe1898c384db8a9da3472
MATLAB
4,563
116
function [varargout] = etaSquared2(inData1,inData2,varargin) % ------------------------------------------------------------------------- % [eta2] = etaSquared(inData1,inData2); % [eta2,eta2Idx] = etaSquared(inData1,inData2,'Distance','true','Smallest',10); % -------------------------------------------------------------...
31161855074617b1da74c3e4cc0776475d4bc8bc3e60d9cab3313294d909ccb2
MATLAB
4,563
160
function controlfilename = createLCmodel_control_laser(metabname,l1,l2,l3,preproc_dir) do_water_scaling=1; doecc=0; TEMET=0; basis_set_file_path = '//home/romain/data/spectro/Basis_set/Laser_TE52/basis_LASER_TE52_CENIR.BASIS'; basis_set_file_path = '//home/romain/data/spectro/Basis_set/Laser_TE52/basis_LASER_TE_60_C...
8d841939ea5eb41b0496d617ea970f59722ed893f1859111fc0e89136ec9512c
MATLAB
4,576
131
function [stat] = get_B(sref,s,par) % GET_B Moment ratios to test for modularizations. % STAT = GET_B(SREF,S,PAR) for reference variable SREF (1-by-sample), observable components S (component-by-sample) and % threshold PAR.THRESH returns % % STAT.B moment ratios matrix % STAT.SIG2 var...
ec9d8a1b4f40759f5164fce470dafd9180f5748e54dcfa4b7113762fa1fce23b
MATLAB
4,576
123
function cluster_runMultiEchoGRE_eachEcho_skipMoCo(reconParsFile,iE) % _skipMoCo version strips out all MoCo to speedup getting through ASPIRE % pipeline for testing load(reconParsFile) run([RETROMOCOBOX_PATH '/addRetroMoCoBoxToPath.m']); % run([MIRT_PATH '/setup.m']); addpath(SPM_PATH); % if nEco <= 10 % parpo...
be7e32ea0f7d3cedf6bc2cc88d33a27cf378f10a694d01f5888410277310813d
MATLAB
4,577
178
function [movie_frame] = show_s2_partition(N,varargin) %SHOW_S2_PARTITION 3D illustration of an EQ partition of S^2 % %Syntax % [movie_frame] = show_s2_partition(N,options); % %Description % SHOW_S2_PARTITION(N) uses a 3d plot to illustrate the partition of % the unit sphere S^2 into N regions. % % MOVIE_FRAME = SHOW_S...
8aba5c43f2596ec3abdabb2e4f0e0e097952cf13d6ddc9db8d053e7c53ad533a
MATLAB
4,585
149
clear all % this script contains code to reproduce Figure S8b-c, f-g %% load data % drag and drop corresponding file (S9 Data) %% data content description % behavior contains video energy data form the wheel (behavior.wheel) of the size 1801 frames (fs=20Hz) x 14 trials x 22 % sessions % fUS contains...
e0e787a4fdb9958e3ab6ee0a39ab6d00f133f0f0ff2dc6ace1444d4f8cb98366
MATLAB
4,586
133
function crosscorrelatemaps(group1,group2,labels,hemi) %% Compare two experiments in a layered diagram % % crosscorrelatemaps(group1,group2,[labels],[hemi]) % % Input: % group1,2: experiment ID of a single experiment file (e.g. '100140756'), % or cell array containing multiple IDs. In the latter case the exper...
d4de9956510abd0b55211d1291fcc49ce5c90aaf565ef8d80340a5689c51e603
MATLAB
4,587
118
function [colorMapInterp] = customColorMapInterpBars(colorMap, colorBins, interpDir) % Creates a custom interpolated colormap with bar-style blending. % % This function interpolates between two given colormaps to create a new colormap % matrix. The interpolation can occur either uniformly ('same') or with different % b...
147168c9f8cf4463304a8ed0fb4ab363205b901c9cca10afcc9e4229c92e832d
MATLAB
4,588
128
function [gpfa_params gpfa_traj LL] = gpfa_engineDH(D,dims,varargin) % GPFA_ENGINEDH A modified GPFA_ENGINE for the DataHigh program % % Inputs: % D -- struct of trajectories, make sure it conforms to gpfa's format % dims --- the dimension you choose for the number of latent variables % emMaxIters (optional) ---...
43a880486485d0451b569887cf3f4918d582a29871cce101baa1510b01b3e7f6
MATLAB
4,593
140
function timeseries = spmup_extract(fmridata,graymatter,atlas,varargin) % routine to extract timeseries data as per atlas % % FORMAT timeseries = spmup_extract(fmridata,graymatter,atlas) % timeseries = spmup_extract(fmridata,graymatter,atlas,LowPass,FreqSampling) % % INPUT fmridata file name of the fMRI time se...
4b3bf8be24d93f8c75a40914c2df4a23946f1bdde9b4ed6a13eeb021c8a62d2d
MATLAB
4,593
109
function table_name = spmup_BIDS_QCtables(subjects, type) % takes a subjects structure and create a table.tsv of QC metrics along % with plotting the data % % FORMAT table_name = spmup_BIDS_QCtables(subjects, type) % % INPUT - subjects is a structure saved by run_spmup_bids % it is saved on disk as spmup_subje...
e4fd1e7ce5c2aa3968a89c43dd1b2bdaf944b4c4295dacdd4fe3479e181b5edd
MATLAB
4,596
108
function save_trans_results(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_spect.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode','mul...
2ede57422f09695583871bab3256f856af216c985969008e329ed402d59a2078
MATLAB
4,598
127
clear clc on_window = 40:50; sus_window = 100:130; %% % Needs to be in D:\Data\IR data Shira_May_14_2022 [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save...
525277d01572270b7f352e4bad9868883aca520a85267bee8886c836ef69d3f4
MATLAB
4,598
146
function [nCIJtree CIJtree mdeg globalcosteffmax costmax E]=threshold_omst_gce_wu(CIJ,flag) % threshold_omst_gce_w Optimizing the formula GE-C via orthogonal MSTs. % % [nCIJtree CIJtree mdeg degree vector cost ]=threshold_omst_gce_wu(CIJ) % % This function thresholds the connectivity matrix by absolute weight...
90c64c9f2f525fc6b1af67895bf3544000b1c0fd36342301bb75f9e3409bdcda
MATLAB
4,599
149
function [specReturn,sig_struct] = CalcPermSpec(ersp,time_vec,calc_lims,freqs,cfg) valid_height = find(~isnan(squeeze(ersp(:,10,100)))); ersp = ersp(valid_height,:,:); zero_ind = find((time_vec <= calc_lims(1)) | (time_vec >= calc_lims(2))); ersp_tmp = ersp; ersp_tmp(:,:,zero_ind) = 0; %get observed values [h,...
f709e3233525b208aa47f1d0f479ef29a705d6af4c2b83b5282d08387cd66771
MATLAB
4,602
135
clear clc erias = ["AC", "PL", "IL", "DP", "TT"]; cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\figure1_stats\sides') load("all_psth_T_with_sides.mat") %% pool ACd ACv, 6a 6b change_position_name = T.position; AC_names = find(contains(change_position_name, 'ACA')); change_position_name(find(contai...
2fa9b0b3a254a9d1f9a163883cab785a6c842b918fe2101409b94dbdcd243593
MATLAB
4,603
127
% Purpose: Convert fsaverage6 SNR maps to .mat matrices, avg over sessions % and within networks % Inputs: LH and RH step2 .shape.gii output, individual parc output % (matched) % Outputs: subject-avg SNR .mat, .csv file containing network-avg SNR for each subject % % Note: This requires the use of the gifti package (pa...
85f597f74a5f9b67d64129cda6d148037857c205b71085f14ec1fa4c79702e8a
MATLAB
4,603
97
% This MATLAB code appears to perform several data processing tasks related to a persistence index for a set of neural recordings. Here's a breakdown of what each section of the code does: % % File Selection % The user is prompted to select one or more .mat files containing neural recordings data. The uigetfile functi...
c3dad38684f47164b8112534dac139fb50865c96900f14dc6a182bf1f7687372
MATLAB
4,604
108
function beh = extractBeh(varargin) %%Extract processed data from multiple recordings into single structure % % [beh] = extractBeh() - load from files, will be prompted to select % [beh] = extractBeh(fPath, fName) - load from specified files % [beh] = extractBeh(beh) - to add to existing structure % [beh] = extra...
c243a2b2bc4aee7b16c8c760f63ff4e9c7a5a4c95d711dc24e6119b02104a1af
MATLAB
4,606
117
function all_data = calculate_shuffle_ramse_ir(all_data) %calculate new correct fit windows = {40:50, 65:125, 140:150}; %windows for calculating the response time - on, sustaneid and off %% % Needs to be in D:\Data\IR data Shira_May_14_2022 % all_data = all_data.all_data; cells = fieldnames(all_data); for ...
e71d8ba238dd03a28fa9ce27c11acdaf2a1928b401256c3424c56d3f264931e7
MATLAB
4,613
121
function [output]=compute_gamma(segment,fs,p1,n2) % compute_gamma - Detects preceding gamma activity in a spike segment. % % Syntax: % [output] = compute_gamma(segment, fs, p1, n2) % % Inputs: % segment: 2-second [30-100] Hz filtered spike segment with the spike peak at % the center. The spike s...
bb7c9937f74d67929b291719fa439310c39269d77b8000d35f43312ec7734b6f
MATLAB
4,614
94
function save_regression_res(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_stepwise.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode',...
9796c23f256aa49e4ac58955c685cb788187a31b2bdbb9c158560b0afa7fb4db
MATLAB
4,616
140
function [outlying_volumes,outlying_voxels] = spmup_voxel_outliers(varargin) % % this function is similar to 3dToutcount % http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dToutcount.html % Note that it requires the statistics toolbox (nansum, icdf are called) % % FORMAT [outlying_volumes,outlying_voxels] = spmup_ou...
99650c50ad76910e74aaa89c78fb7d474f5e7c83c3963d1ec93b6bc5c5afc409
MATLAB
4,618
99
function SpikeRhythm %21s–Ú‚ÉBreakPoint‚ð’u‚¢‚ÄŽg—p‚·‚é close all; clear all; cd('C:\Users\kit\Desktop\WR_LVdata'); % dpath = uigetdir('C:\Users\kit\Desktop\WR LVdata'); [fname2,dpath] = uigetfile('*');%Å‰‚̃tƒ@ƒCƒ‹‚ðŽw’è cd C:\Users\kit\Desktop\CheetahData Spath=uigetdir; eval(['fnameEV=''',Spath,'\E...
bd7a22717bc73aac2cb74bd3beec815dd55c0f912e6f55a1dcde282f918eaa0a
MATLAB
4,621
141
% clear % organize_tracking_data() % organize_nidaq_data() %clear %p = params_2DAA; %organize_miniscope_data(p) clear p = params_2DAA; %% load nidaq data fpath = fullfile(p.rootDir,'results','behavior','full','evs_and_tis'); load(fpath) ev_len = cellfun(@(x) size(x,2),evs); %% load tracking data fpath = fullfile(p.r...
c59efaa945695cf7e8ea5d2f122a0d3888ceb23ba9ea3518c8afa93059794dd3
MATLAB
4,623
150
function previewFilesToStack(dirPath) % convert a directory of preview images into single stack % % function previewFilesToStack(dirPath) % % * Purpose % Running BakingTray with a valid directory defined in hBT.logPreviewImageDataToDir % will save preview images to mat files in this directory. These are named according...
c60d41691a1577945f7eb86d7a5a680184f1df2551ff4cc80c8a1eac5ffc672e
MATLAB
4,631
105
% Script to create markers based on the OptiTrack for the right index % finger abduction task in MEG. Trigger is when finger returns to % initial position (i.e. end of finger abduction) % For this, we need the MEG data and the OT data % Zelekha Seedat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
74771ac8d46084034587e6cd81e76886dcc14668d345b2a38fd0f4117bfd1c79
MATLAB
4,635
108
function save_trans_results(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_spect.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode','mul...
6cc6083f09066b2983a22d64fca262c0136d21f5f47523b980d671c1ffd7b87e
MATLAB
4,636
158
function wc_polytrode_figs(input,show_figs) %Plot %if input is a string, load times from that file %otherwise is a cell(USER_DATA) from wave_clus_gui if ~exist('show_figs','var') show_figs = false; end if ~exist('input','var') || isempty(input) h_figs = get(0,'children'); h_fig = findobj(h_figs,'tag','wave_...
ac3cd4f844f85d19d2726f77259f7ca93a9ed4fbf55ec3309713add23db66a65
MATLAB
4,636
142
function [meanPerf, semPerf, pCorrect, cond, meanError, semError, confMatrix] = do_cvDA(dataStruct, options) %% input args % datastruct is of format: struct(icondition).data(time,unit,trial) if ~exist('options','var'), options=struct; end if ~isfield(options,'kfold'), ...
fbb538adf857f2de669ad6f0d21014d7466e9908275b1060f8ac0c2c399634fe
MATLAB
4,639
94
function save_regression_res(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_stepwise.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode',...
d33ac78d1a788cc1ccd03c42c560fe8f0b434ea559fa8ed8559b0712f52480e1
MATLAB
4,642
147
clear all; close all; clc; matrixBefore_no = ([0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0 0...
14349bb1d3d324e82d301738a5125817db52fff063fd45518acc37444a55515c
MATLAB
4,655
155
function controlfilename = createLCmodel_control(metabname,l1,l2,l3,preproc_dir) nb=1; do_water_scaling=1 phantome=0; basis_set_file_path = '/home/romain/data/spectro/Basis_set/MEGA5_inv/MEGA5_inv.BASIS'; %basis_set_file_path = '/home/romain/data/spectro/Basis_set/MEGA5_inv_no_gln/MEGA5.BASIS'; %basis_set_file_path ...
d1d013f570da8e606606a7f483a54a20cde8e0701030cbe18a738abea07dea32
MATLAB
4,657
93
function [S,f,varS,C,Serr]=mtspectrumsegc(data,win,params,segave) % Multi-taper segmented spectrum for a univariate continuous process % % Usage: % % [S,f,varS,C,Serr]=mtspectrumsegc(data,win,params,segave) % Input: % Note units have to be consistent. See chronux.m for more information. % data (single channel) -...
b7c70aeeec5423523600c2a8d4b91fa830a2f28ac562e0ffc6d162b87ed631d1
MATLAB
4,658
168
%% Function to plot raster % input % R: Raster Matrix Cells x Frames % varargin default: % fs=1 Sampling Frequency % stepy=2; Step between rows Yticks % indexes=1:C; Sort % ColocateIndx=[];Indexes of Colocalized Neurons % Neurons:Colocalized % Output...
0ab19dc2c738aa8be159ba4e2fbb40dbafd1fb85eba381d5eba2e5943bb99a00
MATLAB
4,662
168
classdef sphericalFit<ellipsoidalFit %A class for executing and managing fits to a sphere properties (Dependent) radius end methods %Accessors function val=get.radius(obj) val=obj.aDiam/2; end function obj=set.radius(obj,val) ...
10960467cdf949f4c8c986f6f376bbe30ca6a5f850191f32cde3c911a2921b57
MATLAB
4,665
114
function [ensemble_eeg, synch_eeg, trigger_time_sec, time_vec, varargout] = trigger_synch(eeg, fs, onset_time, varargin) % % [ensemble_eeg, synch_eeg, trigger_time_sec, time_vec] = trigger_synch(eeg, fs, onset_time) % [ensemble_eeg, synch_eeg, trigger_time_sec, time_vec, synch_emg] = trigger_synch(eeg, fs, onset_time,...
d251964750e8f2eb4af8903b56dfd5a34262388c9a0e1fdca21e0d05625f3c33
MATLAB
4,672
126
%Author: Tatjana Schmitt, 2019-2023 clearvars path_to_matlab_file ='directory to whole tonotopy'; load(path_to_matlab_file) %% set parameter save_flag = true; frequency_hub = 1; % select the frequency you want to extract/analyse (1,2,3,4,5 for 4,8,16,32,64 kHz respectively) se = strel('disk', 1); ...
2a88321301acbe149c02928052a21c9cbc3128dcb4bd990043a12c8a349f4bb4
MATLAB
4,674
128
close all; clear; clc; resultfname = 'testSpectralAnalysis01.txt'; % parameters subject = {'Dog_1', 'Dog_2', 'Dog_3', 'Dog_4', 'Dog_5', 'Patient_1', 'Patient_2'}; f0 = 60; % powerline frequency Hz Q = 30; % notch filter Q-factor wlen = [0.5 1.0 3.0 5.0 10.0]; % energy window lengths in seconds drop = 200; % remove dat...
72b2c4197bc2ecdbc61e79f18c1564f46d82c7522430266c3eafef628d4cca5a
MATLAB
4,674
127
clc clear [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save path %in case of selcting only one file if ~iscell(datafile) datafile = {datafile}; end %% %change...
369865155664d64a2979c8ed75e9b8a8533e603ed2df1c747bd9b805514eaaa7
MATLAB
4,679
127
function Plot_Brains_COMS_MSPoI_PAPERFIG(FS,A,FRP,nodes_name,coord_node,atlas,options) atlas_name = options.atlas{atlas}; for n = 1:length(nodes_name) Name = nodes_name(n); NodeName(n,:) = string(Name); end % TO save data cd '/netapp/vol7_u923/SEME/SEME_dc/pipeline/MSCD/Results_MSC...
83adf4a6ce16fcb9e9b81218e04ad3cd091afe6b69dc3bcc9d88bde9892714b9
MATLAB
4,681
160
function st = nufft_table_init(om, Nd, Jd, Kd, n_shift, Ld, varargin) %function st = nufft_table_init(om, Nd, Jd, Kd, n_shift, Ld, ...) %| %| Initialize structure for d-dimension NUFFT using table-based interpolator, %| This should be called only by nufft_init with its 'table' argument! %| (So this m-file belongs in t...