sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8c808cb25702a6871749df56286597ee44cb7e55fe0ad31d3acf38ef69838e15
MATLAB
1,653
39
% *** NO IDEA WHAT THIS IS USED FOR. SUGGEST TO REMOVE. % -BRC 9/26/2013 *** % Copyright Benjamin Cowley, Matthew Kaufman, Zachary Butler, Byron Yu, 2012-2013 % ---GNU General Public License Copyright--- % This file is part of DataHigh. % % DataHigh is free software: you can redistribute it and/or modify % it un...
0ca5d857b83fb6a1c4bfd036431d0ce64ece92b6c875e72f3332570b1e3d451e
MATLAB
1,654
50
function res = runtests() close all; clear; res = struct(); import matlab.unittest.TestSuite import matlab.unittest.TestRunner import matlab.unittest.plugins.CodeCoveragePlugin tr = TestRunner.withTextOutput; tr.addPlugin(CodeCoveragePlugin.forPackage('jrclust')); tr.addPlugin(CodeCove...
b0bd18357f046c57b6f054305fe6b1cf060be19d5eb105f24ac0b7e398d754a9
MATLAB
1,654
42
function updateCursorFigWav(obj) %UPDATECURSORFIGWAV Plot mean waveforms on top of selected cluster(s) if isempty(obj.selected) || ~obj.hasFig('FigWav') return; end hFigWav = obj.hFigs('FigWav'); plotSelectedMeansFun = @(x,y)plotSelectedMeans(hFigWav, obj.hClust, x, y, obj.maxAmp, obj.hCfg, ...
65031ee4472e005d668a07be22c40393df2ac060bec0fc72f6559e9a51fcfebe
MATLAB
1,658
42
%% Place decoding load ensemble_sample_data.mat accuracytotal=nan([size(all_sessionsfloor_iteration,3) size(all_sessionsfloor_iteration,2)]); for ii=1:size(all_sessionsfloor_iteration,3) parfor jj=1:size(all_sessionsfloor_iteration,2) [trainedClassifier, validationAccuracy] = trainClassifierfloor(all_se...
70a4667f57e700ec8b4206bed22178992454ad35e30bcebab1c380b824c5718a
MATLAB
1,659
72
function plot_s_fr(session, channel, unit, fold, trials_type) % Plot response firting rate of specific s-model for given trial % % Parameters % ---------- % % - fold: integer scalar % Fold number % - trials_type: char vector | scalar % Trials type or trial index info = get_info(); times = info.times; s = 5; % sca...
fd4f4a8389b16aea41d7684f9eb7d411a563940858926c3b4ed52e945f11e5eb
MATLAB
1,662
64
function [M,MList]= OrthogContrasts(nTreats) % Generates coefficients corresponding to one particular set of % orthogonal contrasts for a set of variables % % FORMAT % [contrasts, names]= limo_OrthogContrasts([2 2]) % % INPUT % nTreats is a vector with the levels of the various factors in an ANOVA % % OUTPUT % M is a ...
be281dc24772d78b16ceaf2f1c3dbc76b4704947453f3cf8d0378ddf107ed75c
MATLAB
1,665
46
classdef HTMLGenerator %HTMLGENERATOR A class for generating HTML files % % This class generates HTML elements for reporting results % % Reza Sameni, Sep 2020 % The open-source electrophysiological toolbox (OSET) % www.oset.ir % properties fid % file ID end met...
e9ddaab3da25c6ab5f1b887b73a816f66145a057039121b3676d66b7d85641f6
MATLAB
1,665
40
%% plot [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 w = 2;% window for ploting (2 = sustaneid) %% for i = 1:length(datafile) load(datafile{1...
f2918681ad1874cea168bc85816ee92112346bf7772c1b5d45faa391816eab61
MATLAB
1,665
63
% Figure 3a top panel: UCL x1CL = readmatrix('Fig3_UCL_CL_template_x1.csv'); y1CL = readmatrix('Fig3_UCL_CL_template_y1.csv'); x2CL = readmatrix('Fig3_UCL_CL_meanEEG_x2.csv'); y2CL = readmatrix('Fig3_UCL_CL_meanEEG_y2.csv'); x1HL = readmatrix('Fig3_UCL_HL_template_x1.csv'); y1HL = readmatrix('Fig3_UCL_HL_template_y...
465a4963e90ef205e2920f7ce1454ae3c9df02cc7a48f8155334db566a5c0e15
MATLAB
1,666
62
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % createrawfile.m % % PGH Oct 2003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y=createrawfile(metabname,fid,cenfreq,np,dw,rp,lp,TRAMP,VOLUME) [p f e] = fileparts(metabname) ...
5294dca31b1d8133767f3849840d89fdc30bb18a2b422ff61654f7d5a119be31
MATLAB
1,667
42
function [ind, xcore] = ChannelIndex11(x,fs,f0) % [ind xcore] = ChannelIndex11(x,fs,f0) % Channel saturation and sine wave modulation detector % Inputs: % x : input data matrix % fs : input sampling frequency % f0 : desired sine (or square) wave frequency (approximate value is ok, e.g., f0 = 4) % Outputs: ...
fe7dae9138ee42da39057cf1a4e402154066c20f421dbae680a502890d18d269
MATLAB
1,667
78
function TouchSensorOffLine clear all;close all; % load 11501_150807V.mat -ASCII; load 11701_150807V.mat -ASCII;A=X11701_150807V;%A % load 11701_150826V.mat -ASCII;A=X11701_150826V;%B % A=X11701_150807V; % A=X11701_150826V; Len=length(A(1,:)); MovingAverage=2;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
1988277f1dade3698382972dd8dd537cc4f9f833460ed21b568a9a165638abc7
MATLAB
1,671
79
function ob = fatrix2_setup_dim(ob) %function ob = fatrix2_setup_dim(ob) %| %| Set up idim and odim etc. %| %| Copyright 2010-12-17, Jeff Fessler, University of Michigan arg = ob.arg; % this shall not be modified if isempty(ob.imask) && isfield(arg, 'mask') ob.imask = arg.mask; end % input mask (rhs) if isempty(...
b938f690e86d7a4ff5fc9000af69162a902628c7c0e8100dfc680c4c782b9192
MATLAB
1,671
60
function [h,p, chi2stat,df] = prop_test(X , N, correct) % [h,p, chi2stat,df] = prop_test(X , N, correct) % % A simple Chi-square test to compare two proportions % It is a 2 sided test with alpha=0.05 % % Input: % X = vector with number of success for each sample (e.g. [20 22]) % N = vector of total counts for each sam...
26357cfc8f31c3bfa6505c6a75daa86f692dee709598b1e99eb2e4af26fd6f9b
MATLAB
1,672
57
% Plot Raster Sorted by Activity Rate: % Retieve Variable: >>IndexesbySubgroups, sorted by: % Inhibited % Depressed % Unchanged % Facilitated % Activated % Input % R_Condition: Cell of ACtivity Matrices % Condition_Names: Cell of Condition Strings % fs: Sampling Frequency % Condition to Compar...
6d8810a23bed2b8e904dec1583e0670fdc4e0a4b54a7f629e98b1048d208989c
MATLAB
1,674
78
% Kalman filter of epilepsy signals sample entropy clear all close all % Data Sampling Rate: 256 Hz fs=256; % Read epilepsy signals % Channel 5: FP1-F3;channel 6:F3-C3;channel 7:C3-P3;channel 8:P3-O1 [hdr, record] = edfread('original\chb01_03.edf'); EEG1=record(5,:); % EEG1=record(6,:); % EEG1=record(7...
bd07db3d30839e686d3900d5ae466e0f7ec7a409961613cdab3b3bfef0721231
MATLAB
1,674
58
%{ ---------------------------------------------------------------------------- %Stimulus bias changes by block %Just model analysis %Based on Rao 2010 Front Comp Neurosci %Value updating + Prior updating ---------------------------------------------------------------------------- %} function FigureS1c_Dual_M...
7b10e0b066504becd4e07199d781ff50629c2c54899b76465966cf4b8430f7c1
MATLAB
1,675
58
%% write a bijection between neuron index and corrdinate % In each HC, we assume that there are 54*54 E neurons and 31*31 I neurons % Inut: % N_HC: number of HC on each line % Nn_Ind: index of neuron, in certain range % Nn_Type: 'e' or 'i' % varargin: [n_E_HC,n_I_HC], if appicable % Output: % Nn_X,...
cfa7a49e4575bd9f1ff48d9347d7ecab33f30fd61d42c997df63a3e246c56103
MATLAB
1,675
77
function clear_axis(app) cla(app.ax_msna_raw) cla(app.ax_burst_interval_his) cla(app.ax_burst_duration_his) cla(app.ax_burst_amplitude_his) cla(app.ax_burst_integral_his) cla(app.ax_burst_res) cla(app.ax_msna_int) cla(app.ax_1st_phase) cla(app.ax_last_hist) cla(app.ax_all_hist) cla(app.ax_spike_msna) cla(app.ax_last_p...
d79407bae8cfce766bdfc164cf54424e7be300b607fc648762aa3319200de279
MATLAB
1,675
76
ga_file = '/home/romain/data/spectro/PROTO_SPECTRO_DYST/LCmodel/Basis_set/MEGA2/GABA_E3_Fantome_N128.RAW'; f = read_raw(ga_file) f = zero_filling(f,8); ppm_g1 = 3.1009; ppm_g2 = 2.9488; ppm_center = 4.7; SW_p = f.spectrum.SW_p; % spectral width in ppm np = f.spectrum.np; % number of points dh = f....
e9aa679bd0e7a308536f83cfa0954eac6eec55b03def3d633f849777d960e9e1
MATLAB
1,675
52
%% Latecy of responsive locusts to hex and iaa in 4 training %obtained using python script in the same folder %iaa % {'hexon': [355, 136, 97, 178, 102, 80, 117, 147, 187, 141, 193, 83, 188], % 'hexoff_05s': [176, 151, 143, 124, 229, 274, 180, 135, 183, 206, 264, 265], % 'bzaon': [112, 166, 83, 211, 150, 122, 10...
5b2495fce59f73783ae47b3de45cd84b8b2e961a6fb1c82ad09e985d3606b8f6
MATLAB
1,677
41
function [a, b, c, cPrime, pValueA, pValueB, pValueC, pValueCPrime] = mixedEffectsMediationAnalysis(X, M, Y, GroupID) % Reshape the matrices X, M, Y into long format and prepare the GroupID vector accordingly. % Number of observations and groups [n, m] = size(X); % Reshape data into long...
b4b5d07ceaaa597e6e7b5d76543a9e93b421e963c9a56e24d71cb9ad29c38bb0
MATLAB
1,678
32
function [Fit_Object,Vxyz,Vxyz_Distances,ArcLength,Vt] = Fit_And_Sample(XYZ,Res,Vt) Fit_Object = cscvn(XYZ'); % Fit a cubic spline. % Fit_Object = csaps(XYZ(:,1)',XYZ(:,2)'); % Find the arc-length: Step_Length_Estimate = mean(diff(Fit_Object.breaks)); if(nargin == 2) Vt = linspace(Fit_Object.breaks(1),Fit_...
4fbec2b8818cf3dbea6e5649624a34ddc7f24d7f4e3dd5551becaf72b8b84a7b
MATLAB
1,679
43
function [layers, loss] = initder_dir_coord_inv(layers) activ = zeros(size(layers{1}.a)); pixels_num = size(layers{1}.d, 4); selfprod = sum(sum(layers{1}.d.^2)); if (selfprod < layers{1}.eps) layers{1}.a = zeros(size(layers{1}.a)); loss = 0; return; end; loss = 0; norm_shift = sqrt(pixels_num); products_shift = s...
8d6b9bb7b318db2604c7f106252a18d57584102df6b5fbf307535dc07cf1cc93
MATLAB
1,680
55
function hFigPSD = plotFigPSD(hFigPSD, tracesFilt, hCfg) %PLOTFIGPSD Plot power spectrum density figure nSmooth = 3; ignoreSites = hCfg.ignoreSites; sampleRate = hCfg.sampleRate/hCfg.nSkip; %warning off; tracesFilt = fft(tracesFilt'); tracesFilt = real(tracesFilt .* conj(tracesFilt)) / siz...
ae336b752ca5100e5430dd36f94359a35a9891f6ef8b4f6f6c23827092b82b80
MATLAB
1,680
42
%% plot% [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 w = 2;% window for ploting (2 = sustaneid) %% for i = 1:length(datafile) load(datafile{...
4819c9295b1800b8d8957214d89376edfc9f42491ee1ff0ad11e8d44a2c5413a
MATLAB
1,681
54
function [dataTable,echoTable,opts] = readECHTLog(filename,strcmd) % [dataTable,echoTable] = readECHTLog(filename,strcmd) % % Parses the ECHT .csv log file into two different MATLAB tables, % "dataTable" and "echoTable". % % readECHTLog properly assigns variable names and types to the correct % columns based on the !st...
67a0b67e5acd0f923c16699aed8fd165fe3267fadd1e46b191d510a5e51fa3d0
MATLAB
1,681
40
function [] = createMoveEvt(mouserec,onSet,offSet,type) %Generate .mov.evt file for Neuroscope %Created By: Pratik Mistry %Edited By: Anya Krok % % [] = createMoveEvt(mouserec,onSet,offSet,type) % % INPUT % 'mouserec' - name of in vivo recording, to be used to name .mov.evt file % 'onSet' - vector of event...
41f0e1d4ad42bff0c701154fbbb7552e51209abea2f69e9ccba57c6dcbf59e86
MATLAB
1,682
51
%% Reproduce Fig. 1f from deposited dataset % David Wolf, 11/2023 % %% load dataset clear; clc; load('C:\Users\David\Documents\GitHub\OXT-Wolf\data\Fig1_AON_data_smooth.mat'); % for plotting (but not statistical inference) of the Euclidean distance from baseline, the population vectors were smoothed with a sliding wi...
a05d1c0addd4bf562319c1734aa5330111f470453b3f5765676f01a73066e35f
MATLAB
1,682
52
function matsuda20190423 cd('C:\Users\C238\Desktop\CheetahData\2019-3-13_12-19-0 15101-04'); dpath=('C:\Users\C238\Desktop\CheetahData\2019-3-13_12-19-0 15101-04\'); dpath3=('C:\Users\C238\Desktop\CheetahData\2019-3-13_12-19-0 15101-04'); % data=load([dpath '15103_190313_98__'],'-ascii'); dpath3 load 15103_190313...
729200b5387866896202a47a41d8c80a12c5ae731199cb44e39210c3edda8faf
MATLAB
1,683
53
% Process the FatNavs and export motion parameters in the coordinate frame % of the host sequence acquisition - useful for using alternative to % retroMoCoBox for the MoCo processing % These paths need to match your installation: run('~/retroMoCoBox/addRetroMoCoBoxToPath.m') addpath /cubric/software/spm.versions/spm12...
4e9fe6573a1963add45e5b6ae42615803819148b7293c68bb6d3c7344b87158a
MATLAB
1,684
57
function [index, rank] = sqi_zero_crossing(x, varargin) % sqi_zero_crossing - Signal quality index based on the percentage of zero-crossings. % % Usage: % [index, rank] = sqi_zero_crossing(x, remove_mean) % % Inputs: % x: Input signal matrix with dimensions [L1, L2] % remove_mean: Optional arguments for r...
473c931d5c21aef11f22e5e1d7f95c016ee06be76b891053da474b1c1d93a20b
MATLAB
1,686
56
clear close all clc fs = 1000; spectral_window = 3.0; spectral_overlap = 2.75; spectral_len = round(spectral_window*fs); ecg1 = load('SampleECG1kHz1.mat'); ecg1 = ecg1.data; ecg1 = ecg1 - mean(ecg1); Sx = pwelch(ecg1, hamming(spectral_len), round(spectral_overlap*fs),spectral_len, fs, 'twosided'); ecg2 = load('Sampl...
4a9441c98f59142f2d83c389410019baf6e0c9e097fff016f5782f134d4e0712
MATLAB
1,686
43
function [pc1, pc2, pc3] = pcFeaturesBySpike(obj, spikes, sites) %PCFEATURESBYSPIKE Get template PC features for selected spikes [pc2, pc3] = deal([]); nSites = numel(sites); nSpikes = numel(spikes); pc1 = zeros(nSites, nSpikes); if nargout > 1 pc2 = zeros(nSites, nSpikes); elseif ...
dfde03b1bbd75deb8f4a6d8b9b99427c6af3186204d97b077b3fca45aaeda2bc
MATLAB
1,686
44
function updateCursorFigSim(obj) %UPDATECURSORFIGSIM Update the crosshair cursor in FigSim if isempty(obj.selected) || ~obj.hasFig('FigSim') return; end iCluster = obj.selected(1); if numel(obj.selected) == 1 jCluster = iCluster; else jCluster = obj.selected(2); end ...
2dcaa83b2d0dc42dc9c0e8184d0eca1e620e4f4c597dc8d07acd82647c4aa102
MATLAB
1,689
62
classdef (Hidden) test_SDK % % Class: % adi.test_SDK % % Run as: % adi.test_SDK.run_tests properties end methods (Static) function run_tests() % % % adi.test_SDK.run_tests % % See Also: ...
84a7a36827c8609251bce3d9622f18e5a2f36748924f1f5a8d4b2b7f77880551
MATLAB
1,689
43
function SpikeForm % ScNumbers‚Í‘S×–E”H4×–E‚̏ꍇ‚Í3D % CellNumbers‚͍זE”ԍ†A1,2,3,4...A‚½‚¾‚µA0‚à‚ ‚éB‚ǂ̍זE‚É‚àŠY“–‚µ‚È‚¢‹L˜^iHj % DataPoints‚Ì1ŽŸŒ³–Ú‚Í32“_‚Ì“dˆÊA2ŽŸŒ³–ڂ̓eƒgƒ[ƒh‚̃`ƒƒƒlƒ‹A3ŽŸŒ³–Ú‚Í‚»‚ꂼ‚ê‚̃XƒpƒCƒNiModeArray‚ÅŽw’肵‚½‚à‚́j clear all;close all; Filename='G:\CheetahWRLV2...
1a1b9a77624cbd1661eb9d72d1f03afc23ad6ddbd4e822511632db25e0135a99
MATLAB
1,691
40
function [ang_vel] = HeadSpeed(TrackingData, f, gaus_kernel) % Calculate angular velocity of head movements % Input: % TrackingData - Struct containing tracking data including quaternion values % f - Sampling rate in seconds % gaus_kernel - true if smoothing with Gaussian kernel % Outp...
f3ceb1f0faada1026637351736e21394f339a05edbe7494354ae13d8d6d347be
MATLAB
1,691
57
function x = dtft2_adj(X, omega, N1, N2, n_shift, useloop) %function x = dtft2_adj(X, omega, N1, N2, n_shift, useloop) % Compute adjoint of 2D DTFT for spectrum X at frequency locations omega % In % X [M,L] 2D DTFT values % omega [M,2] frequency locations (radians) % n_shift [2,1] use [0:N-1]-n_shift (default [0 0]...
37bb8bf5f80a6cd8db9649ac5cc7b89b22cb90b88f0c6ecd275febe8273cf2b4
MATLAB
1,692
45
%% original % responsive locusts taken from python %odor in each row is hex, bza, cit, iaa for all 10 conditions % # conditions = ['hexon','bzaon','citon','iaaon','hexoff_05s','hexoff_2s',... % 'hexoff_4s','bzaoff_05s','bzaoff_2s','bzaoff_4s'] responsives = [[0.63157895, 0. , 0.05263158, 0.68421053], [0...
456dad3407122804c211b78c8e949ef09d3277254ccc5dc0ba2d780866e3eeff
MATLAB
1,692
52
function [ accs, dec_dims ] = ae_iterative_removal(p,t_pool_av,t_pool_err,n_rep,n_iter,rand_control,precomputed_dims,time_dependent,n_tr,tone_idx) % predetermine random dims to remove if rand_control n_dims = size(t_pool_av,1); rand_dim = rand(1,n_dims)*2-1; rand_dim = rand_dim/norm(ran...
9858b9db04065119a33dfdf408f43c9b6e86e1e2927df0ac4939f068acac0805
MATLAB
1,693
62
classdef (Hidden) channel_writer % % Class: % adi.channel_writer % % This class facilities writing a channel to the binary file format. % More details can be found in adi.binary_file_writer % % See Also: % adi.binary_file_writer %{ Each channel heade...
3fdb589982fca6089126e481fffcaae7415fbda108f3c682bf24a0b55c7bae03
MATLAB
1,695
56
%% compare PSTH responses using diff state criteria fileNames = {'PSTHdata_wCellTypes.mat';... 'PSTHdata_strict.mat';... 'PSTHdata_cp.mat'}; plotTitles = {'original'; 'strict'; 'changepoints'}; %% loop through filenaames for ifile = 1:numel(fileNames) clear stat run % load data load(fil...
3e24531aa7383ccec68dbe91f5a537d6441a1944a1abcdcebc5824b9cbd2e063
MATLAB
1,696
82
%Kalman filter of logistic map signals entropy clear all close all % Data Sampling Rate: 100 Hz fs = 100; % Generate logistic map signals r = 3.9; x0 = 0.5; n = 1000; noise_length = 50000; x = zeros(1, n + noise_length); x(1) = x0; for i = 2:(n + noise_length) x(i) = r * x(i-1) * (1 - x(i-1));...
88178e0cf669fbe20bc9201dae17e3735424b46e6d9f1618f328d7cddab6bb53
MATLAB
1,696
43
% ****THIS FUNCTION IS PROBABLY NOT USED. SUGGEST TO REMOVE. % -BRC 9/26/2013 **** % Copyright Benjamin Cowley, Matthew Kaufman, Zachary Butler, Byron Yu, 2012-2013 % ---GNU General Public License Copyright--- % This file is part of DataHigh. % % DataHigh is free software: you can redistribute it and/or modify % ...
f7358b8283dc44e0c012828b9f45d38bd551f07e6cae5072382a15c97e002fad
MATLAB
1,696
53
function morphology_aligner(stacked_events, reference_event, delta) % test VCG loop alignment % UNDER TEST % Reza Sameni, 2005 tau = -delta:delta; num_channels = size(stacked_events, 1); num_events = size(stacked_events, 2); event_len = size(stacked_events, 3); %//////////////////////////////////////////////////////...
c73ec8908bbd9ba848f23168d2ff66c8fc76d964b67d82dad590ec84137c5daf
MATLAB
1,697
64
function [maxTIMES1, maxTIMES1id,maxAUC1, maxAUC1st] = peaksearchCBVresponses2(CBVresponse1, ROIname, timedur, stim) % This program is intended to search location peak of the CBV signal. % % input: % CBVresponse1 % CBVresponse2 % ROIname % resultpath: where you can save .png files/ % colors: colors of plots...
56586f1d99ece299dd266778c10ac0ee0a128b58be1aaf587b7b31e1142866f3
MATLAB
1,698
59
function [y, p] = polynomial_fit(x, fs, N, varargin) % Polynomial fit over a signal segment using least square or % pseudo-inversion % % [y, p] = polynomial_fit(x, fs, N, method) % % Inputs: % x: the (noisy) input signal % fs: sampling frequency % N: polynomial order (>= 1) % method: optional argume...
c24dbc4b8bbf5ed173a5df85407e9b3b47a9e9ff29d45d3cc080359ca970af7c
MATLAB
1,698
74
%% create all channels LFP %LFP STATSITICS clc clear %% load all files [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save path %% %in case of selcting only one file ...
4a3e24ffef26fa205ea2557229ad82723c8df23b589491edfa5e5869d767ad8f
MATLAB
1,699
58
function update_wavelet_axis(app) cla(app.ax_wavelet_sig1) cla(app.ax_wavelet_sig2) cla(app.ax_xwt1) cla(app.ax_xwt2) cla(app.ax_xwt3) channel_idx = find(strcmp(app.popup_signal1.Value,app.popup_signal_spect.Items)); [data,ts,name1, unit1] = current_signal(app, channel_idx); data1(:,1) = ts(1):ts(1):ts(2); data1(:,2)...
ccb67ee3c48b737c3f800f86e59d0afaece6f2de0f1f44d85654f55ddd6615e9
MATLAB
1,699
46
% rerun preprocessing without lowpass filter for an example session % sub = 11 (thisSub = 13) % ses = 1 % we can reuse the regCoords clear p = params_2DAA; moviePath = '\\DROBO6\Public\E7_miniscope_concat\M13\Session1\rawMovie.h5'; saveDir = 'G:\E7_2DAA\results'; regPath = 'G:\E7_2DA...
1863d70b2da614f066c700e9cdbdad21b3a8552b3df6c5cc2db06f325587c975
MATLAB
1,701
60
function [clust_num temp auto_sort] = find_temp(tree,clu,par) %,spikes,ipermut) min_clus = par.min_clus; c_ov = par.c_ov; elbow_min = par.elbow_min; clu = clu(1:end-1,3:end)+1; %first dim temp y = tree(1:end,5); maxdiff = max(diff(tree(1:end,6:end)),[],2); maxdiff(maxdiff<0)=0; prop = (y(2:end)+maxdiff.*(maxdiff>0)...
32ff2f93e531c8b257cf478eb63827cff0b4dcc4f5bfb52c19a651ddd0cebe99
MATLAB
1,701
72
function [l, coords] = read_label(sname, lname) % [l, coords] = read_label(<sname>, lname) % % reads the label file 'lname' from the subject 'sname' % in the subject's label directory into the vector l % l will be nvertices-by-5, where each column means: % (1) vertex number, (2-4) xyz at each vertex, (5) stat % % coor...
745c84584ca2496e79aa85c7c7112c4b004394c2235c7322d856e6e4b40937a7
MATLAB
1,702
83
function [r_path, r_cost] = dijkstra(pathS, pathE, transmat) % The Dijkstra's algorithm, Implemented by Yi Wang, 2005 % This version support detecting _cyclic-paths_ % % pathS : the index of start node, indexing from 1 % pathE : the index of end node, indexing from 1 % transmat: the transition matrix, or adja...
ddf3c4f36a627141e4b3465e5981b2e87fc0b15f22c5a201a89786c4f7a6a35c
MATLAB
1,702
49
%% Load all of the files you want to plot and change the "name" variable close all fs = 15000; %sampling rate (Hz) spk_count=[]; duration = 40; %trial duration bin_duration = 0.2; n_bins = duration / bin_duration; bin_size = bin_duration * fs; name= hex_ser; % call the name of a file you want to plot peak_loc...
8c612112f9549c5ec7e52d4ee301ebe9455a44df821dcb495d66965755ad14b9
MATLAB
1,703
49
function [acc,weights] = get_tone_decoding_acc(tone_pool, n_tr, n_rep) %% decode tone vs iti for all tone time steps individually acc = []; weights = []; for rep = 1:n_rep % run decoding for all times steps for t = 1:size(tone_pool,2) % for tone sample tria...
4e6490b1e24aead37fe3539695893af10c282483267654ca753217b2d68fdd7a
MATLAB
1,704
49
clear clc [file, path] = uigetfile('clusters.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 %% int_colores = {'c','k', 'm', 'r', 'g', 'y', 'b'}; for w = 1:si...
18876254b42f857c7f4ad4a39e645fd8b17b961bd1266023f5dd0f11a279f30d
MATLAB
1,705
49
function CCRtLtSave global CCresultRtouchWon CCresultLtouchWon RpegTouchallWon LpegTouchallWon SpikeArrayWon %SpikeArray‚ÅLPegTouchAllARpegTouchall‚ðƒAƒ‰ƒCƒ“‚µ‚½ƒNƒƒXƒRƒŠƒIƒOƒ‰ƒ€ %SpikeArray‚ÅLPegTouchAll‚ðƒAƒ‰ƒCƒ“‚·‚é duration=5000; CrossCoL=[]; CrossCoR=[]; %—¼•ûŒü for n=1:(length(SpikeArrayWon)) ...
690eeb8851b1289c131d3324a5010f7576d36fb3d76238275bcd0c814388389c
MATLAB
1,705
68
function [Bin_Table_SAVE,binCheck] = Avg5minBins(ProcessedData,setupParam,BinParam,TrialParam,x) %delay = TrialParam.delay; BLperiod = setupParam.BLperiod; %BLstart = BLperiod(1) + delay; %BLend = BLperiod(2) + delay; ST = BinParam.type; VN1 = {'signal' 'sigsubref' 'dFFentire_sig' 'dFFentire_sigsubref' 'Zentire_sig...
9e8e1d0dd02564a1a8f5bd3e0c9826f9593816200f4c7c0a1ceaeea1e29b0a58
MATLAB
1,705
44
% 计算图片中各类矿物组分的占比 clc clear A = imread('E:\CPL图1.png'); A = rgb2gray(A); pixel_num = zeros(1,14); [x,y] = size(A); for i = 1:x for j = 1:y if A(i,j) == 94 % 石英 pixel_num(1,1) = pixel_num(1,1) + 1; elseif A(i,j) == 116 % 长石 pixel_num(1,2) = pixel_num(1,2) + 1; ...
e4accd4461cf77782219ec7d9bf008935c371add9407916de4b565172c95ee5a
MATLAB
1,705
78
function [fid_cor] = processing_MEGA_bis(fids,par) %same as processing_MEGA if ~exist('par'), par='';end if ~isfield(par,'ref_metab'), par.ref_metab = 'CRE_SMALL2'; end if ~isfield(par,'correct_freq_mod'), par.correct_freq_mod='real'; end % or 'abs' %if ~isfield(par,'') if ~isfield(par,'do_freq_cor'), par.do_...
289e7cb50ee89be1af3888ffa049829dc2a533ba549fdb922477e0a3ecef6216
MATLAB
1,706
43
function [spikes1] = int_spikes(spikes,handles); %Interpolates with cubic splines to improve alignment. %Not in use currently w_pre=handles.w_pre; w_post=handles.w_post; ls = w_pre + w_post; detect = handles.detection; int_factor = handles.int_factor; nspk=size(spikes,1); s=1:size(spikes,2); ints=1/int_factor:1/int...
2aa94afa0ab74dc1cc33d4c83976ddf92039f35429f45424adf4813fa5038343
MATLAB
1,707
56
function [Path,Cell_Body_Center] = Get_Cell_Body(im,Path,Parameters1) % 1---------2 % | | ------> % 4---------3 figure(1), imshow(im); set(gca,'YDir','normal'); Scale_Factor = Parameters1(1).General_Parameters(1).Scale_Factor; Step_Length = Parameters1(1).Cell_Body(1).Step_Length; Rect_Width = Parameters1(...
d6e3ced8f721598788c8b296c07d7502aefabd2ea61fb66bc22ca3704d0e6915
MATLAB
1,710
59
classdef transposeLayer < nnet.layer.Layer % & nnet.layer.Formattable (Optional) % 重命名为transposeLayer % 维度转置 properties % (Optional) Layer properties. % Declare layer properties here. end properties (Learnable) % (Optional) Layer learnable parameters. Weights ...
b49d5544a72bf7f2cddf2df6848aee5031890a271f63f0ebb4380237c4693f70
MATLAB
1,711
86
% Kalman filter clc clear all close all; % load('SampleECG1.mat'); data = data'; % load('dataEEG.txt'); data = dataEEG(:,11)'; data = load('eeg.txt')'; %data = data(5001:20000)'; load LPFilterCoefs50Hzfs250Hz h fs = 250; % x = filtfilt(h,1,data); x = data; % x = data + (5.5+sin(2*pi*n*.1/fs)).*sin(2*pi*n*f0/fs)/s...
d8cb7196cd15dee00ea418681b272debc452d7722c0f7ceec5dba2c15d6205d7
MATLAB
1,711
42
%% plot IR SUG CELLS FORM ALL DATA [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 w = 2;% window for ploting (2 = sustaneid) %% for i = 1:length(datafile)...
0dbe4569b21be6d0f40da1df3640c0b60fd2f50f351b5ffd320483fe1cd3a8db
MATLAB
1,712
57
clear clc %% [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save path % p = 0.05; %pvalue % numofint = 4; %number of intensities to check for response % mkdir 'dele...
41b14ba933cdfb073982a6562e78ec82d6082f59d6f95fb78f567920dcc83628
MATLAB
1,715
50
function [CosTheta, U, V] = subspace_principal_angles(A, B) % subspace_principal_angles calculates principal angles and vectors between two column subspaces. % % Syntax: [CosTheta, U, V] = subspace_principal_angles(A, B) % % Inputs: % A: Matrix representing the first column subspace (size: m x n1, where m is the num...
ec4a22b7fc16babbf3cf4c1c7081c18194aba1228216baccf7281f77299ff143
MATLAB
1,715
49
function [acc,tone_dim] = get_tone_decoding_dim_time_independent(tone_pool, n_tr, n_rep) %% decode tone vs iti (time independent) acc = []; weights = {}; for rep = 1:n_rep % for tone sample trials for specific time point % for bl sample trial and time point rand_idx = randpe...
49916d5539a1fe4179824bec4634fbd6bc33293e88bc7749bd0a096bae6525f7
MATLAB
1,716
49
% % Test program for R-peak detection of ECG signals. % % Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 2.0, March 2008 % Released under the GNU General Public License % Copyright (C) 2008 Reza Sameni % Sharif University of Tec...
2615dac56568955b3c524a9fb2c0b54849642e1a5cabc3d128a8cf48aea0714e
MATLAB
1,717
69
function out = subsref(ob, args) %function out = subsref(ob, args) % handle subscript references like ob.ref or ob(ref,:) % Copyright 2002-2-20, Jeff Fessler, University of Michigan out = fatrix2_subsref1(ob, args(1)); % handle first subscript if numel(args) > 1 % handle multiple subscripts, e.g., ob.field() out = ...
099835b25f01d796821b6bed5d2cad01828d520ed69632c89fa8e3b4e75e1f67
MATLAB
1,720
36
function [clusterMean, siteNeighbors, clusterMeanLow, clusterMeanHigh] = getClusterMean(obj, spikeWindows, iCluster) %GETCLUSTERMEAN Get mean cluster waveform, optionally low and high [clusterMean, clusterMeanLow, clusterMeanHigh] = deal([]); iSite = obj.clusterSites(iCluster); siteNeighbors = obj.hCfg....
55efff8b44c5e6752a28d8c9c37c808fc5fbb70980b81d7c2daac910d410c4d0
MATLAB
1,720
38
%% mean-field inverse estimation: We use parameters and desired firing rates to estimate input LGN rate % Input: C_EE,C_EI,C_IE,C_II connectivity matrices % S_EE,S_EI,S_IE,S_II synaptic strength % p_EEFail Synaptic failure prob % f_E,f_I Desired firing rates % rE_amb r...
83e2e3d3db248c9459c9efdaf038d3652addbf446eb02326b6921d85388c4775
MATLAB
1,721
50
function [Thresh,error_subspace]=Calculate_Alpha(FINAL_FEATS,labels,nPLDA) %% This piece of code runs the PLDA function with different % values of alpha and plot two error curves % The projection metric distance of two consequent subspaces % For %% Load the data set [Npnt,Nfeatures] = size(FINAL_FEATS); %% x =...
582b8c946e2dcab4953c8fb70d32867ef6f232de11b6c4e712a75ce72d500d49
MATLAB
1,723
72
function plot_ks(session, channel, unit, fold, tlim) % Kolmogorov Smirnov (KS) plot of specific s-model for given period % % Parameters % ---------- % % - fold: integer scalar % Fold number % - tlim: [scalar, scalar] % Time limits from saccade % - probe: 2-by-1 integer vector % [x, y] postion of a probe line_wid...
8eeaf394210abfa01998b51424cc3b68d72b258190f70cc4b40f5e223f76703d
MATLAB
1,725
49
clear clc [file, path] = uigetfile('clusters.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 %% int_colores = {'c','k', 'm', 'r', 'g', 'y', 'b'}; for w = 1:si...
6ff753a9526fe2f1811f74f6bd8fc62e795262948c4e35d8216880b0fc6e657b
MATLAB
1,726
48
%% Check alignment of MNI space images % % Sometimes the alignment to MNI space does not work well. % This script checks whether it did. % % Also the option to check alignment across all MNI scans and output a .mat % file containing the alignments to the output directory. Note alignment is % calculated simply as the ...
8cef3babbab1e9de26442d4cd3ab9d63891f083f16a45ad83c919da7a01d4b46
MATLAB
1,726
46
function [fBeads]=mnl_RemoveDoubleLabelledBeads_BasedOnBeadCenter(Beads,ImDim) sz=size(Beads,2); n=1; Overlap=[]; for i=1:sz %BeadOneImLimits=Beads(i).ImageLimits; BeadOneBeadCentre=Beads(i).BeadCentre; BeadOneSize=Beads(i).BeadSize; %Add the diameter to the centre (i.e. radius times 2) to make sure the...
78c84b11c6a305d3cffcd9d419df4dae89854ff6b221cb7e42981a0649b5a248
MATLAB
1,728
57
function st = gg_Gnufft_init(om, M, Msp, R, tau) %function st = gg_Gnufft_init(om, M, Msp, R, tau) % % Initialize structure for 2-dimensional NUFFT using gaussian interpolator, % particularly the interpolation matrix in sparse format. % caution: this routine can require a lot of memory! % in % om [Min,2] "digital" fre...
dab93570442667b04465b1c61f3d42dc66a57a424ec7ff9bf9105a97542b4c8f
MATLAB
1,731
51
%% calcualte_mean_basline_from_clusters_file 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, s...
31a047e8f2914a13c41a8650795e77a8d94872db9103288653dc3869b84c3605
MATLAB
1,732
61
function varargout = histnorm(varargin) % HISTNORM Histogram normalized % [...] = HISTNORM(...) works like HIST, but the frequency is normalized % so that area sum is 1. % % Bonus usage! % [...] = HISTNORM(..., 'plot') plots and returns the output arguments. % Be sure 'plot' is the last argument. % % Examp...
847e8fbd593c1f1ecbbf0059f3e3577000cf5bfeca259a0e5c3a429d4c5a9724
MATLAB
1,732
50
% example_nufft1_antenna.m % % This m-file is an example of applying the NUFFT method to compute % the far-field beam pattern of a 2D array of nonuniformly spaced % (point?) antenna elements. % In the nomenclature of the 1999 SIAM J Sci. Comput. paper by Nguyen and Liu, % this is "Problem 1." % % This provides an examp...
df7571654b7314f5bdcedb01b0497f657218ac99ace8f743e8d8e2e06052106b
MATLAB
1,734
64
function net = DnCNN_init(num_layers) %%% Initialize the model with num_layers layers b_min = 0.025; lr11 = [1 1]; lr10 = [1 0]; weightDecay = [1 0]; meanvar = [zeros(64,1,'single'), 0.01*ones(64,1,'single')]; % Define network net.layers = {} ; net.layers{end+1} = struct('type', 'conv', ... 'weights', {{sqr...
e90e4d87e4874b1ee39c8736cd2e9f89b5212841dbb250426f9272e65f24e67b
MATLAB
1,736
60
function coeff = calc_dist_coeff(dim,N,min_euclidean_dist) %CALC_DIST_COEFF Coefficient of minimum distance % %Syntax % coeff = calc_dist_coeff(dim,N,min_euclidean_dist); % %Description % COEFF = CALC_DIST_COEFF(dim,N,MIN_EUCLIDEAN_DIST) sets COEFF to be the % coefficient in the expression for the lower bound on the mi...
f3943ad572a7c3c0259d6e5f100985e1d7958c0e885fabe6ce502bd4b2308fe1
MATLAB
1,736
51
function [ts_motion, ts_meanstatistics, ts_stim_meanstatistics, ts_stdstatistics, ts_stim_stdstatistics] = extractTS(ts_list, ntime, stim_list, stimDur) % This program is intended to extract time series and statistics. % % input: % ts_list: data of timeseries % ntime: length of time series % stim_list: stimulatio...
a23b82bb6c3cff88fa00d6bbab3d6f48571fc738fa44b27861daf753a43bda1d
MATLAB
1,738
59
function groupexperiments(group) %% Group experiments by averaging the projections % % data = groupexperiments(group) % % Input: % group: experiment ID of a single experiment file (e.g. '100140756'), or % cell array containing multiple IDs. In the latter case the experiments % will be averaged. % % EXAMPL...
cafb9b7bfcec287ea644f7f76cdb317c495bae0e53884905c6fba04fde4f0ce6
MATLAB
1,743
56
function [synCh, beat] = syntheticChannel(x, winL, Peakloc) % % [synCh, beat] = syntheticChannel(x, winL, Peakloc) % synthetic channel construction based on Robust weighted averaging % % Fahimeh Jamshidian Tehrani, % jamshidian.t@gmail.com % September 2022 % % input: % x: input ECG record it can be multicha...
a4b5631f9bcc45623e81930686767a583b735036256a0742d425c6cad3cf96f6
MATLAB
1,745
45
function [status, count] = write_binary_signal(x, fs, ofname) % write_binary_signal - Save a multichannel signal as a binary file (readable by read_binary_signal) % % Syntax: [status, count] = write_binary_signal(x, fs, ofname) % % Inputs: % x: Matrix of input data (channels x samples) % fs: Sampling frequency % ...
4402355f70c2bdc29c512ae9454a30f7605ca5365d198494293589753b9bc8a9
MATLAB
1,747
52
function [pi_0_ehmm , coupling_tetha_ehmm , transition_ehmm ,ehmm_gmm_para, index_matrix, pi_0_chmm , transition_chmm , chmm_gmm_para] = im_para_eqhmm(pi_0_lsim, lsim_gmm_para, coupling_tetha_convex_comb, transition_matrices_convex_comb) C = length(pi_0_lsim); channel_num_states = zeros(1,C); for c = 1:C cha...
97bc6e2db32c9606c51f40e5628431fb25fdea4cf5c4d9b4e96b8ee92b69f0ca
MATLAB
1,749
80
function [b, b_iters] = CGbasic(E,m,varargin) % b = CGbasic(E,m,varargin) % % Basic linear conjugate-gradient approximation to inverse % % updated Sep 25 to attempt to add 'hot start' (not yet correct!) [maxIters, useDisp, b_start] = process_options(varargin,'maxIters',15,'useDisp',0,'b_start',[]); m = single(m); % d...
ac8403d209a2ade5e808fb311219aa1f5b07652a725d1aa7351ec4a3f97aaff2
MATLAB
1,749
74
function c = get_water_content_tour(cmet) marsbar('on'); pp.wanted_number_of_file=1; pp.verbose=0; anat_dir = '/home/romain/images5/spectro7T/anat'; %c=cmet; for npol = 1:length(cmet) c(npol).pool = cmet(npol).pool; suj = cmet(npol).suj; for ns = 1:length(suj) sujname = suj{ns}; sujreg = [su...
22fa71735039c1fdf1eb0fc55547015fca8b534d77c15b4887f15ac7006f44c6
MATLAB
1,750
54
function [main] = shadederrbar(x,y,sem,color) %Name: shadederrbar %Created By: Pratik Mistry %Created On: 27 July 2018 %Updated: 31 July 2018 -- Turned the main plot into a output variable. % %[main] = shadederrbar(x,y,sem,color) % %Description: This code creates a plot of the main graph with transparent %shad...
36a7bab60772188fdd63b00a346a586d6ad25cb86ced216c25fa9f374a10a14d
MATLAB
1,752
45
function YFIT = model_all_Su_log(param, time, V, model_v, model_t) % param : mu, alpha, beta, ks, ka [g,m] = size(V); param = reshape(param, 1, length(param)); param_v = param(1:3); param_s = param(1:4); %param_a = [param(1:3), param(5)]; ke_s = 3.26; %ke_a = 3.85; for j = 1:g switch V(j) case 1 ...
500553981b0a79fa35e05275296239317c72143bc2a33d1876423a65fb9ecd18
MATLAB
1,753
61
function X = dtft2(x, omega, n_shift, useloop) %function X = dtft2(x, omega, n_shift, useloop) % Compute 2D DTFT of 2D signal x at frequency locations (o1, o2) % in % x [N1,N2,L] signal values % omega [M,2] frequency locations (radians) % n_shift [2,1] use [0:N-1]-n_shift (default [0 0]) % useloop 1 to reduce memo...
0a6344ca2b49ded07b2f6b12315507ef303763379e29779037bffd9164978769
MATLAB
1,754
49
%% 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...
d66c76f906d897beea6d5d6c1afab415e0cd0b22dbc1d2f747d446249bbaf3fc
MATLAB
1,754
64
function [Bx_tot, By_tot, Bz_tot] = getBfield(Q,R0,rx,ry,rz) %Sanitization of input sizQ = size(Q); sizR0 = size(R0); sizrx = size(rx); sizry = size(ry); % sizrz = size(rz); assert(sum(sizQ == sizR0) == length(sizQ), 'Dipole and position arrays do not match in size'); assert(sum(sizrx == sizry) == length(sizrx), 'Sup...
8a2aaf096928222859ea073de627fe003b630f088cd4c45235280e9e6da974e3
MATLAB
1,755
79
%% this script can be used to generate coarse alignment coordinates % we do this if the automatic alignment fails because there are % large scale rotations or translations %% load maps p = params_FC; %SUBJECT WAS EXCLUDED! sub = 0; % thisSub = 84 for ses = 1:p.nSessions thisSub = p.subjects(sub); fpath = full...
e475277d449f87d13482cb1fb385fbbe4470c71911e6ae20518ec3336e50fdf7
MATLAB
1,756
42
% Has to find a way to symmetrize the LGN and L6 inputs to pixels. The % insymmetry largely comes from the inhomogeneous distributions of cells in % different pixels. % PixL6Ctgr: N*5 (or other number) matrix. Each column represents one % domain (orientation * ocular). %% NOTE:!! The code here largely depending on th...
4be801713d1f2ca12856e7e6794b1ddbf46c87f9d56e12fe4c57c61c672365a6
MATLAB
1,757
56
function [spikes,index,thr] = amp_detect_pol(x, par) %detect spikes in a tetrode %PARAMETERS w_pre = par.w_pre; w_post = par.w_post; ref = ceil(par.ref_ms/1000 * par.sr); awin = par.alignment_window; % SPIKE DETECTION FOR EACH CHANNEL % Detects all spike times including all channels % there will be spike times very...
558610142d10ed27701dadc16d0f134513240a8702acd972a1b36371fe17014b
MATLAB
1,758
53
% Calculate intersection bw T2_masks and eroded_GM_mask (to see whether GM % can be considered as a 'NORMAL APPEARING GRAY MATTER') clearvars close all addpath(genpath('/storage/stella/MATLAB_toolboxes/')); addpath('/storage/stella/Analysis/matlab_scripts/'); lesionmaps_path = '/storage/shared/MScubric/LESION_MAPS/'; ...