sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a875adde1037f18c70bfdbbcf42ffce0539c5393db781197bc6efc1b9fd1e993
MATLAB
2,829
69
function hFigWav = plotSpikeWaveforms(hFigWav, hClust, maxAmp, channel_idx) %PLOTSPIKEWAVEFORMS Plot individual waveforms in the main view showSubset = hFigWav.figData.showSubset; [XData, YData, showSites] = deal(cell(numel(showSubset), 1)); hCfg = hClust.hCfg; nSpikesCluster = zeros(numel(showSub...
9dfbe48b7823ef870002ab49368343c3b17093950373e32f9c73ad75aaaec770
MATLAB
2,832
87
% ************************************************************************* % * Test program for calculating popular phase related quantities, i.e. * % * Phase Shift (PS), Phase Lock (PL), Phase Reset (PR), Phase * % * Difference (PD) and Instantaneous Frequency (IF) in SINGLE or * % * MULTI-Channe...
e82fc8c7cda934160580e9ce7ff873d476f76f218c4c1be6279d907e12a88f40
MATLAB
2,832
83
function [weights, trainerr] = cnntrain_mat(layers, weights, params, train_x, train_y) params = setparams(params); layers = cnnsetup(layers, 0); assert(length(size(train_y)) == 2, 'The label array must have 2 dimensions'); train_num = size(train_y, 1); classes_num = size(train_y, 2); assert(classes_num == layers{end}...
2bc4428499d5148ed8cb40724993d9c41ae167c3f91f82e818911db49372b105
MATLAB
2,834
76
function [Signal, t] = simulate_aperiodic_eeg(Exponent, Offset, Duration, SampleRate, Plot) arguments Exponent = 2; Offset = 2; Duration = 30; % seconds SampleRate = 250; Plot = false; end % [Data, t] = simulate_aperiodic_eeg(Slope, Intercept, Duration, SampleRate, WelchWindow) % % Creates an artif...
9235b223df7b0405f78d6f5cc1a09dd55a6e2b14070fa30835c7cdc453a90410
MATLAB
2,835
90
function success = commit(obj, spikeClusters, metadata, msg) %COMMIT Commit a modification of clustering to history log success = 0; if obj.nEdits > obj.editPos % not at tip of edit history, back out warning('cannot branch from history; use revert() first'); return; end % create a b...
f14d92ceee59bf8e39666b2971f330327d348831762c9a9218f2105e12d0f462
MATLAB
2,835
91
function [saen,saenvar] = SampEnVar( dim, r, data, tau ) % SAMPEN Sample Entropy % calculates the sample entropy of a given time series data % SampEn is conceptually similar to approximate entropy (ApEn), but has % following differences: % 1) SampEn does not count self-matching. The possible trouble ...
dc17c4093784682e36f74824b5c4dc30aca50f9355bd89fc47c7955084dfffdf
MATLAB
2,837
85
function RLTouchPhase190513 %¶‘«‚̃^ƒbƒ`‚̊ԂɃXƒpƒCƒN‚ª‚ ‚Á‚½‚Æ‚«¶‘«‚̃^ƒbƒ`‚Ì’†‚łǂ±‚ɉEƒ^ƒbƒ`‚ª‚ ‚Á‚½‚© global SpikeArray RpegTouchall LpegTouchall TurnMarkerTime OneTurnTime OnWater fname tfile R_LPhaseindex % cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); % dpath=('C:\...
ad56163045d789936dbf16376517843694f2e9ab9ea25412f25d08a09715af27
MATLAB
2,838
108
% create psth vector from all data %% load all data files 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 %% calulate count = 0; nds = [10,8,6,4,3,...
85672d9d76eee53ed227771b159f8612409e6b458d0aa9d4919504c13bd092ce
MATLAB
2,839
83
function y = CartesianSphericalTransform(x, mode) % Y = CartesianSphericalTransform(X, mode) % Transforms between Cartesian and n-dimensional Spherical coordinates % See: https://en.wikipedia.org/wiki/N-sphere % % Inputs: % X: m x n matrix of row-wise Cartesian or Spherical coordinates % if mode = 'CARTtoSPHR' ...
c23c814adf01559bdb8cf31a0f9a5b87b7c500989641d8ee6f16f8a597b04163
MATLAB
2,842
109
% test plot adult ECG and VCG loops % Reza Sameni, 2005 clear; close all; % % % fs = 1000; % % % data = load('s0010_re.txt'); % % % % data = load('s0014lre.txt'); % % % time = data(:,1)'; % % % data = data(:,2:end)'; % % % I = 1:10*fs; % % % data = data(:,I); fs = 1000; load patient165_s0323lre; data ...
7838af8e3aab1918187a3330d0caffd975fedbe241d4102fe5c9c2c59d4cfed9
MATLAB
2,845
56
function Data = Match_Vertex_Rects_To_Segments_Skel(Data) % This function matches vertices angles and skeleton segments. % It runs at the beginning of the tracing code. These matchings are used as starting points for the tracing. % For each vertex it tries to match each angle to a segment (that is known to be conn...
e51d70c0390f5d250d7d4da4e802ae31165f6a885765d6bea32f8063357f5986
MATLAB
2,850
122
close all; clear; clc; % parameters subject = 'Dog_3'; number = 15; path = ['J:\Seizure\' subject '\']; mode1 = 'interictal'; mode2 = 'preictal'; ch = 1:16; % desired channels time = [7 10]*60; % in seconds nfft = 5000 - 1; SpectralWinLen = 10; % in seconds SpectralOverlapPercentage = 50; % [0 99] % load signals [x f...
b26e601787ba1dc51b3b5451eb830358b7b8eb423804dae36df413c9ae4cf0c9
MATLAB
2,852
87
function get_clean_video(X_SPARSE,fs,isSIGNAL,XY,r,W,H,NameOut) %% Description % Gets Clean Video Reconstruction from Estimated Fluorescence Signal % Previously loaded .mat File of Experiment: % INPUT % i:condition; j:#video from Experiment: eg.:RASTER{j,i}; % X_SPARSE=SIGNALSclean{1}; Clean Signals % isSIGNAL ...
7f5478dad71748c21e54c0296a5d6ea304e6e565119301292eeed8b68e47b881
MATLAB
2,854
77
function [peaks, peak_indexes] = peak_det_local_search(x, ff, varargin) % % peak_det_local_search - R-peak detector based on local max/min search % % [peaks, peak_indexes] = peak_det_local_search(x, f, flag, num_rounds, hr_update_fraction, omit_close_peaks) % % Inputs: % x: Vector of input data % ...
cda281d1ad27ded3cf6bab891b915455c08888d2e1410a9fe36563ff9c79b6ec
MATLAB
2,854
90
function [R, error] = multicluster_linear_regression(A, n_trials, if_plot) % ------------------------ no PCA------------------------------------------ % A = A'; % N = round(size(A,2)/n_trials); % R = zeros(N,N); % error = ones(N,N); % for n = 1:N % for m = 1:N % if n==m % continue % else...
40597ef579c5a8f9aecadc8f93188106e10e9006f3e2859441d7db0fd41153c5
MATLAB
2,855
75
function [h_vel, v_vel, r_vel] = HeadVelocity(TrackingData, sr, gaus_kernel) % Computes horizontal, vertical, and roll head movement rotation velocity in deg/sec % Input: % TrackingData - Data containing tracking information % sr - Sampling rate % gaus_kernel - Flag indicating whether to apply ...
f6b7d3b415205aa70ec3366750c11c5f23469cfd526ff9caa4ed6a74b3a9c612
MATLAB
2,855
66
function [peth] = getClusterPETH (st, events, bin, window) % Peri-Event Time Histogram (PETH) - alignment of spike times to event time % % [peth] = getClusterPETH (st, events, bin, window) % % INPUT % Note: all inputs must be in same time scale (e.g. seconds) % 'st' - cell array with spike times % 'events'...
ff97479ab7c7207674d1329dfd9411cc3613c0c1d219c8733d32bfaacf79b2b6
MATLAB
2,855
97
close all; clear mex; cd(fileparts(mfilename('fullpath'))); funtype = 'gpu'; %funtype = 'cpu'; %funtype = 'matlab'; disp(funtype); if (strcmp(funtype, 'gpu') || strcmp(funtype, 'cpu')) kMexFolder = './c++/build'; kBuildFolder = fullfile(kMexFolder, funtype); if (ispc) mexfiles = fullfile(kBuildFolder, ...
d0487a69fe1a19046910c37326e101f2b8515ac80c6230624ced98172daa5a1f
MATLAB
2,856
92
function [A, B, ang] = random_mat_max_col_space_ang(angle, dim1, dim2, flag, varargin) % random_mat_max_col_space_ang - Generate random matrices with a maximum angle % between their column subspaces. % % Syntax: % [A, B, ang] = random_mat_max_col_space_ang(angle, dim1, dim2, flag) % [A, B, ang] = random_mat_m...
16fcbc680fcc0ab2857c749d30296a15ee5d64d4cec87a2e5c0f9fde4bd92550
MATLAB
2,857
100
function [TM,CI] = rst_trimmean(varargin) % This function computes the X percent trimmed mean of the data. % It also returns the 95% confidence interval of the trimmed mean. % % FORMAT % [TM,CI] = rst_trimmean(data,percent) % % INPUT % data is a vector or a matrix (also accept NaN) % percent is the amount trimmed eac...
44605f5905ef5e7a93b32bbf7e2ec49519307bc5367663153347b8697f87266f
MATLAB
2,857
87
function [T,V,D,Z,Z96,A_mean] = Run_PCA( features, matter,NUM_SUBJECTS,labels, keep ) %3. Perform PCA analysis and save the eigenvectors. The top eigenvector is %called eigenvector_1 and corresponds to the largest variance in the matrix %D. %Shinjini Kundu (c) 2014 %Uses the PCA trick described in the paper Coo...
8faa50e0fe8c8b17b55f443ba3f837473c59c4f625855b2fbff4a0b22d77afb2
MATLAB
2,857
74
function [ panel_pos, fig, all_ax, h ] = panelFigureSetup2( panel_x, panel_y, labels, figure_width, ... figure_height, panel_spacing_paper, panel_margin_paper ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here if nargin < 7 panel_margin_paper = 1.5; % cm end if nargin < ...
a09207e43d0c6fd209d27059be023ff031f64fb0b417ba5b0439d9031a6a76d5
MATLAB
2,857
91
function [ProcessedData_SAVE,varnamesDATA_SAVE,Dts_SAVE] = fixedBLperDFFV4(PreprocessedData,TrialParam,varnames,varnamesDATA) ST1 = {'Raw'; 'Recentered'; 'DecayAdj';}; inUseST = fieldnames(PreprocessedData); STidx = zeros(1,numel(ST1)); for i = 1:numel(ST1) if ismember(ST1(i),inUseST) STidx(i) ...
8d0c991cee1df57d0647af77e31e7dd958f80076500ac1c2b38d2062c8a4e801
MATLAB
2,858
120
%Function to relabel simulation results for easier comparison function [post_out] = relabel_results_multi(post_draws, Y, xDat, true_graph, true_states) %% kappa_post = post_draws.kappa_post; parcor = fdr_est(kappa_post, 0.2); [p,~,k] = size(parcor); true_graph(repmat(eye(p),1,1,k)>0) = 0; %parcor = 1*(parcor~=0) ;...
36ba256e546dd23cb1c1f2d7f4f199adc63fef05a5ac37ebeeb76afc0c3aebc7
MATLAB
2,859
95
function h=mnl_boxplot(data,ColumnNames,YvalueLabel) % Marcus' version of boxplot where outliers are not recorded, and raw data % points are plotted too % % Red line is the mean, red whiskers are the standard deviation, blue line % is the median, blue box is the interquartile range, and the blue whiskers % are the maxi...
ea6da59e48702b1bf884dd67153d97608adf97695019e6c6266c6b4052c67146
MATLAB
2,862
87
function AllAnswers = import_task_logs(DatasetPaths, Task, Destination) % TEMP: old function to load in task data if ~exist(Destination, 'dir') mkdir(Destination) end % find all paths [Subfolders, Datasets] = raw_data_paths(DatasetPaths, 'PXX', false, {'CSVs', 'Lazy', 'P00'}); if isempty(Datasets) || isempty(Sub...
3f87e95e187a8d2c9ec44bbe7bf01c2dbeeabe2b7d972ea9d689c182547f29bd
MATLAB
2,863
86
%% save all_data files to breain render table % (10) cells that are both transient and sustained intensity-encoding. % A map showing the (11) cells that are transient intensity-encoding, (12),% cells that are sustained intensity-encoding, % all recorded cells. clc clear [file, path] = uigetfile('*.mat','MultiSelect',...
bc7b8c7923fd61ca64817e20a8eb25b798da0442d6dbe36fb668679e827304a2
MATLAB
2,865
79
function [FR CV CORR]=CalcCVCorr(OutMatrix, Neurons) Len=1000; OutMatrix=OutMatrix(:,4001:5000); FR=(1000/(Len/5))*sum(sum(OutMatrix))/Neurons;%Hz CVn=zeros(1,Neurons); for n=1:Neurons F=OutMatrix(n,:); idx=find(F==1); ISI=diff(idx); ...
c5f2efcaab6044106a4d7f99f493150bf2f72aa28529634bba7650692aad7f9d
MATLAB
2,865
98
% test VCG loop alignment % UNDER TEST % Reza Sameni, 2005 clear; close all; load patient165_s0322lre;data = val(13:15, 1:15500)'; %load FOETAL_ECG.dat; data = FOETAL_ECG(:,2:9);clear FOETAL_ECG; N = 70; %N = 200; delta = 10; %////////////////////////////////////////////////////////////////////////// % filter data fs...
4ddd9c4ad738dc4e0bd505abf33b45824fc0dd38c74c1ceb655cc64d62fd2376
MATLAB
2,868
88
% Dsol0 is in units of uM % Dmem0, Rclus0 and Rdilute0 are in units of /um2! % Length scale h is in units of um (e.g. 0.001um) % time is in s it is either [T0 Tfinal] or an array of time pts. % % k in units of uM(-1)s(-1) %kb in s(-1) %VAratio is units of um %Add in a reaction where dynamin within the cluster rec...
f572c373d4362198a1054af389fb93b67a2f3f8126aea658edc39ee0eb2aa868
MATLAB
2,868
109
clear; clc; close all; rng('default') assert(~isempty(strfind(pwd, 'embanded/examples/matlab')), 'Please change folder to the examples directory') run(strrep(pwd,'examples/matlab','setup.m')) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Simulate data. % Generate some training data num...
fcb4a6da7c31f62ccb8fa4ac883d1e86280f202e0feca3ba0c5440b673bb62ac
MATLAB
2,876
93
function showmeyourvideo(X_SPARSE,fs,isSIGNAL,XY,r,W,H,NameOut) %% Description % Gets Clean Video Reconstruction from Estimated Fluorescence Signal % Previously loaded .mat File of Experiment: % INPUT % X_SPARSE=SIGNALSclean{1}; Clean Signals % fs: Sampling Frequency % isSIGNAL = isSIGNA...
353cf24b50bfd8a17a27212df9f159801ce4f55b020ab6fe15e754c3962f4a42
MATLAB
2,879
96
function Segments = Classify_PVD_Segment(Data) % function c = Classify_PVD_Segment(Sx,Sy,Sc,Is_Terminal) % Sx and Sy are vectors of segment coordinates. % Sc is a vector containing Menorah classes corresponding to segment coordinates. % TODO: % move parameters to parameters file. Threshold_3 = 0.2; Thresh...
30494ff37240e9c2308d43a07540e384a40b3d3d2c8658afa9e01bb7fcd4ffd3
MATLAB
2,880
151
% test algorithm for ICA permutation compensation by SVD % UNDER TEST % Reza Sameni, Copyright 2015 % clear; close all; clc; % N = 1000; % L = 8; % itr = 1; % x1 = randn(L, N); % x2 = randn(L, N); % fs = 250; % load('FetalECGDaISy.mat'); load('FOETAL_ECG.dat'); data = FOETAL_ECG(:, 2:end)'; fs = 250; x1 = fastica(d...
a2cd36cb6df8a3673de221925ca09fa46c3c1498b3f75b07b8c3646cee1649f3
MATLAB
2,882
79
function layers = updateweights(layers, params, epoch, regime) if (length(params.momentum) == 1) momentum = params.momentum; else momentum = params.momentum(epoch); end; if (length(params.alpha) == 1) alpha = params.alpha; else alpha = params.alpha(epoch); end; if (length(params.beta) == 1) beta = params.bet...
e36cefedd33993c5731696a2e9d35527645057a78e462ae17abb01134de8d8d9
MATLAB
2,882
89
clear %% transducer parameters c=1.5; %km/s Lh=12; %mm f=4.5; %MHz lamb=1.5/f; %mm pixel=0.75/12; %mm N_pixel=round(Lh./pixel); %mm k=2*pi/lamb; kx=2*pi/pixel; z=15; % mm % Li=14; % mm % k_lim=pi*(Lh+Li)/lamb/sqrt((Lh+Li)^2/4+z^2); %% image generation raw_I=imread(['V.png']); gray_I=double((raw_I)); ...
3ab46c7829b8947a12515853785822e56b7c6e4fc9927177da3e74177548b0e7
MATLAB
2,883
86
function import_raw_pupil_tables(RawPupilDir, DestinationDir, Task, RerunAnalysis) % from the output produced by PupilPlayer, saved in the LSM data structure, % this goes folder by folder, snd resaves the content into a mat file in % the destination folder of choice. % loop through entire dataset to find relevant pupi...
627b1fa1ebf9b284fd7a3c7f00f2bd3e9d657e4483b1ccfd77dfaeb423d346dc
MATLAB
2,885
94
% plot clusters from all data file WITH IR clear clc ploting =1 ; window = 2; %(on, sus, off) sus_window = 65:125; nd2reduce= [9;7;5]; %% [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) data...
48a3ce188bb9fde43a88fdb8ef17c1a487159912d7b26cb275b386213c65a093
MATLAB
2,887
79
%% 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) non responding cells. % clear [file, path] = uigetfile('*.mat','MultiSelect',...
ad610d839397e12388eaf71cbc4614a2e8557803b6aae3795b406c12825cf84b
MATLAB
2,892
81
function spec_info = explore_spectro_data(P) if ~exist('P') P = spm_select([1 Inf],'dir','Select directories of dicom files') end if exist('spec_info'),found=length(spec_info);else found=0;end for nbdir=1:size(P,1) [afid, adcm]=spec_read_first(deblank(P(nbdir,:))); if ~isempty(afid) found=found+1; sp...
9657c81c29543f68672e67c4413259eb6b50c61b2cb90fc10b878a536740026f
MATLAB
2,893
63
function [vcg, teta] = vcg_gen_direct_sum(N, fs, f, alpha, b, theta, theta0) % % vcg_gen_direct_sum - Synthetic cardiac dipole/vectorcardiogram (VCG) generator using the direct implementation % of the sum of Gaussian model. Performs identical to thedipole_gen_state_space. % Refer to references for further deta...
c220348142ef507d9f71437e47d43cc3f60d097b5fa80e665b99937b9f324a96
MATLAB
2,895
84
% % Test program for mean ECG beat extraction and parameter optimization. % % Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 1.0, November 2006 % Released under the GNU General Public License % Copyright (C) 2006 Reza Sameni % S...
f9403ebbe888a5f6da9668ea1bb39babf58d8e9adf472988576cfc56ca7940e6
MATLAB
2,902
101
% % [xFit yFit yError y0 A lambda x0 sFormula] = myFitExpRS(xData, yData, resamplingCount, sFormulaMode); % % [ABSTRACT] % data FITting using EXPonential Raising Saturated model: y0 + A * ( 1 - exp(-lambda*(x-x0))) % % [INPUT] % xData: row vector: input x data % yData: row vector: input y data % resamplingCount: intege...
0ccc5c81e67c7ab9552c2de46d44f03116d0f2c8d728ac630247f6d1ff2da4b1
MATLAB
2,903
97
function show_r3_point_set_new(points_x,color,varargin) %SHOW_R3_POINT_SET 3D illustration of a point set % %Syntax % show_r3_point_set(POINTS_X,options); % %Description % SHOW_R3_POINT_SET(POINTS_X) uses a 3d plot to illustrate a point set in relation to % the unit sphere S^2. % % The argument POINTS_X must be an arra...
09db2027d93771bd6589fa653f45b4e00e1c0d1d02b7d74719ef45ca4fff37f7
MATLAB
2,906
101
% % [xFit yFit yError y0 A lambda x0 sFormula] = myFitLogRS(xData, yData, resamplingCount, sFormulaMode); % % [ABSTRACT] % data FITting using LOGarithmic Raising Saturated model: y0 + A * log( 1 + lambda*(x-x0)) % % [INPUT] % xData: row vector: input x data % yData: row vector: input y data % resamplingCount: integer: ...
3736b6ae1cff8d27a4645a2ee5fccb77c4941069ff37c9c201f6dee2ea6b8c3a
MATLAB
2,906
69
% Computes the metastatic mass via a first order quadrature function [burden, nb] = ... model_burden_nb(... param,... % metastatic parameters time,... % time points growth_model_PT,... % growth model for primary tumor growth_model_met,... % growth model for metast...
6a322bdf16d7beefbcd776405d867b96aa8446ce6508fe23fe6395bfa97b863d
MATLAB
2,907
68
function [B,twomu,p,T] = multiSliceA2B(A, gplus,gminus,omega,BType) T=length(A); p=size(A{1},1); % if u want more B, added it in the case switch BType case 'orderedSlice' Bplus=spalloc(p*T,p*T,p*p*T); Bminus=spalloc(p*T,p*T,p*p*T); twomuplus = 0; twomuminus = 0; for s=1:...
a16230d0cfea5fc6ba24a60a3542e67d75812a8b54a2e0732602d85abebc0869
MATLAB
2,908
91
function save4spss(names, vars, titl) % % Copyright 2010 Jesse van Muijden, Leiden University, The Netherlands % % This function is basically the same as the previously uploaded example % script, but now it has the form of a function. The function can only % handle numerical data. % % The first input argument must be ...
eead26367e8f8772f5caa988934c89861c9d986b45344a11058c2f6a2f0663fe
MATLAB
2,909
67
function [PeakToPeak_corrected, PeakToPeak_differences, matched_peaks_indexes, smoothed_matched_output] = MFPeakDetector2(x, matched_template, type, wlen, PP_diff_wlen, PP_diff_th, average_peak_det_rate, fs, plotflag) % =========================================================== % Matched Filter R-Peak Detector and Sm...
c8a0d4115aac094999fc59c6f288028ca70342cc3823badcba871c66f12def03
MATLAB
2,917
102
classdef (Hidden) channel_writer < handle % % Class: % adi.channel_writer % % This is meant to be an interface % % adi.setChannelName(file_h,channel,channel_name) % adi.sdk.setChannelInfo % adi.sdk.addChannelSamples properties id end %*** The...
9a22b11c14d88a592cf82f3cba865554f36096f5143575eb361bbebae5355e19
MATLAB
2,921
93
function [DataAVG_SAVE] = entiresessionAverageV2(ProcessedData,varnamesDATA,setupParam,TrialParam,allTrials) % Setup group info (if there are groups) allTrialsID = allTrials.ID; if setupParam.CompareGroups == 1 GroupParam = TrialParam.GroupParam; groupnames1 = fieldnames(allTrialsID); groupidx = zeros(1,n...
dc3f81fefd7b262cad0220900ec4b49d72832089542f3800bf680b23e8bcad35
MATLAB
2,923
78
% test bids processing pipeline on SPM's face repetition single subject dataset %% update path local_test_dir = ''; % in case spmup was not added to the path location = fullfile(pwd, '..'); addpath(fullfile(location, 'adaptative_threshold'), ... fullfile(location, 'bids'), ... fullfile(location, 'exte...
4541f0303fe2eddc8d46d6861b7ab13346ce8e2987bfdb1b6a883e8d353dcbc1
MATLAB
2,924
90
%load atlas annotation_volume_location = 'C:\Users\elyashivz\Documents\analyzing_slices\annotation_volume_10um_by_index.npy'; structure_tree_location = 'C:\Users\elyashivz\Documents\analyzing_slices\structure_tree_safe_2017.csv'; if ~exist('av','var') || ~exist('st','var') disp('loading reference atlas...') av...
792f8ca3149cfc8722acebe30ba35efed9aa465e6d775d70c4a9da44ac9d2a2c
MATLAB
2,925
124
function ob = fatrix2_kroni(Mkron, ob) %function ob = fatrix2_kroni(Mkron, ob) %| %| Construct fatrix2_block object of form kron(eye(Mkron), ob) %| i.e., a kronecker product of identity matrix with object. %| %| in %| Mkron natural number %| ob fatrix2 %| %| out %| ob fatrix2 equivalent to kron(eye(Mkron), ob) %| %...
fccc26a37e01f6e8aa4d7bf01e804a570fc6754084a4fd5ec27711a6f05ffefb
MATLAB
2,925
95
clear;close all; set(groot, 'defaultAxesFontName', 'Arial'); set(groot, 'defaultTextFontName', 'Arial'); addpath(genpath('eeglab2023.0')); % Load the channel location file load('chanloc_hydrogel.mat'); load('chanloc_gel.mat'); channel_num = 33; % 32 working + GND date = '0503'; %% Data_hydrogel_night = []; ...
30f3a06f31a12c11da7304ea3821118578a361448a4c8a5dedb8d1e605d54778
MATLAB
2,928
83
function fig3_threshold(folder, save) %% Figure 3: Connection numbers % Subplots/information: % - Although weaker, contralateral projections are more numerous % - Show density imagesc normalized separately % - Show number of projections ipsilaterally vs contralaterally vs threshold %% Load and normalize if nargin == 0...
62a430ba3c59851c47649f65de1e48b6945666a16a91374f3e6903e222ba6966
MATLAB
2,928
81
function multiple_boxplot_with_significance(data,xlab,Mlab,pValues) % pValue is of size(data,1) * 3, size(data,1) is the number of groups % pValues are saved in the order (1,2),(1,3),(2,3), but we want to plot % (1,2), (2,3),(1,3); % case 1: comparison for 3 groups if size(data,2) == 3 pairIdx = [1 2;...
c0d35815a52976aa25caa4aa32ce22efa45e1da514a74c1d35a4b8e22d6d7f18
MATLAB
2,929
88
close all clc clear results = load('J:\ECGData\Arrhythmia\AllDataSmootherResultsArrhythmia05_ComparisonWithLPF_Backup.txt'); % results = load('J:\ECGData\Normal\AllDataSmootherResultsNormal05_ComparisonWithLPF_Backup.txt'); % results = importdata('J:\ECGData\PTB\AllDataSmootherResultsPTB05_ComparisonWithLPF_Backup.txt'...
365b12451d3807cde754cdc1685fe9582a1c638c9463dc870ef38c9f17e5140f
MATLAB
2,931
78
function sep_file_names = task_separator(filename) % % sep_file_names = task_separator(filename) % % ************************************************************************* % * Task based separation of TDSKA/EEG data to avoid memory overuse * * % **************************...
36eec38f50670a290f4bf152c290317e9c6abb7dd99f395ab3e68554151531dc
MATLAB
2,931
77
function syncHistFile(obj) %SYNCHISTFILE Sync up history file with current history d = dir(obj.hCfg.histFile); if isempty(d) || obj.nSpikes == 0 % file does not exist fclose(fopen(obj.hCfg.histFile, 'w')); % truncate history file d = dir(obj.hCfg.histFile); end if obj.nSpikes == 0 ...
c9b5c80f711ffd5c6b0c6493629c6a7f6ef5074a7f65b5d0f765b6eaf1dfec2d
MATLAB
2,932
157
function FF = read_basis(filename) if ~exist('filename') filename = spm_select([1 inf],'any','select files','',pwd) end for k =1:size(filename,1) [p f e]=fileparts(filename(k,:)) file_in = fullfile(p,[f,'.IN']); if exist(file_in) fp = fopen(file_in) s='qsdf'; while ~isempty(s) s=...
20ea94a1b6e2eebbac4464e031d5bb59fd4a43ab1fdc5c676abd08da0b08ca90
MATLAB
2,933
103
function [P, Q, R, S, T] = ecgWavesSoI_RR(ecg, Rpeak, RRf) % % 'RR interval 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...
f03048cb22843c453b50c4a5cda7a192560b46cd9f80c4abe2857adfc2c1905f
MATLAB
2,934
87
function [x,y,eb,mini,maxi] = plotFormat(timewindowAVG,varnamesENTIRE,setupParam) All = timewindowAVG.all.average; VN = varnamesENTIRE; timewindow = setupParam.timewindow; BLperiod = setupParam.BLperiod; ST1 = {'Raw'; 'Recentered'; 'DecayAdj'; 'RefDecayAdjExp'; 'RefDecayAdjPoly'}; inUseST = fieldnames(All); STidx = z...
2f0343bbb8ed2d2f6ef7d6cfc11cd34542447a20890b07615824b10a25840a06
MATLAB
2,936
73
function activity(obj) %ACTIVITY Plot activity if isempty(obj.res) obj.loadFiles(); end plotActivity(obj.res, obj.hCfg); end %% LOCAL FUNCTIONS function plotActivity(spikeData, hCfg) %DOPLOTACTIVITY Plot activity as a function of depth and time tBin = 10; % activity every 10 sec % ...
edb2cab2f74dbab4f9a4bcdf94ecb4b866a82ad76b7d72f90dc8ab51b84ac6d8
MATLAB
2,936
87
function [GoodSingle,GoodMultiple,GoodAnatomicallyClose,Few,Scattered]=mnl_ManuallyClassifyClusters %This function manually classifies the clusters. % The input is manually chosen tiff images of the clusters % The output are lists of the clusters numbers and saved as both a %csv, and as separate output variables %% L...
a412700af41b3bcf5782917f48c836742f2308efc3a3c28efacff7c91a5ef52c
MATLAB
2,937
94
function gui_lc (action) % % This file is used by FASTICAG % This file holds the callbacks for load-dialog % 24.8.1998 % Hugo Gävert %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf_FastICA_Load; % Handles to some of...
d9138f7bd1b75a73d8505095534f9e2c25b0bcd9bfdffb3b95e7e6c53885bf83
MATLAB
2,940
67
%% prepare data speed_control = 0; [av_trials_all, err_trials_all, trans_data_all, trans_data_err_all, err_trials_full_all, trans_data_all_dr, tone_idx] = ... prepare_data_task_subspaces(p, traces, evs, bvs, tis, speed_control); [q, trial_idx_ses, ~, ~, ~, ~] = dr_into_joint_subspace(p...
fb1cf31c550f1083f06aaacccf72e5714447a88626142bba535f327d2b0c48a8
MATLAB
2,942
78
function updateFigISI(obj) %UPDATEFIGISI Plot return map if isempty(obj.selected) || ~obj.hasFig('FigISI') return; end nSpikes(1) = numel(obj.hClust.spikesByCluster{obj.selected(1)}); if numel(obj.selected)>1 nSpikes(2) = numel(obj.hClust.spikesByCluster{obj.selected(2)}); end ...
5def7ed88b9839a4e8bd269d2101104fd64705b8f997111bbdb80de3b9e84dc5
MATLAB
2,945
104
function varargout = ds2nfu(varargin) % DS2NFU Convert data space units into normalized figure units. % % [Xf, Yf] = DS2NFU(X, Y) converts X,Y coordinates from % data space to normalized figure units, using the current axes. This is % useful as input for ANNOTATION. % % POSf = DS2NFU(POS) converts 4-element positi...
86c07e2e6309ebcdbb030d5f6e530aab1aae7d72e0d491cc9817b0ac03e79dfc
MATLAB
2,945
95
% - plot the activity of an example cell over trials for two alignments: % tone start and action start % - then plot the corresponding trials averages %% load data clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData.mat'); load(fpath,'tis','bvs','traces','evs') [cols,alpha] = chooseColors; %% sub = ...
e9a12aeac39d67a88cc1b7e3b9c38028a074dd0ae2e7225c574d7724968f92e3
MATLAB
2,947
93
function PLV = PLV_PhaseSeq(varargin) % % PLV = PLV_PhaseSeq(phase_sig) % PLV = PLV_PhaseSeq(phase_sig1, phase_sig2, phase_sig3, ...) % % ************************************************************************* % * Calculating Phase Locking Value (PLV) matrix (Pairwise) using phase * % * sequences. Refer to the Us...
04336fc24c9f09875c29b250f766b3a675f38a12e99a47ab7bd7b9bf83c1f172
MATLAB
2,948
86
classdef pointer < handle %POINTER manages the data to display and the rwaves to display % Detailed explanation goes here properties start_idx stop_idx dspl_idx pre_idx post_idx dur ax_1 ax_2 length end events ...
b5f7ec060cf51a3c5c782ce16d7a8eeb85be2113c18beb1b9de8f29be5dd8917
MATLAB
2,948
76
clear [file, path] = uigetfile('*.mat');%When the user clicks the load data button, a window should open to enable the user to select a file. datafile = fullfile(path, file); %save path load(datafile) close all %% % response_time = 160:190; %random % dms_response = { response_time = 30:60; %on respons...
55ded852fa0e76871c04900da143653e2371b21f8762bbbfce59ff65efe480bb
MATLAB
2,949
46
% Authors : Tatjana Schmitt & Simon Wadle 2019-2023 function time_points = time_points_frames(txt_filename_frames, varargin) % normalizes frames to real time points in ms and frames % output is a cell array with time points & frame number of each presented stimulus and % all start and end times & frames for calcula...
f84bbecada66757b2c5d6557a5990dc8a9ebe602c7727ff73b3b846a60e92edd
MATLAB
2,950
95
classdef (Abstract) RawRecording < handle %RAWRECORDING Model of a single recording properties (Hidden, SetObservable) hCfg; % Config object end properties (Hidden, SetAccess=protected, SetObservable, Transient) rawIsOpen; % flag, whether raw recording file is open ...
922a0f1813ec860c4ec80dd2256ebfd476bcec1195e96d2ef429b0918cc52458
MATLAB
2,956
119
clear %% load('BzaIaa_corrcoef.mat') load('BzaOFFTrain_IAATest.mat') %% figure pn = sum(pn,1); pn = filtfilt(ones(1,8),8,mean(pn,1)); % pn = (pn-min(pn))/(max(pn)-min(pn)); pn = resample(pn,10,20); plot(1/10:1/10:8,pn/80,'k','LineWidth',2) hold on yyaxis right bvr = temp(61:300); bvr = filtfilt(ones(...
34337d4f045fa5458a2a867522b5aa2c5f6959fcbaa5ddc8cfd715f82c6e000c
MATLAB
2,961
88
function [ output_args ] = normalizeTraces(p,outliers) % normalize dfof traces from joint extraction % different sessions might have different signal to noise ratios, thus % sessions should be normalized individually as follows: % estimate SNR differences between sessions by calculating the std of % cells in different ...
93b9bdfccf3f13ddb9b8c5cc22ab911ddf28371469ce741743eb2729b0daf040
MATLAB
2,966
105
function [S, detail_par,count,isntGood] = fcn_staged_multilayer_iterated_10000par(A,gbound,obound,nsamples,couplingtype) % 21/10/22 detail_par = []; isntGood = []; % keep trace of excluded parameters isntGoodG = []; isntGoodO = []; isntGoodF = []; isntGoodN = []; N = length(A{1}...
b4ae44c18015bc0a0133ceb2e07fd7d88c9b4823600f5952b116e98e3873bbf8
MATLAB
2,971
84
function [seg_fp, seg_samp] = segmentSignal(fp,winSize,winOv,Fs,varargin) %segmentSignal - Extract segments of specified windows from photometry %signal % % [seg_fp] = segmentSignal(fp,winSize,winOv,Fs) % [seg_fp, seg_samp] = segmentSignal(fp,winSize,winOv,Fs,evnts) % % Description: This code will use a mo...
b72b8b622edd8c632770c5b29e9573ff5a98e4c3061192aeb4a8d99b22b3c280
MATLAB
2,972
92
function [Beads]=mnl_AutomaticallySelectBeadLocations(Data) %Input % Data - xycz format dim=size(Data); nColours=dim(3); nRows=round(sqrt(nColours)); nColumns=ceil(sqrt(nColours)); %% Create the single channel MIPs with a median filter r=3; [mData]=mnl_MedianFilterEachChannel_2D(Data,r); MIPs=zeros(dim(1),dim(2),nColo...
0ca862c52ecbf10a212a03d3643415d8a74636641a2fac7f01cd026bf554adf5
MATLAB
2,978
71
function [New_DataSet,Pixels_To_Classify,Pre_Classified_Pixels] = Generate_New_DataSet(Im0,Input_Rows_Num,Input_Class) [Rows1,Cols1] = size(Im0); Frames_Max_Num = Rows1*Cols1; Frame_Half_Size = (Input_Rows_Num - 1) / 2; switch(Input_Class) % Determine the type of the neural network object. case 'SeriesNetwork...
fee9deaa13c4835ab496e00391fe06381abfea6840dbca67bc7b065969a0d05c
MATLAB
2,980
90
function polypredcicall(x,y,lev,str) %POLYPREDCICALL Plot regression line with confidence interval. % POLYPREDCICALL(X,Y,LEV) calls POLYPREDCI with input coordinates X and % Y. Regression line is overlayed on scatter plot. Confidence interval is % plotted at a confidence level defined by LEV. % % POLYPR...
aaeb647e2b146ba6c782aff52bcf9d9745ccc37c21ff5a4dc93d32d1ae24e382
MATLAB
2,982
77
%% Iterate over all animals and kick out invalid trials % CIAO_01b_kickout prevents the pooling of different trials in later steps. % For this, the respective trial number is deleted from the % meta.valid_trials variable. % Provide a list with invalid trials in a textfile (invalidTrials.txt) and % locate it in the m...
b2b8b519ae6f920640a7de63a8d24f99bf1b136ded781206c49a78aff3826468
MATLAB
2,982
117
function [o nofiledir yesfiledir] = get_subdir_regex_files(indir,reg_ex,p) %cell vector of in directories %reg_ex regular expression to select files %p parameter, if p.preproc_subdir is defined it will lock in this subdir % and if not exist il will create it and copy the files in this subdir if ~exist('p'), p=struct;...
07d695ced35dc1ff2f10f70b9d733ab5f1b9f7e342f4b1997882dbf2195ceaad
MATLAB
2,985
86
function autocorrelatemap(exp_id,hemisphere) %% Show overview of experiment statistics % % autocorrelatemap(exp_id,[hemisphere]) % % Input: % exp_id: experiment id of experiment file (e.g. '100140756') % hemisphere: set to 'contra' to show contralateral projections (default: % 'ipsi' - show ipsilateral projec...
7458ce8dba1531aa4145c26a73d74df87015e24c97e39bc1eb6bd3fb39e2f3ce
MATLAB
2,986
71
[app.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. app.datafile = fullfile(path, app.file); %save path file_numes = length(app.datafile); app.all_files = cell(1, file_numes); for i = 1:file_numes app.all_f...
a7b9b8ce5a63f38b5672a673c802641cd75e968a8b86a16353eb988b70ef45a2
MATLAB
2,986
66
function [dispFeatures, spikeTimesSecs, YLabel, dispSpikes] = getFigTimeFeatures(hClust, iSite, iCluster,channel_idx) %GETFIGTIMEFEATURES Compute features to display in FigTime on iSite if nargin < 3 % get features off of background spikes iCluster = []; channel_idx = 1:length(hClust.spikesBySit...
c47a9c1d5d9bf550107e7458d67668ab624c430d34942d5b8457aebfc160fc2e
MATLAB
2,986
85
function [output, criterion] = PeriodicDeflDecompositionKF(dat,Itr,peaks, bins, f0, fs) % % [output criterion] = PeriodicDeflDecompositionKF(dat,Itr,peaks, bins, f0, fs) % (maternal) cardiac signal supression by deflation using periodic component % analysis and extended Kalman filtering for nonlinear denoising. % % Ref...
e09da0fb5ebfb80a801016564dd651dd6b63fa51fe972095087878fe28e46124
MATLAB
2,987
175
function write_conc_res_summary_gosia_to_csv(conc,resname,field_list) dottest=1; stdrel=0; if ~exist('field_list') % field_list = fieldnames(conc); field_list = find_metab_list(conc); end fid = fopen(resname,'w+'); npool=1; fprintf(fid,'\n\n,'); for kf = 1:length(field_list) fprintf(fid,',%s,%s,%s',field_...
e94a3fef88ff64f1fd75878fbc7fa824d41d6b76a5e06c4eccffe18db86b7137
MATLAB
2,988
92
%{ ---------------------------------------------------------------------------- Analyzing behavioral data At least for the correct rate ---------------------------------------------------------------------------- %} function Figure2c_Dual_RL_analysis_220818_para_compare close all analysis_folder = { 'G:\...
be0261626cbbcb7d62587e6676e6cdf9c02aa196ac995436dc98d1c28355c37e
MATLAB
2,990
91
function roi = readRawROI(obj, rows, cols) %READRAWROI Get a region of interest by rows/cols from the raw file % How many data blocks remain in this file? bytesRemaining = obj.fSizeBytes - obj.headerOffset; dataPresent = (bytesRemaining > 0); if (dataPresent) if ~obj.rawIsOpen o...
e15d94fcebefbaeb275a61e207013981fd4dc2ce742a77d2b4e5ea2a06542c18
MATLAB
2,991
98
function uninstall(pddir) %UNINSTALL Uninstall toolbox directories. % UNINSTALL is an easy to use uninstallation program for toolboxes. % It uninstalls toolbox directories when run from the base directory % of a toolbox. A file "info.ins" created by MAKEINSTALL must exist % in this directory. % Example of us...
d095f7d736ca114011cb73599d5419407f708baf9f18d1dfc9b5fed3efc1e5ae
MATLAB
2,993
116
% % Test program for noise generation. % % Dependencies: The baseline wander toolbox of the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 1.0, November 2006 % Released under the GNU General Public License % Copyright (C) 2006 Reza Sameni % Sharif University of Technology, Tehran, Iran -- LIS-INP...
902002618fb17f97dc408825a95213af31ff633e325e98bfaad53558689787a0
MATLAB
2,995
90
function varargout = barwitherr(errors,varargin) % Check how the function has been called based on requirements for "bar" if nargin < 3 % This is the same as calling bar(y) values = varargin{1}; xOrder = 1:size(values,1); else % This means extra parameters have been specified if isscalar(v...
c8d0165aab9c67ef0b2c766860a19c891a2e3324bb424e150b19d09a941b8dd6
MATLAB
2,995
99
% my first submission resulted in a score: 0.57797 clear close all; R1 = importdata('E:\Sameni\Projects\Seizure\SourceCodes\Probabilistic\SourcesWithResultsBackup\testFreqDomainEnergyIncreaseRate01.txt'); R2 = importdata('E:\Sameni\Projects\Seizure\SourceCodes\Probabilistic\SourcesWithResultsBackup\testICASubspaceAng...
fc27073c3725154fc0140ff49983420a95200d798837497a891bf3429c38054c
MATLAB
2,995
80
function Nlx2Mat2Nlx %tetrode‚Ì–{”‚Æ“‡‚µ‚½‚¢ƒtƒHƒ‹ƒ_–¼‚ð‚·‚×‚Ä‹L“ü %uÅ‰‚̃tƒHƒ‹ƒ_+ƒ}ƒEƒX–¼{joinv‚Æ‚¢‚¤ƒtƒHƒ‹ƒ_‚ªì¬‚³‚êƒeƒgƒ[ƒh‚²‚Ƃɓ‡‚³‚ꂽnttƒtƒ@ƒCƒ‹‚Æ %Event.mat‚ª•Û‘¶‚³‚ê‚éB clear all; CoreFolder='C:\Users\B133_2\Desktop\CheetahData'; NumTetrode=8;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
f6bc6fb0547a66a79598e6489702b60fea23ca816dca201748202d24fb41bdf4
MATLAB
2,996
107
% analyze action initiation: % there is a delay between action start and tone end % what is the distribution of this delay over trials / tasks % - figure out action start using diff(spd) % - align to action start vs align to tone end %% load data clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData...
354f446d52e2a0cabb10fc12e6246773bb8a67fea93e96f975fc865a2ca2e1d7
MATLAB
2,998
83
clear all close all clc constants; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Load parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% import_data; import_survival; folder_fit = './fit_PT_met_SAEM'; [param_inds, param_ind_d] = compute_param_inds(.....
388ae9deae2abcefa999847310b0efd41d57639acc26a8e8a37e2bceaea82b15
MATLAB
3,001
94
% The goal of this functions is to take an input firing rate map with % arbitrary rectangular shape, then take the first HC, then output another % firing rate map with arbitrary rectangular shape based on rotating the HC % periodicly. % % The used HC can be rotated or flipped to implement ICs based on NESSs of % dif...
7a330a7e661baebfd6dde1388bd2389121d7c0f901f9c4a90940fe23e468eaef
MATLAB
3,005
90
clear all, close all load DC_data.mat % Color scheme color = flipud(['#0b499d'; '#0e5fce'; '#1d77f1'; '#3585f3'; '#4c94f5'; '#64a2f7'; '#94bffa']); %% Zoom plot alt. fig = figure(2); fig.Position = [20 20 400 700]; colororder(color); fig.Color = [1 1 1]; tiledlayout(2, 1, "Til...