sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
03153aa944a0ce397776831ae64726670830ae1a876511f63011d4358b264bb6
MATLAB
2,179
62
function x = ecg_gen_from_phase(params, phase) % ecg_gen_from_phase - Synthetic ECG generator using a Gaussian mixture model. % % Syntax: % x = ecg_gen_from_phase(params, phase) % % Inputs: % params: A vector of length 3*L, where L is the number of Gaussian kernels structured as follows: % - a...
b5b5bb2c71ddcfc51238c336aa2876dc54cd3a6a70cab838375a1621d9cc966b
MATLAB
2,179
83
%% compare baseline form all_ints_data clc clear cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\eopn3') all_ints_data = importdata("all_ints_data_eopn3.mat"); all_ints_data_control = importdata("all_ints_data_control.mat"); %% baseline = baseline_form_all_ints_data(all_ints_data); low_baselin...
e6a654ccaa3aeca2f243897f570e0fcbac9001d7d745481dbd7080256794ec8d
MATLAB
2,179
73
function graph_est = fdr_est(kappa_post, fdr) %% %Input %%kappa_post: a RxRxSxnsims array of the shrinkage coeficients %%1/(1+lambda_ijs*tau_s) %%fdr: real between 0 and 1, desired false discovery rate %Output %%graph_est: a RxRxS array of indicator variables for selection kappa_thresh = squeeze(median(median(median(...
36472a9473f75fff36d6108016497ae1526bf4cbfde845b66574de6265d87374
MATLAB
2,180
84
%% %% i/o args % output args: % PSTH % z-scored PSTH % ?reliability % plotHandle % input args: % stimulus trial event times (on + off times) % blank trial event times % spike times spikeTimes = unitex.spiketimes.*1000; statTrials = tsd(cellfun(@(x) prop(x<3)>=0.8 & mean(x)<0.5, {tsd.WheelSpeed})); statTrials_blan...
aa600d9027918ab28b329fb20930a83182dde2b69ff9cd4ae58d541ecc7372a0
MATLAB
2,180
79
function peak_VE_evoked(sub,ses,project_dir) restoredefaultpath % close all clc % project_dir = 'R:\DRS-KidsOPM\Paediatric_OPM_Notts_AdultData\'; % % sub = '001'; % ses = '001'; run = 'run-001'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% datadir = [project_dir,'Data',file...
a83a9d6cb1815f2984447e1b403442e656ba2589083e5906f16d451b24988fbf
MATLAB
2,181
69
function result = verLessThan(toolboxstr, verstr) %verLessThan Compare version of toolbox to specified version string. % verLessThan(TOOLBOX_DIR, VERSION) returns true if the version of % the toolbox specified by the string TOOLBOX_DIR is older than the % version specified by the string VERSION, and false otherwi...
f837f9aa000593997bd4b4b665f8d5c04fc1858db9f292d9e41536740bc4cff6
MATLAB
2,181
48
%% Calculate response stats cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\DREEDDS_VS_dreadds before\new_IR_calculations\IE cells') % T2 = T(find(contains(T.tags, ["dreadds before", "dreadds after"])),:); clear clc T = importdata('IE_CELLS_table.mat'); T2 = T(find(contains(T.tags, ["dreadds before", "d...
1381efc0699a7eec76e84bca01c1c7bda19e45c16ac72fdd1ff63b67f3da5776
MATLAB
2,182
79
function zn = nufft_interp_zn(alist, N, J, K, func, Nmid) %function zn = nufft_interp_zn(alist, N, J, K, func, Nmid) %| %| Compute the "zn" terms for a conventional "shift-invariant" interpolator %| as described in T-SP paper. Needed for error analysis and for user- %| defined kernels since I don't provide a means to...
41c557fe291b56f09fd49140cceaaaf0159f6db2c2d827c373d706630f3a753f
MATLAB
2,182
41
function Locs1 = Trace_Peak_Analysis(Workspace,Step_Params,s,v,Scores,ImSize) % This function find peaks in the convolution function. % It uses the skeleton constraint to filter out peaks that are too far, and to sort those that satisfy the condition. L = Step_Params.Scan_Length; Locs1 = []; Trace_Skel_Max_D...
92b71116bcb3a6b1053e037d29cb8afbbbdfaa01ad60f4319f9e6500b1f14686
MATLAB
2,182
63
function PCA20200117 path=['C:\Users\C238\Desktop\CheetahWRLV20180729Part1']; cd(path) LS1=ls; % MaxA1Rt DiffMaxMinR MaxZR A1RtStepFreq % MaxA2Lt DiffMaxMinL MaxZL A2LtStepFreq % TouchIndexMatrix=[]; for i=1:length(LS1(:,1)) trimFolder1=strtrim(LS1(i,:)); if ~strcmp(trimFolder1,'.') &...
c3a8b82c9eabe34106a4878e48b294e0ac9e7c6d2ac9bf1dde11cb2135cb4083
MATLAB
2,182
45
function [prVecs1, prVecs2] = getPVClusters(hClust, sites, iCluster, jCluster) %GETPVCLUSTERS Compute principal vectors on sites from one or two clusters % input: sites, a vector of site indices % input: iCluster, primary cluster ID of interest % input: jCluster, optional, secondary cluster ID ...
f255b493757f517b0a2ca21f015e7133a3e77053cbf01eea81cc8b86c9b21174
MATLAB
2,189
69
function [valindSQI, indSQI] = SQI1(x, peaks) % % [valindSQI, indSQI] = SQI1(x, peaks) % Channel selection based on Pseudo-periodicity % % 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-peak imp...
09998f1e3d34c50939308b094fc7b4d3082511c39c3731faf88d24654233f973
MATLAB
2,191
83
% Function that Detects Calcium Transients % from onset spikes and denoised fluorescence signal % Input % R: Raster Matrix: Cells x Frames % XEST: Denoised Fluo Signals % Output % NoT Number of Transient per Cell % ITI Inter Transient Interval units:[samples] % LT Latency Transient ...
e5fe343495ecf49da29db8c4ed320e90a33dee31724497be9bd8c7ea1c3270f5
MATLAB
2,191
58
function [ProcessedEventWindowData_SAVE,varnamesDATA_SAVE] = relativeBLperZscoreV2(ProcessedEventWindowData,EventWindowDts,varnames,varnamesDATA,setupParam) ST1 = {'Raw'; 'Recentered'; 'DecayAdj';}; inUseST = fieldnames(ProcessedEventWindowData); STidx = zeros(1,numel(ST1)); for i = 1:numel(ST1) if ismembe...
188e6317860c80439a332c52fefe662265f56e3b165c03f68780f654fc1752c8
MATLAB
2,193
71
function gui_sc (action) % % This file is used by FASTICAG % This file holds the callbacks for save-dialog % 5.6.1999 % Hugo Gävert %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf_FastICA_Save; % Handles to some of ...
803fe87dfb687cad6c1eb526434f413a90c937a48b5d80a4e4a5237d74cba49a
MATLAB
2,196
108
% kalman filter of rossel system signals sample entropy clear all close all % Data Sampling Rate: 100 Hz fs = 100; % Generate rossel signals a=0.38; b=0.2; c=5.7; x(1)=1; y(1)=0; z(1)=0; h=0.01; for i=1:50000 K1=-(y(i)+z(i)); L1=x(i)+a*y(i); M1=b+x(i)*z(i)-c*z(i); K2=-((y(i)+h/2...
a3ebbbc4e6532cd82dc186c94c1ece0962c0c101535b5684f255e8009305e924
MATLAB
2,197
71
% do basic decoding for 4 different settings: % neural vs. speed % a/e vs. iti clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData.mat'); load(fpath,'evs','tis','bvs','traces') [cols,alpha] = chooseColors; %% fpath = fullfile(p.data_dir,'av_vs_iti'); saveFigs = 1; saveData = 1; aa_sessions = 3:9; n_...
4295fb60cc091141de457c04ca2b32feeb98e00ef71f1c29b1c93450d053112c
MATLAB
2,200
58
function [ nexFile ] = nexAddMarker( nexFile, timestamps, fieldName, fieldValues, name ) % [nexFile] = nexAddMarker( nexFile, timestamps, name ) -- adds a marker event % (series of timestamps with string tags) to nexFile data structure. % In general, each marker timestamp can have several ta...
b90c5d62cfbd2206b923ec9261647866663215bc38fd7f811416512ec514efac
MATLAB
2,200
116
%%%%% Neuron Parameters %%%%%% C=50; k_input=1.; v_rest=-80.; v_t=-20.; c=-55.; v_peak=40.; a=0.01; b=-20.; d=150.; noise=0; R=100; %%%%% Synapse Parameter %%%%%% tau_s=20; Apostpre=1; %%%%%% Simulation Parameters %%%%% T=300; dt=0.01; t_vect=0:dt:T; n_times=length(t_vect); ve=zeros(1,n_times); we=zeros(1,n_times); ...
21c2bf3c9b604d2bd63784607f8bd5d58cfaee02df5cf417f24ae145385e8cfe
MATLAB
2,201
48
function import_exp_data(csvfile) %% Import experiment metadata from experiments.csv % Read csv file and write experiment details to data structure. % % This function depends on a file experiments.csv which contains metadata % from all relevant experiments, retrieved from connectivity.brain-map.org. % FormatSp...
ec45f315d5e147886259cf3fec4fc23b5a99ab4c19eabc7bde056381c54a1e36
MATLAB
2,201
78
%Copyright (C) 2019, Adria Tauste Campo %Contact details: adria.tauste@gmail.com %Copyright (C) 2079, Jiantao Jiao % DESCRIPTION: Function CTWAlgorithm outputs the universal sequential probability % assignments given by CTW method. function [Px_record ]= ctwalgorithm_M(x,Nx,D,Temps) %function Px_record = ctwalgorithm...
6c8f692575617fb5a0824503c852bac1645ac8d644299b4a99b9dd07b010a05e
MATLAB
2,202
87
function CellCounter20190710 cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\11931_170607_98___Classify'); LS=ls; Rtcount1=0; Ltcount1=0; RLtcount1=0; Doncount1=0; Woncount1=0; Woffcount1=0; Rtcount2=0; Ltcount2=0; RLtcount2=0; Doncount2=0; Woncount2=0; Woffcount2=0; R...
635b7c8576253b9173d19fa537ba426f9cb7aec54990c1ebb75da38625e9ff95
MATLAB
2,204
73
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Expand an image as per the Gaussian Pyramid. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function IResult = GPExpand(I,newdim) Wt = [0.0500 0.2500 0.4000 0.2500 0.0500]; dim = size(I); % newdim = zeros(1,3); % newdim(1) = dim(1); newdim(2) = dim(2); newdim(3) =...
5c245a66f803777530d7993856c9dde9e2f5eccadf4d08aa82e49d397dbc496c
MATLAB
2,205
84
function [results]... =Call_Function(TC, X, S, burnin, nmc, seed) %% Inputs: % Y_file : % Set seed rng(seed) %% Call Function Implementation % Add paths to data %addpath 'MCMC_Folder' data.TC = TC; data.X = X; % Get the dimensions p = size(data.TC,2); T = size(data.TC,1); base_prob = .5; alpha_0 = log(base...
b5af811e9e3b0bc368f4f058b55654d37193059b533e514a6b58c0bbd86bb36c
MATLAB
2,205
70
% test the Spikes and Bumps phenomenon in ICA using real fetal ECG data % Reza Sameni, Copyright 2006 % Modified June 2018 clear; close all; load LTE07102005_40s.txt -mat; data = LOUETTE_40s';clear LOUETTE_40s fs = 1000; % Keep the follwoing lines if you want to repeat the same results again randn('seed', 1); rand(...
15d6d676546025f3af10749aa88e210456fd6e659e1f1a654ffc7707f00f4d46
MATLAB
2,206
79
clear clc [file, path] = uigetfile('*.mat','MultiSelect','off');%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 load(datafile) close all w = 2; %window to use (on, sustaneid, off) %% n = fieldnames(clusters.clu...
e04ab0dfe9c2d08363be602c3e6e2d0492f11a859374aadf0ced793cde480d79
MATLAB
2,210
83
%% clear dataset_list = ["leuven", "oxford"]; T_subjectCharacteristics = table; for dataset_counter = 1 : length(dataset_list) dataset = dataset_list(dataset_counter); input_folder = '../data/'; input_file = strcat('data_', dataset, '.csv'); output_folder = '../results/'; if ~exist(output_f...
236c86666720401cc556181b40691cf7b3b2050bbf41ad5b762b642146cf0e5c
MATLAB
2,212
80
% Plots two time-dependent data sets on two axes. Typically made for % primary tumor and metastases function [AX, hPT, hMet] = plot_data_global_conv_unit(... index_postresection,... time_PT,... PT,... time_met,... met,... axisS,... conv_unit_PT,... conv_unit_met,... styleS) if nargin...
8980784788cdaf0e3d0e9e896b0a4e6da93133a5ac31dcb23fc178e41f473d2c
MATLAB
2,212
102
function [regout,CI,pboot,p] = rst_pbCIreg(a,b,nboot,alpha,mu) % function [regout,CI,pboot,p] = pbCIreg(a,b,nboot,alpha,mu) % % Compute a percentile bootstrap confidence interval % of the linear regression outputs using OLS % % INPUTS: % a (vector of predictor) % b (vector of response) % ...
68425e0fd54749483be31f4a56c9547c89bbdb3586d46a28da382275bfa63277
MATLAB
2,213
38
function paths = Choose_Paths(Step_Parameters,Parameters1) % Curve Fitting: fitobject = fit(Step_Parameters.Step_Routes(:,3),Step_Parameters.Step_Routes(:,2),'smoothingspline','SmoothingParam',Parameters1.Auto_Tracing_Parameters.Step_Smoothing_Parameter); % fitobject = fit(Step_Parameters.Step_Routes(:,3)-Step_Par...
ad44f4d126590f563e5926cb0692df00e8619b360a747cbb632953e883af684b
MATLAB
2,214
57
function [unmixData]=sf_unmixing_20xG_3HyD_220823ref(fn) % load xycz image [Data,Scale,dim,metadata]=mnl_Load4Dimage; for i=1:size(Data, 3) Data_ch(i).Data=Data(:,:,i,:); Data_ch(i).Data=squeeze(Data_ch(i).Data); Data_ch(i).Data=double(Data_ch(i).Data); end %% Reference matrises for 20xG 3HyD prot...
569c9d0239ea84a26b5314f90243b87fe76c89c6ae6017a4c2a79083a69cef9c
MATLAB
2,218
69
function test_multi_lead_ecg_viewers % A script for testing different ECG viewer functions % % Usage: % testMultiLeadECGPlotter % % Revision History: % 2023: First release % % Reza Sameni, 2023 % The Open-Source Electrophysiological Toolbox % https://github.com/alphanumericslab/OSET close all clear clc % Define th...
7a37d23dd008fcfb0765f8a7961addf3f119a4ac00453c109341f06ea97d5ef5
MATLAB
2,218
121
function [ellisx,ellisy,rmax,xo,yo]=clust(y,n1,n2,prob,IXi,IYi,in,de); % y=yy, componenti principali % n1=t1, estemità inf asse x % n2=t2, m=mean(y); xo=m(1);yo=m(2); ss=cov(y); s=inv(ss); count=1;ellisx=[];ellisy=[]; %calcolo delle distanze fra i punti rispetto al centroide dell' ellisse j=sqrt(-1); AA=y(:...
fb6038f75e5d6163362e1e310b939c104d22ff6ebe4ecb8c51ec3be934ad03ea
MATLAB
2,218
65
function PV_lightpsth_colored(cellids, impdir, resdir) % PV_LIGHTPSTH_COLORED Population PSTH of light-aligned PSTH. % PV_LIGHTPSTH_COLORED(CELLIDS, IMPDIR, RESDIR) calculates adaptive PSTH % (see DAPSTH) aligned to light pulse onset using all pulses of the most % efficient stimulation frequency. PSTHs are...
5d21d7dc1e3557fe79d0e75d2a2576750ce13e4b0e248d77fce2de45dce34179
MATLAB
2,222
65
%VOT method %Shinjini Kundu (c) 2015 function [ f1t,f2t,f3t,I0_recon,Ierror,flag ] = compVOTGradients( f1,f2,f3,I0,I1,lambda ) %Computes the gradients required in Kundu et al's variation optimization approach %inputs: f1,f2,f3 current deformation fields % I0,I1 original images % ...
820a5767b22b919663468d275d7f85a650eed8dc6e59cf5ac4323e06b472f17f
MATLAB
2,222
65
classdef PoissonIndependentDecoder % Object to perform basic decoding properties tuningAxes; % cell array of tuning axes tuningDims; tuning; % struct array (cells) with tuning field allTuning bias; % sum of all tuning for all cells end meth...
ceec97b917939690e1e63a634464bea9368135786077e6e52cb45c71b7a7a975
MATLAB
2,222
68
function [peaks, peak_indexes] = peak_det_amp_threshold(x, ff, th, varargin) % peak_det_amp_threshold - R-peak detector based on max search and level thresholding % % Syntax: [peaks, peak_indexes] = peak_det_amp_threshold(x, ff, th, varargin) % % Inputs: % x: Vector of input data. % ff: Approximate ECG beat-rate in...
ed47b5d74794443daedd6bd338d1d100434a3bd15b3b3856e8c9ac9cec06222c
MATLAB
2,222
85
function [bin thres mdegree]=threslold_mean_degree(graph,kk) % THRESHOLD_MEAN_DEGREE Mean Degree thresholding % % [bin threshold degree]=threslold_mean_degree(graph,kk) % % This function thresholds the connectivity matrix by absolute weight % magnitude. All weights below the given threshold, and all w...
72098495432179be2126b782080286144b894425c2df5ff024cc92b2291b9214
MATLAB
2,225
42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [pops_PT, pops_met] = simulate_pop_PT_met(... temps_PT,... temps_met,... model_PT_f,... model_met_f,... % suffix 'met' is employed for clarity but should be 'met_PT' as the model and parameters deal wit...
79f7793ac13ea0286c604bc60f0c0b12080144222f2ed0ebe79f699efb75c804
MATLAB
2,227
63
function [Tr_sig, loc] = sig_trend(sig) % % [Tr_sig, loc] = sig_trend(sig) % % ************************************************************************* % * Calculating the trend of a signal using local minima * % ************************************************************************* % % Usage: ...
e1f57538ff008a1beb74db41e287c12558d620b9487229300ea07805c4216836
MATLAB
2,228
86
function c = get_water_content_tour(cmet) marsbar('on'); pp.verbose=0; anat_dir = '/home/romain/data/spectro/tourette/anat'; %suj_dir = get_subdir_regex(anat_dir,'rett') c=cmet; for npol = 1:length(cmet) suj = cmet(npol).suj; for ns = 1:length(suj) sujname = suj{ns}; if findstr(sujname,'_sujet_'...
5354bd6e7e87c4e7cac8412514d429b73d2dd968ff393405b867be4bbbbc1c87
MATLAB
2,229
71
%% calculate Magnitude index %% 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; window_names = {'ON', 'S...
3233cceb31e3583fe8bd7083373ff6b176024549a768700a9e3a3d8a616f3b19
MATLAB
2,231
70
% Solve the RED problem % min 1/(2*sigma_w^2)*\|b-|Ax|\|^2+lambda/2x'*(x-f(x)) where f(x) % is a denoiser % using the solver FASTA. % % Inputs: % A : A matrix or function handle % At : The adjoint/transpose of A % b : A column vector of measurements % x0 : Initial guess of s...
c9fe076f2591bbebbfd6bb80f73b5776b37767642ea91c337e617d1b270950a6
MATLAB
2,231
42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [pops_PT, pops_met] = simulate_pop_PT_met(... temps_PT,... temps_met,... model_PT_f,... model_met_f,... % suffix 'met' is employed for clarity but should be 'met_PT' as the model and parameters deal wit...
1254c336c7601fa44f9ecaa8e50805de58f9ec4e4a8a0aa598b15d394adc1a13
MATLAB
2,232
73
function Image= Test_Image_Color(I) [x,y] = size(I); Image = zeros(x,y,3); for i = 1:x for j = 1:y if I(i,j) == 1 Image(i,j,1) = 0; Image(i,j,2) = 0.4824; Image(i,j,3) = 0.7412; elseif I(i,j) == 2 Image(i,j,1) = 0.8500; Image(i,j...
7a18029624d62f5125862947b52f316526e3c742f730da8442467bc5c8de2688
MATLAB
2,232
60
% Function that make Hierarchichal Cluster % from Matrix Activity % Input % Raster: Matrix Cells x Frames % CAG Threshold: Scalar % Simmilaarity Method : 'hamming', etc % Ouput % R_Analysis Output Strcuture Output function R_Analysis = get_ensembles_manual(R,CAGth,SimMethod) ActiveCells= sum(R,2); % GET ...
c8ffc702f8b406e357efd0fa4803100ff83b9190b8e997861255ec59d35722fc
MATLAB
2,232
62
function sampledWindows = getSpikeWindows(obj, spikes, sites, useRaw, useVolt) %GETSPIKEWINDOWS % input: spikes, a vector of spike indices % input: sites, a vector of site indices % input: useRaw, bool, a flag use raw waveforms if true (else filtered) % input: useVolt, bool, a flag to u...
7b941aa5871cbd80d893bf5389967d96276ce78dab7838ab7a1b19d1842d1dd3
MATLAB
2,235
61
function [dip, p_value, xlow,xup]=HartigansDipSignifTest(xpdf,nboot) % % % function [dip,p_value,xlow,xup]=HartigansDipSignifTest(xpdf,nboot) % % % % calculates Hartigan's DIP statistic and its significance for the empirical p.d.f XPDF (vector of sample values) % % This routine calls the matlab routine 'HartigansD...
8ffcbaa65288275bcd94e18d02c601068d920009a78c443b1ae635c50e538dad
MATLAB
2,235
60
% Script to Load & Process Calcium Fluorescence Signals (ImPatch Experiments) % It detects Calcium Transients from VIDEOS of a single slice (EXPERIMENT) % Sugggested Directorie's Strcuture: % NAME_EXPERIMENT/ {VIDEOS & Coordinates from fSIENN): % Input (same directory): % Coordinates: % ALL (XY).csv Coordinat...
c49452f26b3eb14d183dd0fa03a3d3fb852dcc6ce7c1e4d1338e2f19649381a9
MATLAB
2,236
89
function [diff,CI,p,sig] = rst_pbvar(data1,data2) %[diff,CI,P,SIG] = pbvar(data1,data2) %PBVAR - percentile bootstrap test to compare the variances of 2 %independent groups % 2 tailed bootstrap test based on the estimation of H1, the % hypothesis of an experimental effect. nboot the number of bootstrap % samples = 600....
be9c7634201c8c2f6f430d9040eb4eb2f5c2f7e31fa96b733abca79c1ee09c63
MATLAB
2,238
67
function computeCentroids(obj, updateMe) %COMPUTEPOSITIONS determine cluster position from spike position if nargin < 2 || isempty(obj.clusterCentroids) updateMe = []; end if isempty(updateMe) centroids = zeros(obj.nClusters, 2); clusters_ = 1:obj.nClusters; else % selective...
354b91fcb03ac454982981adef6bfb68c266bfbc00f31e808c77bdb64a442444
MATLAB
2,239
99
function ff = embed(x, mask, varargin) %function ff = embed(x, mask, varargin) %| embed x in nonzero elements of (logical) mask %| in %| x [np (L)] the "nonzero" pixels (lexicographically stacked) %| mask [(Nd)] logical array, np = sum(mask) %| option %| '*dim' {0|1} 0: [(N) (L)] (default); 1: return [(N) *L] %| out...
0e2bcae9a9bdfed56c993ddafbe102c45e5d8ab99bbceb8508a8324056e25250
MATLAB
2,241
42
function matlabbatch = spmup_get_FM_workflow(type) % routine to get the SPM batch workflow for FieldMaps % % FORMAT matlabbatch = get_FM_workflow(type) % % INPUT type can be 'phasediff' or 'phase&mag' % OUTPUT matlabbatch is a structure pre-filled with SPM options % % Cyril Pernet & Remi Gau % -----------------------...
f21f99b39a60f26dde003de8d7673275f16fe8c75e776bea229c53ec61782c73
MATLAB
2,241
55
function success = exportQualityScores(obj, zeroIndex, fGui) %EXPORTQUALITYSCORES Export cluster quality scores to CSV if nargin < 2 zeroIndex = 0; end if nargin < 3 fGui = 0; end ID = (1:obj.nClusters)'; centerSite = obj.clusterSites(:) - double(zeroIndex); nSpikes = ob...
6dc66bc1bff7df2cb782509e3a529457aa790a7449afe067bb7706f8d6136bc7
MATLAB
2,243
74
function [Sig2NoisePeak]=mnl_EvaluateCumulativeSignal2Noise(Noise,Signal,ChanNum) %mnl_EvaluateCumulativeSignal2Noise is designed to evaluate where the %difference is between two different distributions of different sample %sizes. It then plots several graphs to visualise the differences %Inputs % Noise - Single colum...
e7110a93ac035b605824d1a965966355d786023de0931f2f8a19b5d5623d6fdf
MATLAB
2,243
67
function [ lfp_signal ] = ripple_detection_preprocess( data_st ) % Usage: % [ lfp_signal ] = ripple_detection_preprocess( data_st ) % Input: % data_st bipolar signals % Output: % lfp_signal % .lfp_st Signal with power line noise removed by preprocessing % .ripple_st 70-180Hz filte...
a178b6e2a647c2f990f9daa197c5b700fbc8950e52846f7a08c3aecd6ce7546b
MATLAB
2,244
53
function build_database %% Download and import Allen Mouse Brain Connectivity Atlas % 1. Import experiments.csv into MATLAB % 2. Download AMBCA XML files. % 3. Import in MATLAB and save as .mat files. % 4. Define network nodes from injection sites: only structures that are % the injection site in at least one exp...
37b17d9ae2db506904c66c14fc3047f3f448937f17da84720f9342c39a30277e
MATLAB
2,246
85
% test_linear_phase_equalizer_design.m % Design and visualize a linear phase equalizer filter % % Reza Sameni, 2024 % The Open-Source Electrophysiological Toolbox % https://github.com/alphanumericslab/OSET % Context: let's say we have a signal with spectrum S_source(f), which we % want to equalize to a target s...
8dfe0c53bea10871c25e27f615a496199f370d1c20c74e78c5914b231469eacd
MATLAB
2,246
73
% % Test program for Kalman notch filter % % Dependencies: The baseline wander toolbox of the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 1.0, October 2007 % Released under the GNU General Public License % Copyright (C) 2007 Reza Sameni % Sharif University of Technology, Tehran, Iran -- GIPSA-...
0dc4949d56706a0f0bd0e5fd16f42c2d79316a0f52d1987ac7a9f08bcc7b3773
MATLAB
2,248
69
function install(pddir) %INSTALL Install toolbox directories. % INSTALL is an easy to use installation program for toolboxes. % It installs 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 usage: % % ...
729a0d7a42942345eac770396505840a9d504c269abd61c5a63c0bd7bc2e4412
MATLAB
2,251
66
% 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,...
b17b0b225aecfd006ab274501c761518b541fcc3ee8522a245f8e71fa3392787
MATLAB
2,251
66
function [ Thresh, error_subspace ] = Calculate_Alpha( FINAL_FEATS, labels, Curveoption ) %This piece of code runs the PLDA function with different values of alpha %and plots two error curves %The projection metric distance of two consequent subspaces %written originally by Soheil Kolouri, modified by Shinjini Kund...
c2afb1f808e0ada2877e3527bb7a6532179547dc062ade1d169c3aff102c1600
MATLAB
2,251
65
function [onsetsFinal, offsetsFinal] = JT_getOnsetOffset(signal, ampThreshold, minBelowTime, minAboveTime, behFlag) % [onsetsFinal, offsetsFinal] = getOnsetOffset(signal, ampThreshold, minBelowTime, minAboveTime, behFlag) % % Summary: This function determines the indices of onsets and offsets % for a movement bo...
d65bcf739f007a6baaabeda2993ba142e47a94c3d786fc8ffa4b65a2e6b7a453
MATLAB
2,254
86
function plot_AG_sigVals(FS,AG,FRP,NodeName,atlas,options,savepath,save) % before plot_AG_trans_MSPoI_Mikael.m atlas_name = options.atlas{atlas}; fg = 0; for cm = 1:3 fg = fg + 1; fig = figure; CF = AG{cm}; AM_diff = CF(:,:,2) - CF(:,:,1); sig_AG = FS.RES...
7b97f07d59f10b4d004e4aedd00d3c95c342aaafd69f24607a9cd3ff615fb683
MATLAB
2,255
79
function nuisances = spmup_nuisance(fmridata, whitematter, csf) % Routine to compute nuisance regressors from White matter and CSF masks. % Masks are thresholded at 70%, the time series extracted, detrended (2nd % order polynomial) and averaged % % FORMAT: nuisances = spmup_nuisance(fmridata, whitematter, csf) % % IMP...
89dbabd10b265393a6fee8831e1521f0c1d1158a94a40a157fb52bd8956b8c2f
MATLAB
2,255
79
% load aligned cell maps and quantify MSE clear p = params_2DAA; %% load maps for sub = 1:p.nSubjects for ses = 1:p.nSessions thisSub = p.subjects(sub); fpath = fullfile(p.rootDir,'miniscope', ['subject' num2str(thisSub)],['session' num2str(ses)],'extracted','cellMap.mat'); load(fpath) ...
0e200bf3568d7ebbe6cfdcb5414c572b22de453b8d2b09a0108e9e403d18b144
MATLAB
2,256
77
function x = nufft_adj_single(X, st) %|function x = nufft_adj_single(X, st) %| Apply adjoint of d-dimensional NUFFT to spectrum vector(s) X %| in %| X [M,(L)] %| st structure precomputed by nufft_init() %| out %| x [(Nd),(L)] signal(s)/image(s) %| %| Copyright 2003-6-1, Jeff Fessler, University of Michigan % % - Da...
f325fbbdf030946a8a62fc2d0bcc17d316a2c19310af147c1bbab89cf112130b
MATLAB
2,259
129
function c1 = correct_result(c1,c2,field_list,fielnamcor) divide=0; if ~exist('c2') c2=c1; end if ~exist('fielnamcor') fielnamcor = 'cor_all'; end correct_only_with_mean=0; if iscell(c1) for k=1:length(c1) field_list = find_metab_list(fieldnames(c1{k})); c1{k} = correct_result(c1{k},c2,fiel...
51d8fec3b761350370d782ae6875165cf1c8942408f33dd7b1803ec0fc6bf46c
MATLAB
2,264
80
function rasterplot2(times,numtrials,triallen,offset,varargin) nin=nargin; %%%%%%%%%%%%%% Plot variables %%%%%%%%%%%%%% plotwidth=0.01; % spike thickness plotcolor='k'; % spike color trialgap= 1; % distance between trials defaultfs=15000; % default sampling rate showtimescale=1; % display timescale ...
9e2d4e9566584391a6e344788d943eb8fb4ecd37b143c223a1e68848ba8b4cb0
MATLAB
2,264
78
% 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,...
1f55a6f54f6ab66a2a049e8588da4c59690ee1f663ec48b1605cdd3a826f4676
MATLAB
2,265
58
function FRA_analysis_subfields(FRA_file_input, genotype) % Authors: Simon Wadle & Tatjana Schmitt, 2019-2023 % this function sorts FRA parameter on a subfield-specific basis % gets called by 'pipeline_complete_SPLanalysis_awake_FMR1.m' for j = 1:2 if j == 1 [path, name, ext] = fileparts(FRA_file_in...
5fffa0c67a27f72657133e3cb79ba652d9858143fb9ab1b034bbb5ad21e781c7
MATLAB
2,265
48
function success = commit(obj, spikeClusters, metadata, msg) %COMMIT Commit a modification of clustering to history log %% first run parent class commit method success = commit@jrclust.interfaces.Clustering(obj, spikeClusters, metadata, msg); %% then update template similarity scores if success ...
822c27c85730ba9daf767d95ae3c337d0b951701cab72edc6d33fd97aae9c7a8
MATLAB
2,265
107
clear all close all clc load('nn.mat') r_on = scatterplot(results(1,:),results(2,:)); r_on_shuffled = scatterplot(results(1,:),results(3,:)); load('nn_OFF.mat') r_off = scatterplot(results(1,:),results(2,:)); r_off_shuffled = scatterplot(results(1,:),results(3,:)); %% clear all clc %colormap defin...
bec56fb3b6ff7b30bc4f51a4cf0c387ea359bbd35fe239203ce33a192231d3f7
MATLAB
2,266
88
function x = newfft_approx_adj(st, X, om) %function x = newfft_approx_adj(st, X, om) %| %| Adjoint of (approximate) NUFFT %| %| in %| st structure precomputed by nufft_init() %| X [M (L)] %| om [M 1] optional frequency vector (default: st.om) %| %| out %| x [(Nd) (L)] signal(s)/image(s) %| %| Copyright 2003-6-1, Je...
24ba5f4ead1cb7268067cd0d109b67224e0746af8d0623891f799dfaecdf8a0b
MATLAB
2,267
51
function repeat_heatmap %%% gt3‚Ælt2‚Ìdevideƒq[ƒgƒ}ƒbƒv‚̉ðÍ %%% devide‚̃q[ƒgƒ}ƒbƒv‚𕽋ςª1‚É‚È‚é‚æ‚¤‚É•W€‰»‚µ‚Ä‚à‚Æ‚ÌFigure‚ɏ㏑‚«‚·‚éƒvƒƒOƒ‰ƒ€ path = 'C:\Users\C238\Desktop\touchcellLtRt_Hirokane'; savepath = 'C:\Users\C238\Desktop\Rhythm'; patternnum = 1; for i=1:82 %‚»‚ꂼ‚ê‚̍זE‚ŃCƒeƒŒ[ƒVƒ‡ƒ“‚...
e926aea8b837179293f072e38e3b6c819293a95c57f42ea4efb7cb8dc17e1b4e
MATLAB
2,268
88
function [tf, frex] = wavecwt(signal, srate, frange, ncycles, nsteps) % This function performs a highly customizable complex morlet wavelet transform. % Written Tylor J Harlow 9/12/2023 - tylor.harlow@uconn.edu % % adapted from code by Michael X Cohen % "A better way to define and describe Morlet wavelets for ti...
3780d58e97ec1fa869239716967ffc4ecbdfe628c0464741f747871353ce649a
MATLAB
2,269
76
function strval = field2str(val) %FIELD2STR Convert a value to a canonical string representation switch class(val) case {'int', 'int16', 'int32', 'uint16', 'uint32', 'logical'} formatstr = '%d'; case 'double' if numel(val) == 1 && val == floor(val) % integer ...
15cdbe5719076b8d2b5d2d2c8811833da08c003ac1a6f4476ef005f18677c5a1
MATLAB
2,270
68
% ecg_gen_twa Test Script % % This script demonstrates the usage of the ecg_gen_twa function to generate % synthetic ECG signals with T-wave alternans (TWA) using the warping % transformation from the phase domain. % % Revision History: % 2023: First release. % % Reza Sameni, 2023 % The Open-Source Electrophysiologic...
e460ceae431d107dca9d29e8d83b29e181c99c1938e3d38237bcde59745cbd30
MATLAB
2,271
72
%% Script to concatenate Network Features: NetFeat Files % Makes a TABLE of Different and MULTIPLE Network Features %% Setup % Initial: clear; close all; clc; Load_Default_Directories; fprintf('>It merges tables created in Make_Statistics_Gephi_Features in one single table\n') runs=1; % Runs Counter FEATS={...
f09525d1642846101f3b6717a43d7d131f512b6838e1f41f90f9a9b9b383b1e8
MATLAB
2,273
62
% function cluster_combineCoils(reconParsFile) load(reconParsFile) run([RETROMOCOBOX_PATH '/addRetroMoCoBoxToPath.m']); % run([MIRT_PATH '/setup.m']); addpath(SPM_PATH); % parfor doesn't like some stuff... have to make it clear that they are % variables by setting them equal to themselves...! tempGRAPPAreconFile = t...
55fd6a9ba4074627a346160e1f6d4230516eadd6fb7385e90d7aa956c0befdfd
MATLAB
2,274
72
function [tmean,tmCIlo,tmCIhi,df,se,p,Ty] = rst_trimci(x,percent,alpha,out,mu) % function [tm,tmCIlo,tmCIhi,g,se,p,Ty] = trimci(x,percent,alpha,out,mu) % Returns the 1-alpha confidence interval of the trimmed mean. % % INPUTS: % x - vector % percent - percentage of trimming, default = 20 % alp...
f98e6fc0d8b6d2e17d3d4e4ab285154b9f745afcfa1b33c70296fdb48aa2c2d3
MATLAB
2,274
83
% nufft_tune_gauss % tune the FWHM for gaussian interpolation in 1D NUFFT % to minimize the worst-case error if ~isvar('err_gauss') N = 2^8; K_N = 2; % oversampling factor Jlist = [2:16]; Plist = linspace(0.2, 0.4, 101); % sig = parameter * sqrt(J) rlist = [0:20]'/40; % fractions of gamma err_gauss.zn = ze...
bec1fd91024931447d5f6562e77ab6eb7b3d9f721dc6d83607f02c191d104af2
MATLAB
2,275
73
% 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...
22ebce3df7274a834c308c03bbcd80afb8319535ec2b9143bdf030794abc6175
MATLAB
2,278
97
clearvars -except ONimageS OFFimageS refpic Error CC %% Calculate SRsp CC1 = CC;%total; NF=size(ONimageS,1); rep = size(ONimageS,2); currRsp = zeros(CC1.NumObjects,NF,rep); for ci=1:CC1.NumObjects bw5=zeros(512,512); bw6=zeros(512,512); area = mean(refpic(CC1.PixelIdxList{ci})); ...
8a42e2dee10fc94708800c69c31f73d0cbeccaa74eb1b9ffdc0bc992e4b77637
MATLAB
2,278
88
function [energy,min_dist] = point_set_energy_dist(points,s) %POINT_SET_ENERGY_DIST Energy and minimum distance of a point set % %Syntax % [energy,min_dist] = point_set_energy_dist(points,s); % %Description % [ENERGY,MIN_DIST] = POINT_SET_ENERGY_DIST(POINTS,s) sets ENERGY to be the % energy of the r^(-s) potential on t...
bb37913567be1cf3e04408384fb531ce5b5d166a52bfd605fa87cb3decee6b2f
MATLAB
2,278
48
% 计算Label图片中各类矿物组分的占比 clc clear pixel_num = zeros(1,14); x = 224; y = 224; InputPicBG = 'E:\SemanticSegmentation_Scale\NET_Muli_CPL_XPL_All\Revolve_Pxds_Test\*.png';% 背景原图的存放位置里的tif文件 InputPicPath = 'E:\SemanticSegmentation_Scale\NET_Muli_CPL_XPL_All\Revolve_Pxds_Test\';% 背景原图的存放位置 FilePic=dir(InputPicBG);% 找到文...
670e8c550a0e88be60c326e029b0cf81acb6f11fa67555be0856eb9677bd529e
MATLAB
2,283
55
function [xd yd delta deltaCI] = rst_shifthd(x,y,nboot,plotshift) % [xd yd delta deltaCI] = shifthd(x,y,nboot,plotshift) % SHIFTHD computes the 95% simultaneous confidence intervals % for the difference between the deciles of two independent groups % using the Harrell-Davis estimate % See Wilcox p.151-155 % % GAR, U...
b031d07b2def8178d4cddd8e11665b41f4419fc91a83fa3e55222847c499f024
MATLAB
2,283
53
% Function to extract network parameters from tables % function [TotalTable,DATAnet]=TableNetwork(ExsitFeature,GEPHIDATA,EXPLIST,Names_Conditions,ActualFeature) TotalTable=table; DATAnet={}; % ALLpreActive=cell(NE,NC); fprintf('>>Reading data for table: \n') n=1; while sum(ExsitFeature(:))>0 % No empty Table i...
8fb3e7c37febcc9d6c70932897ed167dcc9f6287643bb0e22135cec77f14426f
MATLAB
2,284
49
% TrimmedFilter has been deprecated. Use trimmed_filter.cpp instead. error('TrimmedFilter has been deprecated. Use trimmed_filter.cpp instead.'); % y = TrimmedFilter(x,type,L,k,h), % y = TrimmedFilter(x,type,L,k,l,h), % % A moving average, median, or trimmed mean filter. % % inputs: % x: input vector....
05d32b56fabba2521630fcae7a90d17d1dc16a63cf2d9bed2717bc1f4db8a6a2
MATLAB
2,285
74
function perturb_hopf_noisebynode_MCS(node) load Modelling_Workspace_MCS.mat PERTURB=0:-0.02:-0.2; % Noise protocol. we= 0.07; %% Insert here G value from optimal MCS model fitting ITER=10; N=214; a=-0.02*ones(N,2); C=squeeze(Coptim(find(abs(WE-we)<0.0001),:,:)); TSmax=295; NSUB=29; TR=2; % Repetiti...
2c206069770f26db5a49e3acd064d66df0d434d1b7e4b4f91cc15301ec77bd9a
MATLAB
2,285
66
function derived_bp_signals(app) sys_idx = nan; dia_idx = nan; mea_idx = nan; tmp = nan(1,length(app.data)); for i = 1: length(app.data) tmp(i) = app.data(i).tic_multipl; if strcmp (app.data(i).name,'systolic BP') sys_idx = i; end if strcmp (app.data(i).name, 'diastolic BP') dia_idx = ...
50af04818bc18fff44af50d941f6836f9ac672a06e09718ed708b1c2cee43c54
MATLAB
2,285
73
function [OutFeature,ndiff] = RaguMSFeatures(MSClass,n,MSFit,gfp,NoCenter) % Copyright 2009-2011 Thomas Koenig % distributed under the terms of the GNU AFFERO General Public License OutFeature = nan(size(MSClass,1),size(MSClass,2),n,6); on = nan(size(MSClass,1),size(MSClass,2),n); off = nan(size(MSClass,1),size(MS...
093b6092ba2fc7fb36365174cb36bde3547b21a06516d692bcb5cc4c10bf6b51
MATLAB
2,286
82
function coeff = point_set_energy_coeff(points,s) %POINT_SET_ENERGY_COEFF Coefficient in expansion of energy of a point set % %Syntax % coeff = point_set_energy_coeff(points,s); % %Description % COEFF = POINT_SET_ENERGY_COEFF(POINTS,s) does the following: % 1) finds the r^(-s) energy of the point set POINTS, and % 2) ...
2f1ad85d71948290b6e3999a4f9eb01aaa59ba96654fdddaa401b6bda7cf5839
MATLAB
2,286
56
function [gam_grid_both, shuffle_both]=pyGAM_int_2models_shuffle(y_array_bvd,X_arrayboth_vel,x2shuffle,np,lams,shift,shuffle_number) % pyGAM_int_2models_shuffle performs GAM analysis with shuffling for interaction models. % This function fits GAM models, shuffles specific predictor columns, % and evaluat...
fc668dad475bf9c0dd36492b52173210a53673b0a2ea885500d940f6d44f4925
MATLAB
2,286
67
function derived_bp_signals(app) sys_idx = nan; dia_idx = nan; mea_idx = nan; tmp = nan(1,length(app.data)); for i = 1: length(app.data) tmp(i) = app.data(i).tic_multipl; if strcmp (app.data(i).name,'systolic BP') sys_idx = i; end if strcmp (app.data(i).name, 'diastolic BP') dia_idx = ...
43af71b358daa028877759608f51c1366d23060a7a020ea93bdc6881702cea52
MATLAB
2,287
70
clear all, close all % load time_data.mat load time_measures_NaCl.mat load time_data_NaCl.mat %% Plot of the time oscillation, Na f = figure(2); f.Position = [520 20 400 850]; f.Color = [1 1 1]; t = tiledlayout(4,1,"TileSpacing","loose","Padding","loose"); % 0 Hz ax1 = nexttile; plot(NaCl_80mM.Time(1:3:e...
adc6d200fb702437f3f9d7093eb43a3d3486e264f57ac4b410f3be3df3ea4545
MATLAB
2,288
68
% % Test program for generating single-channel ECGs with additive colored % noise % % Dependencies: The synthetic ECG generator and noise generator package of % the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 1.0, November 2006 % Released under the GNU General Public License % Copyright (C) ...
13d197d0ced8add75e1c0393de7c69e36c065625315d64245ac8b4e94d55a7d4
MATLAB
2,293
59
clear; close all; % Synthetic maternal parameters params{1}.mean = []; params{1}.std = []; params{2}.mean = []; params{2}.std = []; params{3}.mean = []; params{3}.std = []; params{1}.theta = [-1.09 -0.83 -0.19 -.07 0 .06 0.22 1.2 1.42 1.68]; params{1}.a = [0.03 .08 -0.13 .85...
ec690e04555c27baa08ceccb18743ce1c41027ef634eb0043eab57350a351485
MATLAB
2,293
81
function base_path = getMyBasePath(file_name,varargin) %getMyPath Returns base path of calling function % % base_path = sl.stack.getMyBasePath(*file_name,varargin) % % Outputs: % -------- % base_path : path to cotaining folder of function that is calling % this function. % % Inputs: % ------- % fil...
7f64327328ef5037ad4d5c8f46f7024d1e534123b6bf2f57a9343dd5859830b9
MATLAB
2,294
74
function [grnnet] = load_grn_network(path_dream5,NETWORK,varargin); % LOAD_GRN_NETWORK Load gene regulatory network of the DREAM5 challenge. % GRNNET = LOAD_GRN_NETWORK(PATH_DREAM5,NETWORK) for path PATH_DREAM5 and index NETWORK returns % % GRNNET.x gene expression levels (#genes-by-#samples) % ...