sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
38309e733ec0b941323b4a5def33da0f1f5bc4e28eb87b21aeb31ab4d9ba0c17
MATLAB
3,161
97
function OnePhase190514 %ƒ^ƒbƒ`ŠÔ‚ÌˆÊ‘Š‚É‚Â‚¢‚ÄCx‚Æ98‘ŠŠÖ‚ðŒ©‚é cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\OnePhaseFolder'); LS=ls; OnePhaseLindexArray98=[]; OnePhaseRindexArray98=[]; OnePhaseLindexArrayCx=[]; OnePhaseRindexArrayCx=[]; for i=1:length(LS(:,1)) OnePhaseFL=s...
3ac43807920cbb91f92e0c206107d98907f232fa01fd80e88ef7169d55b9de11
MATLAB
3,162
94
function [spikeMatrix, peak_idxs, peakTimes_ms, classes, peak_vals, dip1, dip2 ]=comBIN_wave_clus(cluster,data,par) sr = par.sr; npointsbeforepeak=par.w_pre; npointsafterpeak=par.w_post; peakTimes_ms=cluster.cluster_class(:,2)'/par.sr*1000; peak_idxs=uint32(cluster.cluster_class(:,2)'); clear index clear spikes cla...
212ceb24bc16897af2e88befca777e75e8b0130448299f710e088dbfa4eed619
MATLAB
3,165
130
cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\DREEDDS_VS_CONTROL\effect_size_diff') clear clc c = importdata("all_cells_control.mat"); d = importdata('all_cells_dreadds.mat'); %% hedgesg = []; is_res = []; is_ie = []; tag = []; to_remove = [] for i = 1:size(c{1},1) data = c{1}(i,:); ...
5e81432430836caf564b9be49655fa012528a44b7562800b19f87ff4f7bedbf0
MATLAB
3,165
104
%% VISUALISATION SCRIPT FOR CONNECTIVITY ANALYSIS %preparing source matrix, target matrix and weight matrix source_1=source; target_1=target; for i=1:length(source) temp=[source(i) target_1(i)]; in1=find(target==temp(1,1)); in2=find(source==temp(1,2)); if isempty(intersect(in1,in2))~= 1 source(...
8d77e003aa92075894f5436735749c9cf10c7e730f0f89605288965eb73010b8
MATLAB
3,165
80
function plot_spikes_aux(handles, USER_DATA,plot_number) par = USER_DATA{1}; spikes = USER_DATA{2}; spk_times = USER_DATA{3}; ls = size(spikes,2); par.to_plot_std = 1; % # of std from mean to plot axes_nr = par.axes_nr; ylimit = par.ylimit; class_to_plot = par.class_to_plot; max_spikes = min(par.max_spi...
a1645f7dbb837a02a546423f8986e5271bc0b24f76dc3e61ee58d10cd5070ef5
MATLAB
3,169
83
[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 %% mean_response = 1; n=1; plotting = 0; %% sugnificnt_cells = 0; cell_num = 0; for i = 1:length(datafile) ...
c54396b53381f76ad4bfcb8f0ff731bda95cffd6d841c9cd93a0b455545f8f1c
MATLAB
3,170
87
clear all [pl2_file,pl2_path]=uigetfile('*.pl2','Select all individual .pl2 files','MultiSelect','on'); datafile = fullfile(pl2_path, pl2_file); %% pre_time = 3; % time before onset to take in sec post_time = 6; %time after off to take in sec response_window = 120; samp_rate = 1000;%samp in HZPF %% %RAMP LFP FROM PL2 L...
c9b2f7599ab6427300f4e60df7b1728753c4d95256c88bf40fe329e0d11ef710
MATLAB
3,173
87
function plotFigPos(hFigPos, hClust, hCfg, selected, maxAmp) %PLOTFIGPOS Plot position of cluster on probe c1Data = hClust.exportUnitInfo(selected(1)); if numel(selected) > 1 c2Data = hClust.exportUnitInfo(selected(2)); end if ~hFigPos.hasAxes('default') hFigPos.addAxes('default'); ...
59c6f2636bddb4f127cc0e4ce48fe5a75c7da5a9f3246f48bc5dbfa4efaa766d
MATLAB
3,174
81
function import_structures(jsonfile) %% Import structures ontology from Allen Brain Map into Matlab % Explanation of structures.level: % % 2: regions, see structures.region % % 1: groups, see structures.group % % 0: the rest of the nodes grouplist = {'Isocortex','Olfactory areas','Hippocampal formation','Cortic...
1902b21acb3aaf83a9050987f41476d421ab92198e301a01f0e0fcff0d89d76f
MATLAB
3,177
80
function ANOVA cd('C:\Users\C238\Desktop\touchcellLtRt_matsuda'); load('anovadata.mat'); Include3ArraySpike2=[]; NotInclude3ArraySpike2=[]; Include3ArraySpike3=[]; NotInclude3ArraySpike3=[]; Include3ArraySpike4=[]; NotInclude3ArraySpike4=[]; for a=1:length(LtRepeat5TouchSpike2FR_BinArray(1,:)) if ...
e062772b820dc89943912b9fc2b1dd7723c7e22fc48c0bebf1d6a62b45f0e179
MATLAB
3,182
97
function [index,xf,thr] = index_detect_pol(x,par) % return the spike times within a channel %PARAMETERS w_pre=par.w_pre; w_post=par.w_post; ref = ceil(par.ref_ms/1000 * par.sr); detect = par.detection; stdmin = par.stdmin; stdmax = par.stdmax; awin = par.alignment_window; if par.sort_order > 0 xf = filt_sig...
8c4757cc3db269cf1f30176ad56c38feee5cb8e443b1702ebf06546eabb7354a
MATLAB
3,183
123
function newmap = bluewhitered(m) %BLUEWHITERED Blue, white, and red color map. % BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white % to red colormap, with white corresponding to the CAXIS value closest % to zero. This colormap is most useful for images and surface plots % with positive and...
6a6bcec8914049e5042c156ce3628c1a3c0d7a04815175011a16997ee6a41690
MATLAB
3,185
125
function controlfilename = createLCmodel_control_svs(metabname,l1,l2,l3) controlfilename=[metabname '.CONTROL']; % create .CONTROL file for LCModel disp(['Creating file ' metabname]); disp(' ') if findstr('se_140',metabname) te=140; elseif findstr('se_30',metabname) te=30; else te=18; end do_water_scaling=1; do...
652c778b5f8285ba77bd4dbd81dec03c43ae877d38eb92ef0e7890f28fbcf755
MATLAB
3,189
93
% info content similarity: the difference of av-err and iti-rand deocidng % what we want to equalize is info content between av-err and iti-rand % -> only measure those two % -> quantify gaging with info content and use av-iti to demonstrate % that the result of the gaging procedure gives low accs %% clear p = par...
08e83ac0bf0cb22f78ed3d9de99f0a175b160dcf9b74f7972fb01229df0bf690
MATLAB
3,190
136
% close all clear clc addpath(genpath(extractBefore(mfilename('fullpath'), 'PinkNoiseTest'))) fs = 250; Minutes = 10; nPoints = fs*60*Minutes; MinCyclesPerBurst = 4; % minimum number of cycles per burst % % Burst Thresholds for finding very clean bursts % BT = struct(); % BT(1).isProminent = 1; % BT(1).periodConsi...
8fd3ae859c0b0e6d4befc01553cb0326257dfd849ed95be0487f838f5660cc41
MATLAB
3,193
89
function varargout = Ragu_TTable(varargin) % RAGU_TTABLE M-file for Ragu_TTable.fig % RAGU_TTABLE, by itself, creates a new RAGU_TTABLE or raises the existing % singleton*. % % H = RAGU_TTABLE returns the handle to a new RAGU_TTABLE or the handle to % the existing singleton*. % % RAGU_TTABLE('C...
7a9781d623c541f5ac1644f90541a0ddf302a9fe0f00a1d9791fc896f5a85f3f
MATLAB
3,199
97
clear close all clc % load ECG1 % s = data; load ECG2 s = data(5, 1:2*fs); % s = randn(1, 10000); fs = 1000; % load ECG3 % s = data(2, 1:end); % addpath 'G:\Sameni\Documents\Papers\Journal 40 (Spline ECG Filtering)\CODES' % pth = 'J:\ECGData\Arrhythmia'; % fs = 360; % % wd = cd; % cd(pth); % fname = '233'; % segs...
31ba06613ff544b6ce81787b781f784723d3dac39ddcea466f8347b14292023e
MATLAB
3,203
70
function [muDeltaT, range] = getMuDeltaT(st, events, varargin) % Computation of mean delta-t of unit cell-pair spikes. % % [muDeltaT, range] = getMuDeltaT(st, events, varargin) % [muDeltaT, range] = getMuDeltaT(st, events, range) % % Description: % Identify spike of n'th unit that is closest to specified even...
84776103137de9a4648d07d4cb54ea4a004c9d3e497a5144a52d4898a95eb9e9
MATLAB
3,204
85
function hFigWav = plotMeanWaveforms(hFigWav, hClust, maxAmp, channel_idx) %PLOTMEANWAVEFORMS Plot mean cluster waveforms in FigWav hCfg = hClust.hCfg; showSubset = hFigWav.figData.showSubset; if hCfg.showRaw waveforms = hClust.meanWfGlobalRaw; else waveforms = hClust.meanWfGlobal; ...
febf5927b2e6bf93ecb24b1f7f7c4b811f7c8facf6cc1f3d28f276573abe7c82
MATLAB
3,204
126
function [estParams, LL] = myfastfa(X, zDim, varargin) % % [estParams, LL] = fastfa(X, zDim, ...) % % Factor analysis and probabilistic PCA. % % xDim: data dimensionality % zDim: latent dimensionality % N: number of data points % % INPUTS: % % X - data matrix (xDim x N) % zDim - number of factors % % OUTP...
bacad77c9fd05e0b7bf4179ae656b3a983e0aee8131f8877295fced23fb0d01e
MATLAB
3,206
72
function [data] = JT_processFP_clipthenprocess(data,params) %Process Fiber Photometry % % [data] = processFP(data,params) % % Description: This function is designed to process fiber photometry data % for the lab. The function performs demodulation (if selected), % filtering, baselining, and downsampling ...
bbc34db812ba88ae9901bad3271c09a9e1cbdc5e304262ace68d8350b0f81f15
MATLAB
3,206
123
function [gdata, st, newData] = applyRetroMC_nufft_2D(kdata_in, alignMats, alignDim, alignIndices, useTable, dataDims_mm, fullMatrixDims, kspaceCentre, cgIterations, oversampFactor) % rehash of main function to work on simulated 2D data % % This is a bit 'quick-and-dirty' implementation, but as 2D is so much % faster t...
4e62e0c7dd5252cd91a0dbf7535d305b26182194049fe3b105708fc93ddab62a
MATLAB
3,207
79
%% load and prepare the data clear clc close all cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\DREEDDS_VS_CONTROL\new_IR_calculations\test_mixed_effect_models') load("all_cells_with_tages_and_cell_idx.mat") % load("all_cells_before_after_fit_parameters_DREEDDS.mat") % load("all_cells_dreadds.mat") %...
8225276ac0d64208dde477171e07aa49e6c81da384376caafad2cf522d15bfec
MATLAB
3,208
86
function v = logdet(A, op) %LOGDET Computation of logarithm of determinant of a matrix % % v = logdet(A); % computes the logarithm of determinant of A. % % Here, A should be a square matrix of double or single class. % If A is singular, it will returns -inf. % % Theoretically, this f...
818dc3d8d97aab5878aacd37a52dd2c74f9a2a73d1c65b2e74617e57e7d7427b
MATLAB
3,213
86
%%devide_cells_by_aria clear clc %% %save only Intensity encoding + IR row_names = {'total'; 'responsive'; 'IR'; '%_reponsive'; '%_IR' }; [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 = f...
a6e22a76780914fcd6712abe5658c8cdf6c3e11d7573dc90d848dd35764cfea9
MATLAB
3,217
102
% This script conducts a time-frequency analysis across the entire EEG % recording. The next script will then epoch the data. A special thanks to % Sven Leach and Maria Dimitriades for the script for the wavelet % transformation. clear clc close all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
3379a3b52feeb23330445a90dd955fdc65f5a4b80152c2d8e37da7d565ae986d
MATLAB
3,219
101
function [bse,CI] = rst_bootse(varargin) % Computes the bootstrap standard error % % FORMAT [bse,CI] = rst_bootse(X,estimator,nboot,q) % % INPUT X is a vector or a matrix, in this case HD estimates are computed column-wise % note that matrices can contain NaN - and this is accounted for % estimator s...
d2a94a97b5c0f63e57b6acd7a50d226986a86552a965142a71ec96636d11d0e1
MATLAB
3,219
88
function [centers, logRho, zscores] = detrendRhoDelta(hClust, spikesBySite, fLocal, hCfg) %DETREND Detrend rho-delta plot to identify cluster centers (high rho, high delta) logRho = log10(hClust.spikeRho); delta = hClust.spikeDelta; if fLocal % detrend for each site rhosBySite = cellfun(@(spike...
25001490ef906b508be5567342a286e881d81c21ab0ac9e22449fd6f74c6c72a
MATLAB
3,220
111
function fs_roi_overlay(roi_csv) % FS_ROI_OVERLAY Create a surface overlay from ROI results % Map scalar values for each label ROI in the Destrieux atlas % to a Freesurfer curvature overlay for use by Freeview % % AUTHOR : Mike Tyszka % PLACE : Caltech % DATES : 2019-07-16 JMT From scratch % 2019-07-18 J...
7a06d494aeff5641cb6d514bb640c84e14bb21310d7311edf946ecb99b2563dd
MATLAB
3,220
127
function f= get_coresponding_water_ref(rawname) if isstruct(rawname) % this is a matlab fid struc ff = rawname; name = ff.sujet_name; exam = ff.examnumber; if strcmp(exam,'E1'), exam='';else exam=['_',exam]; end; region = [nettoie_dir(ff.SerDescr) '_ref']; if ~isempty(findstr(ff.SubjectID,'DYSTO...
b182fb267de2e8b3b5e0dd7304036d186ee6d63fdf600f7c14d010dcf282c62e
MATLAB
3,223
86
function [y, W, A] = periodic_component_analysis(x, peaks1, varargin) % periodic_component_analysis - Pseudo-Periodic Component Analysis (PiCA). % Extracts and ranks sources in order of resemblance with % pseudo-periodic events (such as ECG) with one or two sets of cyclic % peaks, from multichannel data % %...
262de0e39b549feefec92654a624d077f3168e56a073d774191a143d0a4ef392
MATLAB
3,230
111
%% PLOT PSTH BY STUFF like aria [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 shift = 0.116; pretime = 3; shiras_shift = 1.1; binsize = 0.01; %% create a t...
b04e229fc5b59eefb7bde08557c0eac31489e9f4920639d6fbbe054c3729408b
MATLAB
3,232
114
function [meanimg,stdimg] = spmup_basics(P,varargin) % routine to compute a basic mean and std on a trime series % % FORMAT out = spmup_basics(P,operators) % % INPUT P is a string of images to use % operators can be 'mean' 'std' (or both) % % OUTPUT name of files om the drive % % Cyril Pernet % ----------------...
98d9d038cd1c00225f038053ff4b4bd9f678e83673bc9e2dae270fbd9a25dbd0
MATLAB
3,236
63
function [FinalIm,ActualComp,datestamp] = MakeIncompleteLetterFun(ImWidth,ImBorder,ConInc,CheckSize,WhichLetter); % [FinalIm,ActualComp,datestamp] = MakeIncompleteLetterFun(ImWidth,ImBorder,ConInc,CheckSize,WhichLetter); % % function to draw a single incomplete letter % needs inputs of ImWidth (image width in pixels), ...
e9686aa7f15591121ab532dd9b9f76fa5af75d007280d416ed177a90be5338e2
MATLAB
3,238
98
function res = mergeUnits(obj, spikeClusters, mergeTargets, mergingUnits, metadata) %MERGEUNITS Speculatively merge a pair of units, returning a snapshot of %the spike table and metadata fields. if nargin < 5 metadata = struct(); end res = struct('spikeClusters', [], ... 'me...
9b54620bde607c5b308a05643cd1942628515ff2fe4958c4f66a9ba2da3eebf2
MATLAB
3,242
136
close all; clear; clc; % parameters subject = 'Dog_2'; number1 = 1; number2 = 4; path = '';%['J:\Seizure\' subject '\']; mode1 = 'interictal'; mode2 = 'interictal';%preictal'; ch = 1:16; % desired channels time = [8 10]*60; % in seconds nfft = 5000 - 1; SpectralWinLen = 10; % in seconds SpectralOverlapPercentage = 50;...
7d6f923a2466bcadd95478cc4116cf22c269698907bcd1d0a24e88f518b8d623
MATLAB
3,245
113
function [P, Q, R, S, T] = ecgWavesSoI_k(ecg, Rpeak, RRf) % % 'knot based' version. % This function approximately finds the peaks and borders of the Q and T waves % in the input ECG signal. % % Inputs: % ecg: Single channel ECG signal % Rpeak: R peak positions % RRf: R-peak referenced flag; if true, R p...
7d65035196c1b7c356b5a431404eb3a1a0c1e6f1a8201fcad0c7303ac174228e
MATLAB
3,247
129
function KLexcel20190626 global dpath dpath3 % cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); % dpath=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\'); % dpath3=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); cd(dpath3);...
09e53e46f3053bf3dc9bca1fd7d9177fd8de699a8d5a497c797090da2beb3802
MATLAB
3,254
71
% This file is a demo for testing the EMG analysis/quantification functions % This function is produced by Esmaeil Seraj (esmaeil.seraj09@gmail.com) % % Dependencies: Functions "bdf2mat_main.mat", "emg_onset.mat", % "emg_quantification.mat", "BPFilter5.mat", "BaseLine2.mat" % and "sig_tren...
579202bb762233cf3b2e984f9790293369cc65f9a54004ac1e025f0087ed8b43
MATLAB
3,255
84
% Copyright 2024 Eelke Spaak, Donders Institute. % See https://github.com/Spaak/rift-phase-and-visibility for readme/license. % Belongs with: % Spaak, E., Bouwkamp, F. G., & de Lange, F. P. (2024). Perceptual foundation and extension % to phase tagging for rapid invisible frequency tagging (RIFT). Imaging Neuroscie...
5202c26573ff0994ac6cd6b8daaa0c58056c89d415b9664fc8cc9a461ee4a798
MATLAB
3,258
92
% Plot Raster Sorted by Activity Rate: % AR=Active Frames/Total Frames by Condition % Run after Selected Conditions % Input % R_Condition: Cell of ACtivity Matrices % Condition_Names: Cell of Condition Strings % fs: Sampling Frequency % SortingIndex: (Optional) Sorting cell index % Conditi...
f34c52c9966a7b322530e4d7259b3a9dc11ca61119873e94aff8c2e028e6d43e
MATLAB
3,263
104
function Stats = anova2way(Data, FactorLabels, Factor1Labels, Factor2Labels, StatsP) % runs a repeated measures anova on data in the form of: P x m x n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% set up data % remove all data listwise if there are missing values % remove whole tas...
fe336ec4f236e2a4e1d4299d77e3606228dba38ccfb3ed9d49ea752ce7ac20f0
MATLAB
3,265
99
function success = splitPoly(obj, hFig, shift) %SPLITPOLY Draw a polygon or rectangle around points in a feature %projection and split off a new cluster. success = 0; if numel(obj.selected) > 1 return; end iCluster = obj.selected; if shift hFig.addPlot('hPoly', @imrect...
dee30fdb0fb4fdac5722b0d7e85266d8cd761cd6b9d09d7dc9b85190b6566906
MATLAB
3,268
113
function remain = assignopts (opts, varargin) % assignopts - assign optional arguments (matlab 5 or higher) % % REM = ASSIGNOPTS(OPTLIST, 'VAR1', VAL1, 'VAR2', VAL2, ...) % assigns, in the caller's workspace, the values VAL1,VAL2,... to % the variables that appear in the cell array OPTLIST and that match % the ...
fdb3375fdab89b4572346c7a81aa7fd0a122c2aa594a8a4455c4cc0512d95f72
MATLAB
3,268
126
function project_point_set(points,varargin) %PROJECT_POINT_SET Use projection to illustrate a point set of S^2 or S^3 % %Syntax % project_point_set(points,options); % %Description % PROJECT_POINT_SET(POINTS,OPTIONS) uses projection to illustrate a point set % of S^2 or S^3, represented by the Cartesian coordinates POIN...
0dd467fc2b82c73dd61ab4ab851f6286d7ee2b2ad65553d3937634a711e11629
MATLAB
3,269
93
clear clc %% [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 p = 0.05; %pvalue numofint = 4; %number of intensities to check for response mkdir (['significa...
cf2f944f1df8792fee5076394dee18df8df8dea543f52d1bc3ee59fc19410d4d
MATLAB
3,269
76
%Step 3 of CBIG Kong2019 Brain Parc Pipeline % %To run: 1. Open Matlab using salloc (ex: `salloc --mem-per-cpu 6G --time 2:00:00 --x11`) % 2. source your config file containing the $CBIG_CODE_DIR variable % 3. `cd` to the $CBIG_CODE_DIR/stable_projects/brain_parcellation/Kong2019_MSHBM/step3... folder % 4. `cp` thi...
2714a2f6013114274c9aef3dc3be90ae0acad03f951b739d005a7baa7e5df23d
MATLAB
3,273
106
function mnl_ImagesOfClusters(efPxTrace,dim,Clusters,ChosenClusters,ScaleFactor) %Specify the new dimensions NewDim=[round(dim(1)*ScaleFactor) round(dim(2)*ScaleFactor)]; %White Background BW=ones(NewDim(2),NewDim(1),3); %% Draw in all the traces %Get all the Points nTrace=size(efPxTrace,2); VxList=[]; disp('Drawing in...
53f70b5ac9de6333245f238d189241b7af492c95713b70655ab0ff46deb42c88
MATLAB
3,273
122
function newmap = bluewhitered(m) %BLUEWHITERED Blue, white, and red color map. % BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white % to red colormap, with white corresponding to the CAXIS value closest % to zero. This colormap is most useful for images and surface plots % with positiv...
205fbb3ee4897be57ec5c9642047589365a552ec5a8337f172c814fad8c7a2cb
MATLAB
3,276
92
function [ECGmean, ECGsd, meanPhase, ECGmedian, SamplesPerBin] = avg_beat_calculator_phase_domain(x,phase,bins,flag) % % [ECGmean,ECGsd,meanPhase] = avg_beat_calculator_phase_domain(x,phase,bins,flag) % Calculation of the mean and SD of ECG waveforms in different beats % % inputs: % x: input ECG signal % pha...
538e46b8bcf19fb4897f7b6a0ce1c12334e22247206f16479d85f5fa8cc66ebb
MATLAB
3,276
78
function [] = batch_pcs(sis,MAXD) %% prep t = clock; LIST_SBJ ={'Subj001_AAA', 'Subj002_BBB', 'Subj003_CCC'}; list_sbj = {LIST_SBJ{sis}}; path_local = '/PATH/TO/LocalDIR/'; %% param_in %{ param1. zero prediction error threshold of SPE param2. learning rate ...
6f447fc3cbf28d44c6c32dc77aa778672fcb64b002ad744ea0f5fe4d58a1f5d1
MATLAB
3,280
94
function tera20190612 global EnveRLPhaseTM EnveCCresultSpikePro tfile nanEnveRLTM=isnan(EnveRLPhaseTM); K=find(nanEnveRLTM==1); if length(K)<100; [pksRL locsRL]=findpeaks(EnveRLPhaseTM,'Minpeakdistance',40); [pksCC locsCC]=findpeaks(EnveCCresultSpikePro,'Minpeakdistance',40); ArrayRL=[]; for j=1:length(locsCC...
80aac2ab26ac7c36ef466d967754ecb33526c2d5093af1e92a02d4af9d61b0b1
MATLAB
3,281
109
clear, close all load noise_data.mat load noise_measures.mat %% Prepare figure f = figure(1); f.Position = [20 20 600 800]; f.Color = [1 1 1]; t = tiledlayout(3,2); scale = 1e6; % Top ax1 = nexttile; set(gca,"LineWidth",1) plot((noise_25mV.time-10),noise_25mV.I*scale, 'LineWidth', 1, 'Color', '#F5266D...
88040f0e9f1a5cf92bcac63ebd01cdeea0de86142f7c4a1944e66d9a521ef822
MATLAB
3,282
83
% Script to quantify the amount of movement during the eyes open / eyes % closed task with and without the presence of EEG. % Zelekha Seedat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Housekeeping clear all; close all; addpath('R:\MATLAB\OptiTrack'); % Choose directory to sa...
aa1a5f9600fa9845766b82305d0e3167eb2462d22fd2efa624f5fd297db326f5
MATLAB
3,282
100
% plot beefore and after from all data clear clc ploting =1 ; window = 2; %(on, sus, off) sus_window = 65:125; %% [file, path] = uigetfile('*before.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); ...
16f667bed1e0152336133c0359a75312042302817309d4998f149650486402bd
MATLAB
3,285
91
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_avoid_dims'); saveData = 1; saveFigs = 1; n_rep = 80; % 110s n_dc_...
7ce294703ba24a65825f8fab56a5e7ced8a98a112bdc0fa3f8e18d5c48735be0
MATLAB
3,287
122
close all clear all; clc; load current_p0 load current_p200 load current_p400 load current_p600 load current_p800 load current_p1000 dif_ar= []; set(gca,"Colormap",jet) zero = current_p0(1:2:end,:); zero_ser = current_p0(2:2:end,:); zero_mean = sum(zero(:,50:60),2); zero_mean_ser = sum(zero_ser(:,50:60...
3c750478fbfd186ace794f519db7a8c4052e640d9c50a6205aa10129dbaa7f3c
MATLAB
3,288
77
% close all [ surfaceFaces, surfaceVertices ] = stlreadNonCleaning("Data/Models/leafAndDragonfly.stl"); surfaceVertices = surfaceVertices - mean(surfaceVertices); surfaceVertices = surfaceVertices * roty(0); surfaceVertices = surfaceVertices/ 500; figure % set( gcf, 'position', [ -3494 ...
fcd40e8ec7f044f442700ef26d37c6f7f8889f778ac2f34dc4b95223fda0b467
MATLAB
3,288
110
function indexCell = downsampToMatch(varargin) % Randomly subsample from multiple vectors in order to achieve matching % distributions. % Inputs: % optional number of numeric vectors % optional Name,Value pairs: % 'resolution' - resolution of how tightly to match distributions. Defaults % to that found by histcoun...
3d847dbb03583f54e9ef531dd14a3c7473034f8f7eb60cfd4e7e59e6b80416ca
MATLAB
3,289
69
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The following code checks for the relevant MEX files (such as .mexa64 % or .mexglx, depending on the machine architecture), and it creates the % mex file if it can not find the right one. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
a7a6f02912c93d3d686438c9375fcee0e774e6c856fb714829eb1d164f621a85
MATLAB
3,290
125
% First find beads (ROI) make sure that this is acceptable before moving on % to the next step. function [rois] = find_peaks(cdata, map, ROIspan, sigma, closefactor, edgebuf, warp_cut) %% Find peaks and display their location grayImage = cdata; maxlim = max(max(cdata)); clims = [1 maxlim];%Specifies the limits for the...
0dc18194387b8030cf5baa2187ace39261d5bcf1992648194872b09a7216d2ba
MATLAB
3,291
82
classdef pointer_resp < handle %POINTER manages the data to display and the rwaves to display % Detailed explanation goes here properties start_idx stop_idx dspl_strt_idx dspl_peak_idx pre_idx post_idx dur ax_1 ax_2 leng...
25406dc6df16ffd798f674d33e83bc26f555dca261736fbf9f44751dcfb723ac
MATLAB
3,292
99
function [weights, trainerr] = cnntrain_inv_mat(layers, weights, train_x, train_y, params) params = setparams(params); assert(length(layers) == 2); assert(length(weights) == 2); layers{1} = cnnsetup(layers{1}, 0); if (~iscell(train_x)) layers{1} = initact(layers{1}, train_x); else layers{1} = initact(layers{1}, t...
057f89c1b99c8401b3ffe89efcf3dbe4fe98c160e7815800c62ee5245f6434b3
MATLAB
3,293
102
function M = mz3_read(filename) % Read MZ3-formatted data from disk % FORMAT M = mz3_read(filename) % % filename - MZ3-formatted file name % M - data structure %__________________________________________________________________________ % % MZ3 Format Specification: % https://github.com/neurolabusc/surf...
34d70c159dacb9e5792041df9695ef5ed6f8f305fc8b6e7edcee81719bbf8150
MATLAB
3,293
68
% Cardiac model ToR-ORd % Copyright (C) 2019 Jakub Tomek. Contact: jakub.tomek.mff@gmail.com % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the Licens...
7522552ab44f104ae575b3a7e4a11d36a91a2dc459bf4e9c6dd208a095aedfdc
MATLAB
3,294
78
function [OriginalArray1,OriginalArray2,ModifiedArray1,ModifiedArray2]=Modify_Events(WaterOnArrayOriginal,WaterOffArrayOriginal, StartTime, FinishTime, EventName) %‚à‚Æ‚à‚ÆWaterEvents‚Ì‚½‚߂ɍ쐬‚µ‚½‚̂ŕϐ”‚ªwaterŠÖŒW‚ɂȂÁ‚Ä‚¢‚邪A‘¼‚ÌEvent‚É‚àŽg—pBFloorTouch,Drink,,, %WaterOnArray‚́AÅ‰‚ƍŌã‚âƒf[ƒ^”²‚¯‚È‚Ç...
86871dad2f3b91b344b9248c8ca9abd5d19e0d90b610e4d397a9fdd8a99209d8
MATLAB
3,299
91
%% save all_data files to breain render table % A map showing the (14) cells that are transient light-responsive, (15) cells that are sustained light-responsive, (13) cells that are both transient and sustained light-responsive, and (16) all recorded cells. % A map showing the (11) cells that are transient intensity-...
dd84dfc5c2bb516a62e23bce10f8c2eb13c60fdc01b49fac1080f454da202ebd
MATLAB
3,299
97
function [Data, TimeEEG] = sync_eyes(EEG, SyncTrigger, Pupil, DiameterColumnName, Annotations) % synchronize pupil data to EEG data based on first trigger in Annotations % EEG is an EEGLAB data structure. % Trigger0 is a string of the first trigger type in annotations % Pupil is a table with the timestamps and whatever...
34eb4cd4f305e1af90a3f745e9192a5a758c4ba23488d6b2b9ea580107b884fe
MATLAB
3,300
129
function [c,l] = fix_wavedec(x,n) % Does a haar wavelet decomposition with n scales. % Avoids using wavelet toolbox Lo_D = [ 0.7071 0.7071]; Hi_D = [-0.7071 0.7071]; s = size(x); x = x(:)'; c = []; l = [length(x)]; dwtEXTM = 'sym'; shift = 0; for k = 1:n lf = length(Lo_D); lx = length(x); lenEXT = lf...
6872fe9779c40cf9fa0231606fed20bbc370cca639fb07a72f13180042af6fda
MATLAB
3,300
96
%{ ---------------------------------------------------------------------------- Analyzing behavioral data At least for the correct rate ---------------------------------------------------------------------------- %} function Figure2b_Dual_behave_analysis_block1_200706_plot5_precise2 close all % data = a04_2...
176d17a1563b906d302bc9a4fc92814b563b3aa8a8f7ac4a1574ef74eeeaf03c
MATLAB
3,303
79
% Get block onset and offset for each session % Convert block onset/offset to index % debugging: some MSessionExplore do not have reference time load('E:\seFilePaths_all'); for m = 21 % 1:size(seFilePaths_all,1) tic % Get block ind for individual mice MouseName = seFilePaths_all.MouseName{m}; ...
1845de78148a7c48144e78c604d509f3b22c64570c45ab79a36cf81e2a19f9b4
MATLAB
3,303
139
function plot_adjust_phase(action) persistent diffid fid1m fid2m info hdl mean_line_broadening=0; if isstruct(action) hdl = []; fid=action.fid; info = action(1); ns = size(fid,2)/2; fid1 = fid(:,1:ns); fid2 = fid(:,(ns+1):end); fid1m = mean(fid1,2); fid2m = mean(fid2,2); if (mean_line_...
5abe8b90f3c2b51b5623c5428a369aa675e454effe8114a752754b2e6cc6184b
MATLAB
3,305
112
function [pow]=Analyse_FFT(x,y,pow,autoLevel) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % - - - - - - Variables that can be changed - - - - - - % % Set the accepted time error in seconds for each sample % This variable checks that the time steps are evenly spaced timeError = 0.25; % Set the lowe...
d908181f9d87b38b1d751393d530256b7c6f077bbc488a38a898df3543e9bf52
MATLAB
3,307
81
function [vcg, phi] = vcg_gen_state_space(N, fs, f, alpha, b, theta, theta0) % % vcg_gen_state_space - Synthetic cardiac dipole/vectorcardiogram (VCG) generator using a state-space form of a sum of Gaussian model. % Refer to references for further details. Performs identical to dipole_gen_direct_sum. % % Usage:...
6399d8fb3a30c18b8081a0eb31dea926fb4093373756767597de98e12eb2d355
MATLAB
3,310
76
%looks for missing chanels, then interpolates them clear all close all %HDBR data %eegdir1 = 'G:\BORI\bedrest\RENDEZETT\A) Bedrest_EEG\EEGÖsszes\EEGCleaned' %eegdir2 = 'G:\BORI\bedrest\RENDEZETT\A) Bedrest_EEG\EEGÖsszes\3.EEGInterpolated' %AMBCtrl data eegdir1 = 'G:\BORI\bedrest\RENDEZETT\A) Bedrest_EEG\...
90ef707e184d958a2e9fe14ffdaf23f633470d38a94ec5ff302545f0f47a4c2c
MATLAB
3,311
100
classdef mat_wc_reader < handle properties sr min_index max_segments raw_filename sr_infile t0_segments max_index segmentLength spikes_file end methods function obj = mat_wc_reader(par, raw_filename) obj.sr = []; ...
285e7d634b3b22c22b6fffab3f26a8888c9015697939b8ded16370c1cd31426d
MATLAB
3,312
58
function plotMovAlignData(data,choice) if isfield(data,'mov') mouseName = data.mouse; expDate = data.date; nFP = data.final(1).nFPchan; nEvents = length(data.mov.onset.ind); left_color = [0 0.7 0]; right_color = [0 0 0]; time = data.mov.time; onsetAvgVel = data.mov.onset.avgVel;...
801c69b8ddd2fcbd64c267d49110d8c1d067a8cfd713272a3ca36e2070ab2156
MATLAB
3,313
96
function [map, col, cm1, cm2] = fig7_whisker(folder, save) %% Figure 7: Sex difference in whisker sensorimotor system % Subplots/information: % - Connectivity matrix of sensorimotor map % - (not in Matlab) network cartoon figure % load nodelist or acros or something % match with diff/data.mat maps % fix SCs, SCm (11 r...
080f665ee51de48adf5a77156f378b983c4d4a457127001024fb9cc36143155a
MATLAB
3,314
123
function popt = partition_options(pdefault, varargin) %PARTITION_OPTIONS Options for EQ partition % %Syntax % popt = partition_options(pdefault,options); % %Description % POPT = PARTITION_OPTIONS(PDEFAULT,options) collects partition options, % specified as eRTIS_Sensor_Overlay, value pairs, and places these into the st...
6fb50066a7fbacaed0ddf1f4cd2e622a5e70d59e3a67fab60cbf8cd876af7d04
MATLAB
3,320
111
function [EST,CI,bootx,p] = rst_pbCI(X,nboot,alphav,est,q,mu) % function [EST,CI,bootx,p] = rst_pbCI(x,nboot,alpha,est,q,mu) % % Compute a percentile bootstrap confidence interval % INPUTS: % X is a matrix of data % nboot number of resamples (default 1000) % alphav is the alpha level (...
b124a6f8baf7de3df712b44b87755fd0493ca131efcb74f1a6de17641d6c1d2e
MATLAB
3,322
125
function [err, sn, T1] = nufft1_err_mm(om, N1, J1, K1, type, alpha, beta) %function [err, sn, T1] = nufft1_err_mm(om, N1, J1, K1, type, alpha, beta) % Compute worst-case error for each input frequency for min-max 1D NUFFT. % in: % om [M,1] digital frequency omega in radians % N1 signal length % J1 # of neighbors use...
efac5a2c3bddc1f854d7d56e254c358ccfd8b561758c948d2a9ca7e8c04f2627
MATLAB
3,331
88
function get_good_channels(data_f,path,files) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Get rid of bad channels % Get rid of bad channels in data ch_table = readtable([path.meg_data,files.channels],'FileType','text','Delimiter','tab'); ch_table.isx = endsWith(ch_table.name,'X'); ch_table.isy = endsWith(c...
16ada93d2317e1579d37e86eb0cf9d52165df5cb734afa1eee2f9b21f0651648
MATLAB
3,332
81
% MeasureNoiseCheckProperties.m % % function to loop through Noise Check images (used in Incomplete Letter generation) to % find a likely ConInc (contrast increment) for a patch of noise with given dimensions to later be sampled for incomplete letter generation % % code by J Greenwood % v1, June 2023 %% get started c...
9551c31551967bf501f18b29f8c138a97913da9df3dc6a7426289640da501390
MATLAB
3,332
94
function [brst_files, int_templ, path] = find_xls(app) path = uigetdir(pwd, 'please select master folder that contain all *.xls files to combine'); files = dir(fullfile(path,'**','*.xls')); tmp = string([]); for i = 1: length(files) tmp(i)= string(files(i).name); end [~, tmp_idx] = sort(tmp); files(tmp_idx) = fil...
40972a397cc56563a8961e9fd56daaf5aca6e33533ad4fa62710712358a332ec
MATLAB
3,334
103
function terashita190510 %1Žü‚̊ԂŃ^ƒbƒ`‚̃Cƒ“ƒ^[ƒoƒ‹‚ÉŠÖ‚·‚éƒq[ƒgƒ}ƒbƒv‚ðì»‚·‚é cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); dpath=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\'); dpath3=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-...
957c9ba471a95fae62401e7e47f9dea6466b6998c5e3abc5a72b0a8377e695ee
MATLAB
3,335
96
clear; clc; binsize = 1; %sec samp_rate = 40000; ploting = 1; %% [file_cell_display, path] = uigetfile('*.mat'); %LOAD CELL_DISPLAY FILE datafile_cell_display = fullfile(path, file_cell_display); load(datafile_cell_display) cd(path) [file, path] = uigetfile('spike_clusters.npy'); datafile = fullfile(path, file); spik...
056672531d54f601ce4177aa9c479df848610901e9f14c7f04db5d641463bbef
MATLAB
3,336
88
function varargout = Weights(varargin) % Pops out a simple figure that shows the weights of the projection % vectors % Possible ideas: % Have user manipulate bars to change the projection vector values % Inset the bar graphs into the DataHigh display, so as the person is % navigating, it instantly updates ...
978d2f2f4c2246e9871f1ff5ad92164e03ef246bfce279c7fd46b98833541ddd
MATLAB
3,342
79
function [data] = JT_processFP_clipthenprocess(data,params) %Process Fiber Photometry % % [data] = processFP(data,params) % % Description: This function is designed to process fiber photometry data % for the lab. The function performs demodulation (if selected), % filtering, baselining, and downsampling ...
25f81a73b63f644e064813dc079f1eb4e0f6127fc39126809ec783600a897320
MATLAB
3,344
81
%{ ---------------------------------------------------------------------------- Analyzing behavioral data At least for the correct rate ---------------------------------------------------------------------------- %} function FigureS1g_Dual_RL_analysis_220314_para_compare_220912 close all analysis_folder = { ...
7f9078442b6897297cfe6ff1ba9574d2a256fae3ce230f5f7cf299352254df92
MATLAB
3,344
105
function [C,Im_Label] = Apply_CNN_Im2Im(My_CNN,Im) % This function gets a trained neural My_CNNwork and a grayscale image and produces a matrix of probabilities. % Each pixel in the output matrix contains the probability of the corresponding pixel in the grayscale image of being % a neuron pixel or a non-neuron p...
ebcb1aa6f3458fd05e77cb8efbc7bc765504a98181559316d04568c41ad8d7d7
MATLAB
3,344
79
%Class for handle 'nc5' files. Wave_clus uses the firsts letters of the m file to now what files it can open. % %The classes used by readInData need the methods: % - A constructor, with inputs par (parameters) and % raw_filename (name of the file to read). % - A get_info() method that return: [sr, max_segment...
2accb389bee9a5bf90f8624db461682eac6b35d3db17a6e76ee08b3f5807a405
MATLAB
3,345
91
function [data, name, T] = load_mat_v4(filename) % LOAD_MATV4 Read and extract data from a MAT-4 file. % % [DATA, NAME] = load_mat_v4(FILENAME) reads a MAT-4 file specified by % FILENAME and extracts the data stored in the file. It returns the % extracted matrix data in DATA and the name of th...
8f5eae202ab22b62398a47790eb609b016ebfc3075774440d0184c34fccfc369
MATLAB
3,345
68
function trials = getRunAndPupilInfo(trials, runInfo, pupilInfo, options) if ~exist('options','var'), options=struct; end % timing options if ~isfield(options,'preTime'), options.preTime=0.2; end if ~isfield(options,'postTime'), options.postTime=0.8; ...
8c2717bc3565c1041914282d61df20b6e92cd9b270a4697d77aaf31339880743
MATLAB
3,346
106
function [headmodel] = ft_read_vol(filename, varargin) % FT_READ_VOL reads a volume conduction model from various manufacturer % specific files. Currently supported are ASA, CTF, Neuromag, MBFYS % and Matlab. % % Use as % headmodel = ft_read_vol(filename, ...) % % Additional options should be specified in key-value ...
b5a73e9a0c58ea2b34cede5eae6b1bf9a95ac23534d62a7d63444252c32fb1c8
MATLAB
3,348
87
%% Download and import the AMBCA data % This process takes a while but needs to be ran only once. build_database; %% Top 20 areas targeted by Barrel cortex % Load metadata load('experiments', 'experiments'); load('nodelist', 'nodelist'); % Load experiments targeting barrel cortex and average them barrel_experiments =...
0e66c765ab8679de692758915466216f271822e293b031ea57362b8cf8f62fce
MATLAB
3,357
91
%-------------------------------------------------------------------------- function s=simple3d(im,n) % Decides whether the central point of IM is a simple point % 6-simple means that T_6(IM)=1 and T_26(~IM)=1 -- 26-simple is the opposite % Authors: Viren Jain, Mark Richardson, M.I.T. if ndims(im) ~=3 error...
df81c9525aa37bebb89ab10e56b1f1460015a9c68463b46fb5a357ce36cee8c8
MATLAB
3,357
105
% Copyright 2024 Eelke Spaak, Donders Institute. % See https://github.com/Spaak/rift-phase-and-visibility for readme/license. % Belongs with: % Spaak, E., Bouwkamp, F. G., & de Lange, F. P. (2024). Perceptual foundation and extension % to phase tagging for rapid invisible frequency tagging (RIFT). Imaging Neuroscience,...
07da181058d4c1d067115a98795fa3b12adaabb24f3f7a7cb1cad9d5ccf6f10d
MATLAB
3,358
76
function slider_plot(f,EEGTEMP,MaxPos,Chanlocs,Param,TEMPGFP) % Function for generation of topoplots using a slidebar % Corentin Wicht % 05.06.2020 %% MAIN CODE % FIGURE % f = figure('units','normalized','outerposition',[0 0 1 1]); subplot(2,3,[3 6]); title(sprintf('Topography at %d TF',MaxPos)); topo...
5d904668f0c987956376640996c5db20a16af23e82ad99f46c003fc73afca733
MATLAB
3,360
135
function mergeComments(final_file_path,source_file_paths) %x Takes comments from files and merges them in to an older file % % adi.postp.mergeComments(*final_file_path,*source_file_paths) % % Optional Inputs: % ---------------- % final_file_path : string (default, selection) % Path to the file to which co...
50c021c9f2dc4cb2cc09f269c117695aafc12855ba98d1213e9251a46c29e329
MATLAB
3,362
76
% ConnectionMat_Fix.m is a function generating connetivity matrices % Input: % N_Post,NnPost,Size_Post: number, index projection, and grid size of % presynaptic neurons % N_Pre,NnPre,Size_Pre: Same for postsynaptic neurons % NeEx, Map_Ext: Extended index proje...