sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
e42f2b886a32024b2b2808aa901e04a6bb0c9f2a499ab7558999f78704f40338
MATLAB
1,186
40
function y = bp_filter_dft_varlen(x, fl, fu, N) % bp_filter_dft_varlen - Bandpass filter using discrete Fourier transform (DFT) filtering with variable DFT points. % % Syntax: y = bp_filter_dft_varlen(x, fl, fu, N) % % Inputs: % x: Vector or matrix of input data (channels x samples). % fl: Normalized lower f...
ec928b00dd22a8fb5724e21f61125d38042a931e0bb12fee53cecb14ae7b3c3d
MATLAB
1,187
39
function Answers = cleanup_LAT(AllAnswers) % Take table from AllAnswers, save relevant information and make it in the % correct format type. Answers = AllAnswers(:, {'Participant', 'Session'}); Answers.Participant = string(Answers.Participant); Answers.Session = string(Answers.Session); Answers.Trial = cell2mat(AllAn...
b1eea10e99337f73ab61b0fb5e0a6111f6ba2b91e660ff7742b3f03beff14ab0
MATLAB
1,188
56
function off = change_file_path_to_preproc_dir(ff,par) if isstr(ff), ff={ff}; end preproc_dir = par.preproc_subdir; for nbser = 1:length(ff) cff = ff{nbser}; [p f e] = fileparts(cff(1,:)); dest_dir = fullfile(p,preproc_dir); if ~exist (dest_dir) mkdir(p,preproc_dir) if strcmp(spm_pl...
0a0dc39683b58c3ba60bed8be96a523212eb9e85295749c9d844c5300c089c88
MATLAB
1,189
44
function [valindSQI, indSQI] = SQI2(x, peaks) % % [valindSQI, indSQI] = SQI2(x, peaks) % Channel selection based on R-peak amplitude constancy % % Fahimeh Jamshidian Tehrani, % jamshidian.t@cse.shirazu.ac.ir, % fahimeh.jt@gmail.com % February 2020 % % input: % x: input JADE component of fetal ECG record % peaks: R-...
f3789f02c4a5054f6024b0f152571cc5c0a63b842140f3f37459e305165fc642
MATLAB
1,189
37
clusters_mapping(m, p, shrinkage_factor, borders_table) [file, path] = uigetfile('cluster_info.tsv');%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 tdfread(datafile) %find good clusters from group good_clusters = fi...
190fbd9090d43d5cbad6f4cc315f1b8cf5143c8229db46353d6a438c9bf4d148
MATLAB
1,190
40
function Plot_all_features_ad(app) % function Plot_all_features(handles) data = app.user_data; par = data{1}; inspk = data{7}; classes = data{6}; colors = [[0.0 0.0 1.0];[1.0 0.0 0.0];[0.0 0.5 0.0];[0.620690 0.0 0.0];[0.413793 0.0 0.758621];[0.965517 0.517241 0.034483]; [0.448276 0.379310 0.241379];[1.0 0.103448 ...
43a0b08bb6c3742c990bd096c48c691c3d010a510afa15f702d08b220088de9e
MATLAB
1,190
33
function gr = GausGrad(t, p) % Compute the gradient of a Gaussian function with respect to its parameters. % % Inputs: % t: Time samples. % p: Gaussian parameters [amplitude, width, center]. % % Output: % gr: Gradient of the Gaussian function with respect to its parameters. % % Reference: % Fattahi, ...
9ed4e004be4f31a7510b61405f5c0c2473fa438ad42ffdab43df7d3c8f6b364b
MATLAB
1,190
31
function [y,y2] = RaguClustSizeV2(hits) % RaguClustSizeV2 % hits is a timepoint by randomization run matrix % is the distribution of cluster sizes in the data % y(1) is the count of clusters with size 1 % y(2) is the count of clusters with size 2 % y(n) is the count of clusters with size n % Copyright 2009-2011 Thoma...
87d1fa7670e499e60809caa62eb01f51e871005e99fbf4e564c9ba42bd2cac65
MATLAB
1,191
1
function [wx,g]=rst_winsample(x,percent) % function [wx,g]=winsample(x,percent) % returns the winsorized sample of x as wx % returns number of winsorized observations at each tail of sample as g % x must be a vector % percent must be between 0 and 100; the function converts the lower and % upper extreme g values of x ...
c2f5cf928fa17a942d596f932a0ae03d033cbb9d51d7c7582aa018ef1188b52e
MATLAB
1,192
50
% A naive implementation of Householder's 1958 algorithm for matrix % triangularization. % Ref: Householder, Alston S. "Unitary triangularization of a nonsymmetric % matrix." Journal of the ACM (JACM) 5.4 (1958): 339-342. % % Reza Sameni 3/1/2019 % email: reza.sameni@gmail.com clc; clear; close all; % an arbitrary s...
f337412e69ad73678e99fc5ef4d2f559aec72b469896ba5012504395b69915da
MATLAB
1,192
1
function [trimmedMean,g]=rst_tm(x,percent) % function [trimmedMean,g]=tm(x,percent) % % Returns the trimmed mean of x as trimmedMean. % returns number of winsorized observations at each tail of sample as g % x must be a vector % percent must be a number between 0 and 100 % The trimmed mean is calculated from x after d...
3ecf8c4a6646d2d241cfda299d50f82939df4d4df0a9f07f62f85e1008f66276
MATLAB
1,194
48
function NewArray=MovWindow(Array,Mbin) %moving average %Mbin‚͕Б¤‚Ì“®‚©‚·window”A‚R‚̏ꍇA3,2,1,0,1,2,3‚Æ7window‚ɂȂéB NewArray=zeros(1,length(Array)); for n=1:length(Array) if n-Mbin<=0 NewArray(n)=(sum(Array(1:n+Mbin))+Array(1)*(abs(n-Mbin)+1))/(Mbin*2+1); elseif n+Mbin>length(Ar...
901d62e795529725f50d33de7093c4eb9abf07a323ef6705f271325e74ae6cce
MATLAB
1,194
43
%% plot example latent factors speedcols = inferno(6); for isesh = 1:5; figure allTraj = []; for icond = 1:12 allTraj = vertcat(allTraj, s(isesh).session.cond(icond).meanTrajectory(:,:)); end axisLimits = [min(allTraj,[],1); max(allTraj,[],1)]; for ifactor = 1:3 [~, idx] = max(abs(axisLimits(:,ifactor...
7d59d70eecb4f042bd53360169b6d458c32eb5fd24ca625f6932418fca6424ba
MATLAB
1,195
46
expreiments = unique(CTP.experiment_id); for i = 1:length(expreiments) exp_idx = find(contains(upper(clusters.brain_render_table.experiment_name), expreiments{i})); exp_CTP = CTP(contains(CTP.experiment_id, expreiments{i}), :); for j = 1:length(exp_idx) x = find(clusters.brain_render_table.id(exp_id...
f1fba63a66d8f9668165884bf8ce444bc75ee00dfdc9b17e6e069aa16cea5327
MATLAB
1,195
44
function MultimerConnProb20160527 %MakeMultimerProb20160517.m(Exp=5‚̏ꍇj %MakeMultimerProb20160526.miExp=10‚̏ꍇj %‚É‚æ‚èˆê’v”‚²‚ƂɃtƒ@ƒCƒ‹‚ðì¬ %‚»‚ê‚ð—p‚¢‚ÄMultimerConProbAllƒtƒ@ƒCƒ‹‚ðì¬‚·‚éBMatching10–œ‰ñ‚ÌŒ‹‡”‚ª•Û‘¶‚³‚ê‚éB %MakeMultimerNet_Group20160520.m‚Ńlƒbƒgƒ[ƒNì¬ clear all; close a...
0f478c3846e1bfc8d2c7c68899ee43086024b7d3b2d50ea8920238cb75edcf3d
MATLAB
1,196
40
function [Data_hydrogel, Data_gel] = readimpdata(date,filename) %READIMPDATA Summary of this function goes here % Detailed explanation goes here % Load the channel location file load('chanloc_hydrogel.mat'); load('chanloc_gel.mat'); channel_num = 33; % 32 working + GND addpath(date); D = readlines(filename);...
a8b03856f56fef017b8e9f558a4149adce289468f7675eba19a8a01b8493e5a5
MATLAB
1,196
35
function [units, trials, runInfo, pupilInfo, sessionInfo] = preprocessAllenData(sessionFile, requiredStims, options) %% TO DO: % 'ITI' trials? if ~iscell(requiredStims) error('requiredStims must be a cell or cell array') end % load session file load(sessionFile); % this is just the spike times dict atm % generate...
de5d40c39897881819bdbd3fb72bc37e88d377054dbbebad6fc1f0fab94ddb52
MATLAB
1,196
27
cell_data = all_data.cell_4; %relevant_cell y = cell_data.intensities(1:10).psth; %% plot PSTH nac_colores = {'c', 'm', 'r', 'g', 'y', 'k', 'm'}; % f4 = figure; % set(f4,'color', [1 1 1]); % set(f4,'position',[50 50 500 750]); % for i = 1:36 figure for j = 1:size(clusters.cluster_cells.cluster_2{i}.intensities...
eea6d962a96adc2f99027e02a00207e425a07f39c063e353ff90d1000befd1a3
MATLAB
1,196
32
function [ movie,lfi ] = filterMovie( p,movie,fType ) %FILTERMOVIE filters movie according to the paramneters set in p % remove nans movie(isnan(movie)) = 0; %% create cutoffFilter and normalize to be between 0 and 1 padSize = size(movie,1); filterSize = [size(movie,1) + 2*padSize , size(movie,2) ...
ef80b52c3520da4838e2f47180d9657016d01008d78bb718f722ea48e2f00632
MATLAB
1,196
28
function [fitresult, gof] = nakarushtonDB(xData,yData) % Define the Naka-Rushton equation for curve fitting. The Naka-Rushton equation is % typically used in psychophysics to describe the relationship between stimulus % intensity and perception intensity. % Equation form: r * (x^n / (x^n + k^n)) + b ...
a02092a42b2454004e8f6bd4e14b3860ad37629ebb875234b018b81d54be476d
MATLAB
1,199
44
function plot_MM(f) mean_line_broadening = 8; for k=1:length(f) fid = f(k).fid; spec = f(k).spectrum; resolution1 = spec.spectral_widht/(spec.n_data_points-1)/spec.synthesizer_frequency; freqat0ppm1 = spec.FreqAt0/spec.synthesizer_frequency+4.7; %Fppm = freqat0ppm1:resolution1:freqat0ppm1+(spec.n_...
e7de17504dd8516f98ea6f26872069ff91ca294f031b54361b71e83e0eee80cb
MATLAB
1,199
40
%% batch process sessions for analysis dataDir = 'C:\Users\edward.horrocks\Documents\Code\V1Dynamics\Data\basic_111022'; sessionTags = {'M22027', '20220517';... 'M22029', '20220607';... 'M22031', '20220524'; 'M22032', '20220621'; 'M22033', '20220706'}; %% saveSuffix = 'PSTH_fastSlow_v2.mat'; inputSuf...
7f8a8416a7a73161920b814f3267d87e2df0685dd456b5f2dd85b2e080c81bd3
MATLAB
1,201
21
%This master script keeps track of the main processing steps for the project %Preprocess data using Glasser2016 parcels, surface data, HCP100 data (msmsulc) %Minimally preprocessed Human Connectome Project data are used as input. Publicly available at: https://www.humanconnectome.org/ %Glasser2016 parcels available a...
fda5e29e33b89a298dbb48f8fae49ba1600714fc21b2b93d25c5f51afa596cf7
MATLAB
1,201
34
% A test script for band_lim_sig_sat_recov(), which recovers saturated signals by iterative band-limited filtering % Reza Sameni, 2024 % The Open-Source Electrophysiological Toolbox (OSET) % https://github.com/alphanumericslab/OSET close all clear clc % Load signal from file (to be replaced with an arbitray signal) ...
6eb7188592306efb5660c008343de0b7d39675f456bf8c083b8ad21df55abb78
MATLAB
1,203
27
function [XYZ,ArcLength,Step_Length,Fs,Y1] = Distribute_Equidistantly(XYZ,Eval_Points_Num,Fit_Res) % This function gets an ordered set of 3D points. % First, it fits a cubic spline to the data. % Then, it computes cumulative length along the fitted curve in order to find the step length needed to distribute % th...
c645eb53179f0f7821a51f99656fd3fb8b0417c152ac4f9c2db6be16fe5d732e
MATLAB
1,203
30
function fil_movie = get_lowpass_movie(p,movie) % remove nans movie(isnan(movie)) = 0; fil_movie = movie; %% create cutoffFilter and normalize to be between 0 and 1 padSize = size(movie,1); filterSize = [size(movie,1) + 2*padSize , size(movie,2) + 2*padSize]; cutoffFilter = mat2gray(fspecia...
b4ab6e597d49ce4079d2d8bc53e561d584350754429a55eaa7ee524ff2025103
MATLAB
1,204
31
function rates = getFiringRates(obj, clusters, nSamples) %GETFIRINGRATES Compute firing rates for specified clusters if nargin < 2 || isempty(clusters) clusters = 1:obj.nClusters; end if nargin < 3 || isempty(nSamples) nSamples = round(obj.hCfg.recDurationSec()*obj.hCfg.frSampleRate); ...
7b580d44d9b336d05f540738cb88658832604b42c65a11d36fb04c03075a98d0
MATLAB
1,205
40
function [map_states] = mapstate_fb_draw(post_draws, Y, xDat) %% st_post = post_draws.states_post; Omega_est = mean(post_draws.Omega_post,4); sqrl = mean(post_draws.sqrl_post,4); rho = mean(post_draws.rho_post,4); N = size(st_post,1); subs = size(Y,3); S = size(Omega_est,3); R = size(Y,2); map_states = zeros(N,subs); ...
aa54b09bfcacff5b288b79241f906e6c79f5290c4f0d6e8ddbb8ce312e35a894
MATLAB
1,205
27
global resection_time %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % PT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% time_PT_vect = xlsread('data.xlsx', 'C3:J3'); PT_mat = xlsread('data.xlsx', 'C4:J9'); N = size(PT_mat, 1); PT ...
f03d64adb611d78561a0f73edac842540d3d51f8b1270084647282bf1682d47c
MATLAB
1,205
40
function phase = PhaseCalculation2(x, y, xi) % PhaseCalculation2 is incomplete and has been deprecated. Consider using phase_calculator instead. warning('PhaseCalculation2 is incomplete and has been deprecated. Consider using phase_calculator instead.'); % % [phase phasepos] = PhaseCalculation(x, y, xi) % ECG phas...
64c61f4f51b5f12e1bbd6036c906528d44301a95014774a14ac5698957baa38e
MATLAB
1,206
31
%% script for ONC analysis and figures %% load data for UCL load('alldata_EEG_control_post_UCL.mat') load('alldata_EEG_control_pre_UCL.mat') load('alldata_EEG_heellance_post_UCL.mat') load('alldata_EEG_heellance_pre_UCL.mat') %% load data for Exeter load('alldata_EEG_control_post_exeter.mat') load('alldata_EEG_contr...
fba954b56125d2d0f162c54785c5388946c6faab858414d8cc5d6ac3b39fbdf4
MATLAB
1,207
38
function [X_Fit,Y_Fit,Success_Flag] = Fit_And_Smooth(Vx,Vy,SmoothingParameter) Success_Flag = 1; Angle1 = atan2d(Vy(end)-Vy(1),Vx(end)-Vx(1)); % The angle of the new x-axis. [Xr,Yr] = rotate_vector_origin(Vx,Vy,[Vx(1),Vy(1)],-Angle1); % Rotate vector to avoid repeating x-values. dx = Xr(2:end) - Xr(1:end-1); ...
6c78e6696b6cb09bb0cc92e7a0a2b0627a13128a734a39560ee21d010cc98b4f
MATLAB
1,211
31
%% Example 1: Extract Neural States from Raw Spike Trains using DimReduce % Perform dimensionality reduction with DimReduce and automatically % visualize data in DataHigh. The data has raw spike trains from 61 % neurons for 56 trials for seven reach directions. The bin size is 1ms, % and each trial is 400ms (take...
e307a71e1b9f1cb75c98bdd0a5ee39f1bfe48d70a8a0daa157cd94da9a661d6e
MATLAB
1,217
49
function [vals, vi] = subsample(vals, k, dim) %SUBSAMPLE Sample k items from vals, optionally along dim if nargin < 3 dim = 2; end if isvector(vals) doReshape = isrow(vals); [vals, vi] = subsampleVec(vals(:), k); % reshape sampled values if necessary if doReshap...
eee0bdf8cb7ad49f4d77b8cdc5ce90b91946e606cdc82701a06c8e751a4f92e0
MATLAB
1,217
26
function [ output_args ] = runSignalExtraction( p ) % runs extraction for every subject and session % loop through subjects and sessions for sub = 1:p.nSubjects for ses = 1:p.nSessions disp([char(datetime('now')) ' Starting signal extraction for Mouse ' num2str(sub) '/' num2str(p.nSubjec...
22bd130b6d3268503609055de5442cea3c727a4461cdf7381453f6906a1fe832
MATLAB
1,219
37
%Copyright (C) 2019, Adria Tauste Campo %Contact details: adria.tauste@gmail.com %Copyright (C) 2079, Jiantao Jiao function [eta,beta_M,contT_M] = ctwupdate_M( eta, index, xt,alpha,beta_M,contT_M, j_index) % countTree: countTree(a+1,:) is the tree for the count of symbol a a=0,...,M % betaTree: betaTree(i(s) ) =...
e35e409e7a832d0a9d77e22dfc6191d7b8c2afff58094e1c13a6251d1f286530
MATLAB
1,221
28
clc clear Dis_statistics = cell2mat(Dis_statistics); Max_Dis = max(Dis_statistics,[],2); Min_Dis = min(Dis_statistics,[],2); Dis_classify = zeros(8,1); [x,~] = size(Max_Dis); for i = 1:x if (Max_Dis(i,1)/Min_Dis(i,1) < 3) && (Max_Dis(i,1)/Min_Dis(i,1) > 0) if ((Max_Dis(i,1) > 10) && (Max_Dis(i,1) <...
b87c4e3d699c072e9caed6ecace10a4d2c51f8b3e3154449367eb7b676bdc47c
MATLAB
1,222
44
% Plot Clean Calcium Transients % After Manual Data Review % Input % SIGNALSclean, % Indexes % Onsets % R_Condition: Durations % Output % Calcium Transients function CaTransients=Plot_Calcium_Transients(SIGNALSclean,Onsets,Raster_Condition,Indexes) % Setup % New_Index_Active=New_Index(TotalActiveNeurons); % A...
dee668ea7a662db13749c9a1f37e5c9ffddbbbb8cae4a5b94efbf408cfb02e56
MATLAB
1,223
31
% Authors : Simon Wadle 2019-2023 %function exports tif with the generic MATLAB function function tiff_export(image_data, path) output_file = Tiff(path, 'w'); [height, width, frames] = size(image_data); export_data = uint16(image_data); % export_data = reshape(export_data, height, width, 1, frames); placeh...
1eb5b339b57daf5f38bce1d8465541e2644b94fb5e033b591c4349502f51a8c5
MATLAB
1,224
63
%Function to relabel simulation results for easier comparison function map = relabel_draws_multi(Omega_prev,st_prev, Omega_next,st_next, alpha) %% [p,~,k] = size(Omega_prev); [S,N] = size(st_prev); parcor_prev = prec2parcor(Omega_prev); parcor_next = prec2parcor(Omega_next); %parcor = 1*(parcor~=0) ; %% %% pr...
d19dcd5ff7c0fc83d71b609478d296cee1f0550940aea152d06051b23170d380
MATLAB
1,226
44
function [valindSQI, indSQI] = SQI5(x, winLen) % % [valindSQI, indSQI] = SQI5(x, winLen) % Channel selection based on channel power in sliding window % % Fahimeh Jamshidian Tehrani, % jamshidian.t@cse.shirazu.ac.ir, % fahimeh.jt@gmail.com % February 2020 % % input: % x: input JADE component of fetal ECG record % wi...
9d00b6f9ab5f7477c762f45f661c67dc8909352d93330e1001fcbdb25b3de090
MATLAB
1,227
38
function seqTouch cd('C:\Users\C238\Desktop\touchcellLtRt_matsuda'); load('seqTouch.mat'); Ltseq5TouchFRMeanArray=[]; Ltseq5TouchFRStdArray=[]; Rtseq5TouchFRMeanArray=[]; Rtseq5TouchFRStdArray=[]; for a=1:6 Ltseq5TouchFRMeanArray=[Ltseq5TouchFRMeanArray mean(Ltseq5TouchFRArray(:,a))]; Ltseq5TouchFRStdArr...
cdb1521fdb6cd93abeea7b170b086e4aa8eb6751254f1ca14c2792645538804c
MATLAB
1,228
58
% str = mynum2str(data, sigfig, maxdec) - converts a number to a string % % mynum2str examples (sigfig=3 and maxdec=2) % 123456.0 --> 123000 % 123.4560 --> 123 % 12.34560 --> 12.3 % 1.234560 --> 1.23 % 0.1234560 --> 0.12 % By Ran Klein 2012??? % Modified: % 2013-12-31 RK Added NA result for empty data. function str...
e52b2a52691936e9ad17f12821aec8d3e9eb47c35844fbba8fddacb2b2ab40d6
MATLAB
1,228
42
function [] = plotONOFFStim(COPE, savename, savepath, color) % This program is intended to plot the contrast between transgenic and WT. % % input: % COPE.roi: (n,1) roinames % COPE.val: (n,1) valu % COPE.groups: (n,1) groups % datapath: % % output: % .png figure in a savepath % % by Hiroaki Hamada, Dec 18th, Araya ...
d97389d36d858dd8ed36f090a0e8e114957ab4ffcb5652a4d77c8d7878a6f555
MATLAB
1,229
29
% y = Median(x,N,L1,L2), % % Single or Double stage median filter % inputs: % x: input vector. x should be in 'double' format. % N: input signal length (length(x)) % L1: first stage median window length (in samples) % L2: second stage median window length (in samples) % % output: % y: output c...
45580b7cb4f4bb4ee2c06cf85cd5b55b0d007403cf3d947462b986c20b0da63c
MATLAB
1,230
58
function y = reshapee(x, varargin) %|function y = reshapee(x, varargin) %| %| reshape function that allows possibly one null argument, and all %| other arguments can be vectors, unlike matlab that requires scalars. %| example: reshape(rand(2*3*5,7), [2 3], [], 7) will become [2 3 5 7] %| %| in %| x [(*dim)] %| vararg...
175b6401f1b491d2acaf109b2427fa6af8b9644932b4b16039177733590255e6
MATLAB
1,231
45
function newlist = addsufixtofilenames(filelist,prefix) % filelist must be a cell array where each element is a char-array % containing a list of file names. nocell=0; if ~iscell(filelist) filelist={filelist}; nocell=1; end newlist=cell(1,length(filelist)); for i=1:length(filelist) wfiles=...
f67bf818762e3850fe3773ebb47b0781fa06de8f7b9704c3715113de943ecd9c
MATLAB
1,231
41
function ind = ChannelIndex3(x,w,bin,N) % Channel selection based on energy deviations followed by a bandpass % filter using a DFT filter bank % % Reza Sameni % December 2008 % L1 = size(x,1); L2 = size(x,2); % y = zeros(size(x)); % % % ind = zeros(L1,1); x = (x - mean(x,2)*ones(1,L2)) ./ (std(x,[],2)*...
004f5001054c40158c0bcfbdfbea8e3f2b1ede035a41b31b8eec460da0f2fbd9
MATLAB
1,232
36
function [d,p] = getkpaths(map,K) %% Calculate the K shortest paths between any pair of nodes % This function calculates the K shortest paths from any node i to node j % in the network. The length of a path is defined by the sum of the inverse % projection of the nodes along the path. The shortest path (i,j) is the...
c4c045a754ee07a15a9bb43b36b0a0066770e8dd38a293fb7de42ad0bc7489e9
MATLAB
1,236
45
function c = get_water_content2() marsbar('on'); %anat_dir = '/home/romain/data/spectro/hipo/OCC/anat'; %suj_dir = get_subdir_regex(anat_dir,'pilote') anat_dir = '/home/romain/data/spectro/tourette/anat'; suj_dir = get_subdir_regex(anat_dir,'rett') for ns = 1:length(suj_dir) [p,f]=fileparts(suj_dir{ns}); [p,sujn...
4c1f6b98f2b5cdee4f4432528c72d06794232fab8e58ba1f827dcf1e62a46992
MATLAB
1,237
41
function b = baseline_sliding_window(x, L, approach) % baseline_sliding_window - Baseline wander extraction from biomedical recordings using a single stage of median or moving average filtering. % % Syntax: b = baseline_sliding_window(x, L, approach) % % Inputs: % x: Vector or matrix of noisy data (channels x s...
bb2ddc71e7be36e17caa2a7c17dbbc9fb234c136b9d340d46c42ef8a0c5000d3
MATLAB
1,238
40
function Plot_all_features(handles) % function Plot_all_features(handles) USER_DATA = get(handles.wave_clus_figure,'userdata'); par = USER_DATA{1}; inspk = USER_DATA{7}; classes = USER_DATA{6}; colors = [[0.0 0.0 1.0];[1.0 0.0 0.0];[0.0 0.5 0.0];[0.620690 0.0 0.0];[0.413793 0.0 0.758621];[0.965517 0.517241 0.034483];...
610f9a434b3148241b96f814ca841db53862d132bdc1d98cde2c25483c7f05ac
MATLAB
1,240
33
function V = gompertz_exp_alpha0_beta(param, DT_invitro, temps, Vc, V0) % param = [alpha_0, beta] parameters of Gompertz growth, according to % dV/dt = (alpha_0-beta*log(V/Vc))*V % hence alpha_ = relative growth rate at V = 1 cell (volume Vc) % DTinvitro = doubling time in vitro in hours DT_invitro = DT_invitr...
6b26c9c90564d38c7b06f887d99235cedcf7186bb429508a274b3ef700397ee0
MATLAB
1,241
42
function [] = plotONOFFStim2(COPE, savename, savepath) % This program is intended to plot the contrast between transgenic and WT. % % input: % COPE.roi: (n,1) roinames % COPE.val: (n,1) valu % COPE.groups: (n,1) groups % datapath: % % output: % .png figure in a savepath % % by Hiroaki Hamada, Dec 18th, Araya % plo...
031445933b4f60df390ef208fab6b45a70d1fa9e409960e3d23ab3af47ae0cdb
MATLAB
1,242
46
function [valindSQI, indSQI] = SQI3(x) % % [valindSQI, indSQI] = SQI3(x) % Channel selection based on measure of non-gaussianity % % Fahimeh Jamshidian Tehrani, % jamshidian.t@cse.shirazu.ac.ir, % fahimeh.jt@gmail.com % February 2020 % % input: % x: input JADE component of fetal ECG record % output: % valindSQI: va...
79fa771ba77445e7230c8e2f2dd78218791ae9948936eaba50a203ed17c400d3
MATLAB
1,242
32
% Function that gets the indexes to read variables from workspace % with a specific sufix -Filterby- % Input % WorkSpaceVariables: list of variable names (who function) % Filterby: Sufix of the Variable % NC: N variables to read % Output % index_var index of the workspace variable % index_CHECK check if it ...
e0e802d0e4aa96949304388606d2eafbc76b4117febcb3f4d9e6cde254513e99
MATLAB
1,243
35
function y = LPFilter(x,fc) % % y = LPFilter(x,fc), % Second order zero-phase Lowpass filter % % inputs: % x: vector or matrix of input data (channels x samples) % fc: -3dB cut-off frequency normalized by the sampling frequency % % output: % y: vector or matrix of filtered data (channels x samples) % % % Open Source EC...
6089f07d3fb64da65bcca425ee6ee6a40ab45eea3e7a5ba96013d61720682617
MATLAB
1,245
41
function plot_results(session, channel, unit) % Plot some results % % Parameters % ---------- % info = get_info(); fprintf('===== Plot some resutls =====\n\n'); main_timer = tic(); probe = [7, 6]; % probe trials_type = 'test'; % 'train', 'test', 'validation' | scalar perio...
fccd011f737bdd522cb48f0e08329a4f4709368b6a0a30a32c55e7bdf12a25a6
MATLAB
1,246
45
clear clc close all %%% choose the file to look at Filepath = 'E:\Data\Preprocessed\Clean\Waves\Music\P07_Music_Session2_Clean.mat'; % Filepath = 'E:\Data\Preprocessed\Clean\Waves\Game\P10_Game_Session2_Clean.mat'; %% % Choose window to look at Window = [80 95]; % seconds Window = [0 400]; Window = [0 300]; WindowL...
1a9a299cf110c377b21678e5992ca6d4514954d7e1d1ced15a44052547eea4f2
MATLAB
1,247
25
cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\per_mouse\figure_1\1i') T = importdata("side_per_session_data.mat") %% T.mouse = cellfun(@(x) x(1:6), T.sessions,UniformOutput=false); T.res_n = T.GroupCount.*T.mean_is_responsive T.IE_n = T.GroupCount.*T.mean_is_ir Tm = grpstats(T,["mouse","side"],@sum,...
df1a8d85c78b063b176593182106e96fbf5c01b7514a81c70c5b52ad438fbebf
MATLAB
1,248
60
% For a pixel vector, show how the map is function [] = ShowField_Rec(Vec, Range, XPix, YPix, varargin) if size(Vec,2) == 1 Map = reshape(Vec(Range),YPix,XPix); imagesc(Map) colormap jet set(gca,'YDir','normal') colorbar elseif size(Vec,2) == 3 Map = zeros(YPix,XPix,3); for LgnInd = 1:3 ...
bde593d001c4a24bf01736a9c2cf8d65a0cc41ce6eef3c4867fb852bc6bce5b9
MATLAB
1,250
35
cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\eopn3\eopn3_vs_scarlet') NDs = [10, 8, 6, 4, 3, 2, 1]; % save('eopn3_vs_scarlet', 'T2') T2 = importdata('eopn3_vs_scarlet'); n_perm = 100000; tail = -1; t_stat = ['t']; t_stat = ['w']; % t_stat = ['td']; [pval(:,1), t_orig(:,1), crit_t]=mult_comp_pe...
b84b8e010fd1d2e6f18cdc50233c5af64c02c467090e4365fa4e804819fc252d
MATLAB
1,251
36
% The script calculates the Inter Spike Intervals (ISIs) and plots the % results in a histogram. The proportion of ISIs violating a threshold % is also calculated and indicated in the histogram. % authors: Francesco E. Vaccari % date: 10/2022 clear all; clc; close all; addpath('supportFunctions') currentFolder = pwd...
0ea6e12d8248a9051d41145c3558602f7536f33b69d6d759ab382e05f15958cf
MATLAB
1,252
37
function download_data %% Download Allen Mouse Brain Connectivity Atlas in JSON format. base_url = 'http://connectivity.brain-map.org/api/v2/data/ProjectionStructureUnionize/query.json'; crit_opt = '?criteria=[section_data_set_id$eq%s],[hemisphere_id$ne3]&num_rows=all'; only_opt = '&only=section_data_set_id,struc...
09d871759679655c4d28ed02038c78df31c8ce831132df2f2951979e9d038f8c
MATLAB
1,254
36
function polarity = ecg_polarity(ecg, fs) % ECG_POLARITY - Calculate the polarity of multilead ECG data % % polarity = ecg_polarity(ecg, fs) % % This function calculates the polarity of multilead ECG data by estimating % the skewness of the ECG signal after baseline removal and determining % whether the skewness is p...
4e2827bb230aeb8b4d99a7f1ac631191087becd7e877c232f3d9f7e3ab958c34
MATLAB
1,254
47
function a_dist = spherical_dist(x,y) %SPHERICAL_DIST Spherical distance between two points on the sphere % %Syntax % a_dist = spherical_dist(x,y); % %Description % A_DIST = SPHERICAL_DIST(X,Y) sets A_DIST to be the spherical distance % between the two points X and Y. % % The arguments X and Y must be arrays of the sam...
296e9b233227884d4a96ab740e195d7fcfbea630e4b38afad843401e2e093756
MATLAB
1,255
73
function conversion_speed_testing % % % conversion_speed_testing % % % TODO: This should be moved to the testing package. root_path = 'C:\Data\GSK\ChrisRaw'; root_path = 'C:\D\GSK_Data'; base_file = '140207 control cmg.'; file_path = fullfile(root_path,[base_file 'adicht']); mat_fpath = fullfile(root_path,[base_f...
8db1ad2a421016e568b4b04fe223a418f16bcbdc49d65851bf96977359dd5f1d
MATLAB
1,255
37
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...
43bbc8768b3d1a63a8cf0e963f7e3421e98fc9abb652b5f36ef114fb759c9e5e
MATLAB
1,258
57
% Test program for fetal ECG ploting % % Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox % % Sample code for testing naive maternal template subtraction technique % % Reza Sameni (C) % Email: rsameni@shirazu.ac.ir % Web: www.sameni.info % % Crated 2006 % Modified ...
42e04dd3b8c515b1fe90e05e4b3fc5f6f7b60b980d416d5a1dbf439477f942b8
MATLAB
1,261
53
function make_fwc_curve(input,par_input) %Handler to call wave_features to draw feature stats curve %Inputs: % matrix of spikes % name of file with spikes inside if nargin<2 par_input = set_parameters(); end fname = {}; if isnumeric(input) && min(size(input))>1 fname = {[]}; elseif ischar(input) fname = {inp...
5d460777b5cfc88806aef1b36c09db4af51793a3175b21b9069650ec8d15ceb3
MATLAB
1,262
34
function [FiltData, Filter] = highpass_filter(Data, SampleRate, PassbandFrequency, ... StopbandFrequency, DesignMethod, PassbandRipple, StopbandAttenuation) arguments Data SampleRate (1, 1) {mustBePositive} PassbandFrequency (1, 1) {mustBePositive} StopbandFrequency (1, 1) {mustBePositive} = Passban...
c3477e4f618e2ab1a1dba70b2ea0e2b33740114938c328986d5e332e4737acbb
MATLAB
1,264
34
%{ ---------------------------------------------------------------------------- %Stimulus bias changes by block %Just model analysis %Based on Rao 2010 Front Comp Neurosci %Value updating + Prior updating ---------------------------------------------------------------------------- %} function Dual_RL_model_bl...
e26ccdd44ee38bce7fab9fe02de77dd0b0d6f83c4bd2262d108aa170b7f36f47
MATLAB
1,264
34
%{ ---------------------------------------------------------------------------- %Stimulus bias changes by block %Just model analysis %Based on Rao 2010 Front Comp Neurosci %Value updating + Prior updating ---------------------------------------------------------------------------- %} function Dual_RL_model_bl...
89e07b07bb88ab71ad997466bb846454a355ee8843feef7b4ced73f71e61cc67
MATLAB
1,265
44
function [fo] = correct_baseline_mega(fids,nb_point) % RETURNS: the integral and centroid of the peak (in ppm) % nb_point number of points to estimate, from the end of the means spectra fo = fids for nbser = 1:length(fids) fid = fids(nbser).fid; info = fids(nbser); ppm_center = info.spectrum.ppm_...
aaf41757fbcefe4eb0e6aa04b61f49c45cb768ef75f185fcc36ffc2de7efe31a
MATLAB
1,265
33
function [] = process_single_segment(foldername, Fs) % calculate connectivity % Hanlin's CellExplorer hecking codes % Fs : seconds % Assumes that the working directory is where this matlab file is addpath(genpath("./CellExplorer-master")) results_tmp_matpath = [foldername '/mono_res.cellinfo.mat...
2665877cab4ae2108388e85db305c716d15a95bacfcd9d19babb9e35ffa54343
MATLAB
1,266
48
function [mData]=mnl_MedianFilterEachChannel_2D(Data,r) %Function to perform a 2D median filter on a 3D stack of each channel (i.e. %a 4D image) %Re-arrange to split channels into individual Z stacks if isempty(r)==1 r=3; end dim=size(Data); DataSize_pts=dim(1)*dim(2)*dim(3)*dim(4); if isa(Data,'uint16')==1 Da...
c63ca8630992fb82896198d5ee45c3e5f728c6b753d93aff72981a9f99272f02
MATLAB
1,266
28
function [pcc] = get_pcc_from_prediction_ranks(prediction,grnnet); % GET_PCC_FROM_PREDICTION_RANKS Set p-values of interactions according to the ranks of evidence. % PCC = GET_PCC_FROM_PREDICTION_RANKS(PREDICTION,GRNNET) for gene regulatory network GRNNET and interactions PREDICTION % (#interactions-by-3) with ro...
eb5994a181b87465a35e7c67aa93d5fcdf427ae2eb785cca64f08d2485cc600b
MATLAB
1,266
40
port = serial('COM9','BaudRate',115200); fopen(port); % Specify the conductance values (in nS) and diffusion constant values (in % nS^2/ms). g_shunt_CH1 = 0.0; m_OU_exc_CH1 = 0.0; D_OU_exc_CH1 = 0.0; m_OU_inh_CH1 = 0.0; D_OU_inh_CH1 = 0.0; m_OU_exc_NMDA_CH1 = 0.0; D_OU_exc_NMDA_CH1 = 0.0; g_EPSC_CH1 = 0.0; f_poisson...
82cbf55b3433bab56d7ee5c337ce610541fc71031f590a7c83183cecb5deb2eb
MATLAB
1,268
29
if (strcmp(recording_type,'bAP_incremental'))||(strcmp(recording_type,'noopto_somastim')) stim_idx = find(diff(Im2(:,1))>300); stim_idx(find(diff(stim_idx)<=15e-3/dt)+1) = []; elseif strcmp(recording_type, 'paired_stim_Ca') stim_idx = find(diff(Im2)>300); stim_idx(find(diff(stim_idx)<=15e-3/dt)) = []; ...
3716f52a29843764acf0232b33442d5bb976b7c0d054e2e9d9db31a744750155
MATLAB
1,269
41
function diam_bound = eq_diam_bound(dim,N) %EQ_DIAM_BOUND Maximum per-region diameter bound of EQ partition % %Syntax % diam_bound = eq_diam_bound(dim,N); % %Description % DIAM_BOUND = EQ_DIAM_BOUND(dim,N) does the following: % 1) uses the recursive zonal equal area sphere partitioning algorithm to % partition the ...
44c70d39df49ce53a68100c2ff1eb2cfd895d7f4c63d96306e386e3c9fecc379
MATLAB
1,270
40
% Function to plot pdf's of simmilarities % between or among ensembles of different condition function plot_pdf_simmatrix(SIM_MATRIX,Names_Conditions) %% Setup NC=numel(Names_Conditions); auxcomb=1; figSimmMAt=figure; figSimmMAt.Name='PDFs for Simmilarities among ensembles'; ax1=subplot(1,1,1); hold(ax1,'on'); %% Set C...
7b2ff3c5900d6e68ff86e8979e22112b215265e82a884e59770f3752e243dcb7
MATLAB
1,270
37
function flag = recover(obj, ask) %RECOVER Inconsistent data recovery, with a hammer if nargin < 2 ask = 0; end flag = recover@jrclust.interfaces.Clustering(obj, ask); if flag < 1 return; end inconsistentFields = obj.inconsistentFields(); if flag == 2 || ismember('temp...
379f594c28c60a1bebaeae179a05e8f59be1951270d850fc021ce02f23a0c9d3
MATLAB
1,272
34
function [expKer,kerSize] = getExpKer(tau_decay,tau_rise,Fs) %getExpKer - Get exponential kernel % % Usage: % [expKer,kerSize] = getExpKer(tau_rise,tau_decay,Fs); % % Description: This function creates an exponential kernal that mimics % the dynamics (rise time and decay time) of a fluorescent sensor...
bdaefcc1854691d4b17c2f6777ca8d74fd391213c3e85cdbf677b37a77f1b3b3
MATLAB
1,275
34
%This Script saves all the variables from the current workspace into a %single structure array. %Author: Andres Gonzalez %Year:2012 %Version:0.2 %######################################################################### %Summary: %This function allows to save all the variables from the 'caller' workspace into a struc...
af290c03913c36330028245d5bc7f23b878e86edcc6367483b9e443cfaced775
MATLAB
1,276
37
% Funtion to get Positive Threshold of a Feature % where p(signal)>p(noise) % using indexes of detected signals and noise function Th_pdf=get_threshold_pdf(Feature,signalindx,noiseindx) % Check if there is Another Threshold ################ if ~isempty(noiseindx) % Detected Signal and Noise Records % Support ...
b5f987619c58bcb76e4acf4dbace43be2989475262d42363a00053fece5a6688
MATLAB
1,276
25
function W = Adjust_Rect_Width(Workspace1,Step_Parameters) xv = zeros(1,length(1:ceil(2*Step_Parameters.Rect_Width))); yv = xv; W = ceil(2*Step_Parameters.Rect_Width); % for i=1:floor((ceil(2*Step_Parameters.Rect_Width)-1)/S) % For each width. for w=1:ceil(2*Step_Parameters.Rect_Width) % Scan from 1-pixel widt...
0ab9e73db1b1c8640b36d70d118a3b8e5ead9a792e695bc5c8e709ec18b80f29
MATLAB
1,277
37
% load n-NRF magnitude data for both sites both_sites_magnitudes = readtable('both_sites_magnitudes.csv'); both_sites_magnitudes_hyp1 = both_sites_magnitudes(both_sites_magnitudes.hypothesis1_include == 1, :); %% UCL UCL_magnitudes_hyp1 = both_sites_magnitudes_hyp1(both_sites_magnitudes_hyp1.Site == "UCL",:); ucl_lanc...
f1a75bfbc4b72cebd79ab544baa9eaa78fd56593b0015bad95ec9d898b0f400b
MATLAB
1,277
42
clc, clear, close all data = importfile('prediction_per_actual.csv'); N = length(data); M = N/2; % show R2 curves % X x_act = data(2:2:end, 1); x_est = data(1:2:end, 1); figure; plot(x_act - 500, x_est - 500, 'ok', 'LineWidth', 2, 'MarkerSize', 5); hold on; plot([-600, 600], [-600, 600], 'r', 'LineWidth', 2) xla...
1fbcb52dd6858ce6dceaf774acef9377f8fd90f5a430c9d6b1fd6358399e17d6
MATLAB
1,279
51
function y = bp_filter_dft(x, fl, fu) % bp_filter_dft - Bandpass filter using discrete Fourier transform (DFT) filtering. % % Syntax: y = bp_filter_dft(x, fl, fu) % % Inputs: % x: Vector or matrix of input data (channels x samples). % fl: Normalized lower frequency. % fu: Normalized upper frequency. % %...
c8fe9c71bd8b68cf748ac28bc504fcd439927f7519e3cbea08f0bde79631621c
MATLAB
1,279
38
% FastICA for Matlab 5.x % Version 2.1, January 15 2001 % Copyright (c) Hugo Gävert, Jarmo Hurri, Jaakko Särelä, and Aapo Hyvärinen. % % Type fasticag to launch the graphical user interface % % Please refer to your Matlab documentation on how to add FastICA to your % Matlab search path. (One place to start is th...
ccd2457975309516dcaa340d9c40095f3b1440d6614053d64826079d45c5ce16
MATLAB
1,279
28
%% Select_Raster Script and RASTER FEATURES for POSITIVE CELLS*************** % INPUT: % MetaDataColocaliation.PositiveCells: Indexes of the POSITIVE SELECTED % fs: Sampling Frequency % R_merged: Cell off POSITIVE SELECTED cells x Frames % XY_merged: POSITIVE SELECTED Coordina...
99d46bb7dfb27d906a65a6af5c305cd4e8f7da62791641ac79db419957a88655
MATLAB
1,280
41
function vertex_diam = eq_vertex_diam(dim,N) %EQ_VERTEX_DIAM Maximum vertex diameter of EQ partition % %Syntax % vertex_diam = eq_vertex_diam(dim,N); % %Description % VERTEX_DIAM = EQ_VERTEX_DIAM(dim,N) does the following: % 1) uses the recursive zonal equal area sphere partitioning algorithm to % partition the uni...
be481fe636ac14cd93b18ae4d244e721d0842d778fd114419b4e099342dc1ae5
MATLAB
1,280
60
function o=get_subdir_regex_one(indir,reg_ex,varargin) if length(varargin)>0 o = get_subdir_regex_one(indir,reg_ex); for ka=1:length(varargin) o = get_subdir_regex_one(o,varargin{ka}); end return end if ~iscell(reg_ex), reg_ex={reg_ex};end if ~iscell(indir), indir={indir};end o={}; if lengt...
ce6c9b76cf7ec3c1855825ccc07c48f8fccfd56d0c616aaca0b400711cc08af4
MATLAB
1,280
41
function [ av_trials, err_trials, trans_data ] = project_trials_into_one_subspace(p,av_trials,err_trials,trans_data,trial_idx,q,cell_means,dr_dc) %% project DC trials into subspace and pool over tasks % project trials into joint subspace t_pool_av = []; t_pool_err = []; t_pool_trans = []; ...
e8099137e881ea0fb1aa20b2676e0e83c1d3f05fcec52468aaaa894ad50a4692
MATLAB
1,280
49
classdef ControlFigure < dynamicprops & jrclust.views.Figure %CONTROLFIGURE properties hControls; hPanel; end %% LIFECYCLE methods function obj = ControlFigure(figTag, figPos, figName, figToolbar, figMenubar) obj = obj@jrclust.views.Figure(figTag, figPos, fi...
433aa5eb9cfe1501d9ba3929125f16c468b8c35f116f2519dc074cb60b5f69df
MATLAB
1,281
34
%% Iterations of LDE: Use precomputed function to determine output of a cell type % Input: L4EmeshX, L4ImeshY Domain of precomputed functions % LDEFrfunc_Subf Functions of all input type for certain cell % population % L4EUse,L4IUse All input L4E L4I % LDEUse Just fo...
47cb4c732c02fb3ee0891bcf8265386bad294d5fa6693e4e4871641ff70ec5be
MATLAB
1,281
35
function [] = imwriteTFSK(Volume,name) %imwriteTFSK дÈë3D-tiffÎļþ£¨Ö§³Ösingle/double) % imwriteTFSK(volume,name) t = Tiff(name,'w'); % Filename by variable name tagstruct.ImageLength = size(Volume,1); tagstruct.ImageWidth = size(Volume,2); tagstruct.Photometric = Tiff.Photometric.MinIsBlack; if ...
b2d6afa3444b75a175f90ba9af559d3485309ed07f9ed3f5e2b316877485c1dc
MATLAB
1,281
48
function Output = cache_function_output(Function, varargin) % runs a function, saves the output on disk, and next time the function % is run, if there's something on disk, it just uses that instead of % running the function again. Use for slow functions like designfilt. % Example: Output = cycy.utils.cache_function_out...
9a9e8b21bb8c6f21a80d008e7fcaca30daa2b94b2277ca6cf27f7f0af0420941
MATLAB
1,282
38
function [EEGAllSessions, BurstsAllSessions] = load_sessionblock_data( ... SourceBursts, SourceEEG, Participant, Sessions, BurstVariable) % load EEG and/or bursts data from multiple sessions together % TODO extend also for pupil data? % BurstVariable should be either 'Bursts' or 'BurstClusters' EEGAllSessions = st...
0de43b39ccc616abd978fe4e388c4eca69b1ef22d262a1246514e1bf52105f52
MATLAB
1,283
49
function []=mnl_CumulativePlotMatrix(Matrix) %mnl_CumulativePlotMatrix is designed to plot cumulative distribution plots of %multiple groups to compare the differences in the spread of the data. %Inputs %Matrix - Rows =each value % - Columns = each group szM=size(Matrix); cmap=colormap(jet(szM(2))); for i=1:szM(...