sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
cbd836dd907a84a1460dec4352df80d0af9903f5c34eea30e7bd14ff36aec1e3
MATLAB
1,760
54
function predcond = PID_DecodeFromSpikeCellArray(tempUnits, tuningAxes) % temp units has the field spikeCell, cell array of spike counts which has % the shape of the neural tuning being used tuningShape = size(tempUnits(1).spikeCell); numDims = sum(size(tempUnits(1).spikeCell)>1); nReps = numel(tempUnits(1).spikeCell...
11ec8fbd59400bc4ce86db4bc43755a74349017c281dab07037a9e695f12b1d8
MATLAB
1,761
67
function print_info(fid,filename) fp = fopen(filename,'w'); suj=char(fid.sujet_name); [suj,ind]=sortrows(suj); fid=fid(ind); [B,I,J] = unique(suj,'rows'); fprintf(fp,'Patient_name,iscompleted,numSer,MC L,MC R, BG L , BG R , OCC , OCC MM , CER , MC L E2 , MC R E2 , BG L E2 , BG R E2 \n'); for k=1:size(B,1) ff =...
860b10e4eb59d25cab56768378a56c95119cc88e0457cde2e1398e5913d9d46e
MATLAB
1,761
41
function [sta, time, sta_z] = getSTA(signal, events, Fs, window) % Spike Triggered Average (STA) - alignment of signal to event time % % [sta, time, sta_z] = getSTA(signal, events, Fs, window) % % example: getSTA(fp, beh_onsets, 50, [0 5]); to extract photometry signal % from t = 0s after movement onset to t = 5...
f6fc69a70b75e94562490eeea7afe876234100710dedb389b352153a580c8e7b
MATLAB
1,761
50
function HR = HRCalculationFromPeaks(peaks, fs, trim, method) % % HR = HRCalculationFromPeaks(peaks, fs, trim, method), % Heartrate calculator from the R-peaks impulse vector % % inputs: % peaks: an impulse vector containing the R-peaks % fs: sampling frequency in Hz % trim: number of beats to trim from averaging % met...
0613a861673982a33a556d076ff47075b16d4d2df58d11d6d950200058f13a91
MATLAB
1,762
71
function multiple_boxplot(data,xlab,Mlab,colors) % data is a cell matrix of MxL where in each element there is a array of N % length. M is how many data for the same group, L, how many groups. % % Optional: % xlab is a cell array of strings of length L with the names of each % group % % Mlab is a cell array of ...
d90f15c4493a749c154074426f31c00d1f2914e276ba24edbb28d014c850c25d
MATLAB
1,763
70
function [S2, Q2, X_new3, qpc] = consensus_comm_wei(C) % FUNCTION: To identify consistent communities in an ensemble % % OUTPUT: % S2 is a pxn matrix of new community assignments % Q2 is the associated modularity value % X_new3 is the thresholded nodal association matrix % qpc is the quality of the consensus (the low...
084e3f34f52ac59d499ce5815be9eeb0900c3c828330a0961fb5bf8c75d4c12a
MATLAB
1,764
54
function electrode_selector() global pointList; % Declare pointList as global % Initialize the figure hFig = figure('Name', '3D Surface Selector', 'NumberTitle', 'off', 'Position', [100, 100, 900, 600]); % Initialize pointList pointList = []; % Create axes for 3D plot ax3D = ...
f3bc0038f433ea3e7e43fafa0d0d2b612bd3b8b9120919f592f0d87e7cf7b7ce
MATLAB
1,765
55
function Plot_polytrode_amplitudes(handles) USER_DATA = get(handles.wave_clus_figure,'userdata'); par = USER_DATA{1}; classes = USER_DATA{6}; spikes = USER_DATA{2}; 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.241...
3c707884adc738fa864c2dd6a11dbd5bc5b88e35aecf00d61e28e211cf21cdf5
MATLAB
1,766
72
function X = newfft_approx_for(st, x, om) %function X = newfft_approx_for(st, x, om) %| %| (approximate) forward NUFFT Nd = st.Nd; Kd = st.Kd; dims = size(x); dd = length(Nd); if ndims(x) < dd, fail 'input signal has too few dimensions', end if any(dims(1:dd) ~= Nd), fail 'input signal has wrong size', end % the u...
14ccfdf1a934614ad4de0af06088c8f75626c14f257ff0f17a63f54a12f4a5bd
MATLAB
1,767
80
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) yyaxis(app.ax_spike_msna, 'left') cla(ap...
a291f1ff6d56dfd549b70e435637ea47ac62b62313bec7e89a9cf8c3524bae72
MATLAB
1,767
50
% 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...
8f9494aa77879074d222a0820d907cd8087ae53ae06db937bd42b450509903ea
MATLAB
1,768
64
function Heatmap cd('C:\Users\C238\CheetahWRLV20220213\Heatmap') for i=1:117; file = [num2str(i) 'heatmap.mat']; data = load(file); R_gt4 = data.RtPositiveFiringRateArray_gt4; L_gt4 = data.LtPositiveFiringRateArray_gt4; R_lt3 = data.RtPositiveFiringRateArray_lt3; L_lt3 = data.LtPosit...
91078a1f313b6c85f0173dad784847d419e61560b8bc300eaa7bc371d9b0f54f
MATLAB
1,768
64
function y = CNN_Test(Training_Frames,Training_Classes,Testing_Frames,Testing_Classes,Frame_Half_Size) % Display some of the training images % clf % for i = 1:20 % subplot(4,5,i); % imshow(Training_Frames{i}); % end rng('default'); hiddenSize1 = 100; autoenc1 = trainAutoencoder(Training_Frames,hiddenSi...
b11ccef02b551fe50391466a3cebccb405a758f58b13bd1c94a6b00bee498c52
MATLAB
1,770
65
% test fECG extraction using an additional synthetic channel % Reza Sameni, Copyright March 2006 % Modified June 2018 % clear; close all; clc; %load LOUETTE_07-Oct-2005_20s.txt -mat;data = LOUETTE_20s';clear LOUETTE_20s; %load patient165_s0323lre;data = data(:,2:end)'; load FOETAL_ECG.dat; data = FOETAL_ECG(:,2:end)';...
b5f7b775b5825a44d8e9516ef28316ad7d4dcf46a309e2b352e699111c619e68
MATLAB
1,770
51
function [e, n] = adaptive_filter(x, delay, taps, mu) % adaptive_filter - Adaptive Noise-Canceller/Line-Enhancer. % % Syntax: [e, n] = adaptive_filter(x, delay, taps, mu) % % Inputs: % x: Input signal. % delay: Delay in samples for the reference signal. % taps: Number of filter taps. % mu: adaptation r...
d11f3b7cfc13ef484cfc95c2a420f3da1b2ba1e95ff4b0a7ce641ebe3a705dc4
MATLAB
1,770
47
% A script showing how two different models can be easily compared. Here, % we plot control ToR-ORd and the HCM variant in control condition and with % 50% IKr block % % Slow pacing (0.25 Hz) is used to facilitate EADs. %% Setting parameters clear % param is the default model parametrization here param.bcl = 4000; pa...
260cadbf52d64ccb3ead0e63f56b095193a2e931ce946210c49272dce6f9da06
MATLAB
1,771
59
function [fBeads]=mnl_RemoveDoubleLabelledBeads(Beads,ImDim) sz=size(Beads,2); n=1; Overlap=[]; for i=1:sz BeadOneImLimits=Beads(i).ImageLimits; for dim=1:3 %If it is smaller than 1 if BeadOneImLimits(dim,1)<1 BeadOneImLimits(dim,1)=1; end %If it extends beyond the di...
ef8e14d7f2bfe94dc756bd2531a3542f721d6247cf544fe0a5d1edc1779db513
MATLAB
1,771
44
%Recursive Zonal Equal Area Sphere Partitioning: Properties of EQ point sets % % Recursive Zonal Equal Area (EQ) Sphere Partitioning Toolbox. % Release 1.10 2005-06-26 % %Functions by category %===================== % % Energy and minimum distance % eq_energy_dist Energy and minimum distance of an EQ point set...
22f299b5487eeb922da7a4da68a843b21b531d7ae886c14f423d85d673206fc7
MATLAB
1,775
80
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) yyaxis(app.ax_spike_msna, 'left') cla(ap...
91b4f544edce61a7dc07ef79e64ee6d35d8253da6632f0763a03e15020ad9695
MATLAB
1,775
40
function auto_hb(app) %auto_hb checks if hb is already detected and runs hb_det_2 on the ecg if %not % Detailed explanation goes here if isempty(app.hb_res) if ~isnan(app.settings.channel_idx.ecg) if app.settings.interval(1,1) < app.data(app.settings.channel_idx.ecg).ts(1) app.settings.inter...
1e1942c1ece058d15657e3e41b46d6627dd75f5fb7b6fff3b56141cae92a15a0
MATLAB
1,777
76
function Xk = nufft_table_adj(st, X, order, flips, om) %function Xk = nufft_table_adj(st, X, order, flips, om) %| adjoint of table-based nufft interpolation. %| %| in %| st structure from nufft_init %| X [M,nc] DTFT values (usually nc=1) %| order 0|1 0th or 1st-order interpolation %| default is 0 for backward compa...
493370ca176cb60329da15258920bbafe81b1bb16488fb43461e1607e4f0ca76
MATLAB
1,777
82
function main() % Main function % % to see log file % >> type('log.txt'); % % Notations % --------- % - trn : train % - val : validation % - tst : test % - stm : stimulus kernel % - psk : post spike kernel % - off : offset kernel % - idx : indexes % - r...
277ee02a23963809c70318db7b49ca2a0e3cca5fa8751c86c933330cbcc6b3e6
MATLAB
1,779
42
function nodeinfo(obj,~,t,g,data,h) %% Response to a mouse left button click on a structure % autocorrelatemap() and crosscorrelatemaps() depend on this function. % % obj: handle of clicked graphics object % t: array of all structures objects % g: array of all labels objects % data: data from graph function % h...
3b6421126b69b65820e6ea74078914271124449701e37428faeee2ef836dcd07
MATLAB
1,779
63
% test implementation of periodic splines % UNDER TEST % Reza Sameni, Copyright 2015 % close all; clear; clc; fsim = 1000; % Simulation sampling frequency (Hz) knots = [1 3 5 7 15 25 35]; % knot points (s) D = 4; % degree tfirst = 0; % s tlast = 25; % s N = length(knots) - 1; if(D > (N-1)) warning('D may not exc...
1196c52a36278a2b1d7838cdf4d4a157705bf10cd61f4d2fa7f6cefc943434e3
MATLAB
1,782
54
% Function that gets the pdf aprox from the histogram of % Inter (Ca++) Transient Interval histogram obtained from the raster % Input % R: raster data: Cells x Frames % fs: sampling frequency % Ouput % ISIbin: bins of ISI [seconds] % ISIp: probaility of ISI % Lengthbin: bins of Transient Length [seconds] %...
d059fdeb0d482b7ad3204411c37579f2b88a9943e1324fd5a324b587afe41abc
MATLAB
1,782
52
function [B] = make_bsplie_bases(L, knots) % Draw, manipulate and reconstruct B-splines. % version 1.5.0.0 (21.1 KB) by Levente Hunyadi % link: https://www.mathworks.com/matlabcentral/fileexchange/27374-b-splines n = 3; % order = 2 t = min(knots):max(knots); B = []; for index = 0:numel(knots)-n...
67d71f885ba9fcf8ee1ab791fa66c9c193a3dd6dae756eb78800c01517c48cc9
MATLAB
1,783
57
function x = gaussian_mixture_model(params, t) % gaussian_mixture_model - Generate synthetic Gaussian mixture model. % % Syntax: % x = gaussian_mixture_model(params, t) % % Inputs: % params: A vector of length 3*L, where L is the number of Gaussian kernels structured as follows: % - alpha = params(1:L...
2a534b0627bf093e436d511a84c4cd447b3d7b4fd8256eb4601a62a889479cee
MATLAB
1,785
58
function savefig(fname, fig, skipeps, capstr, dpi) %savefig(fname, fig, skipeps, capstr, dpi) if nargin < 5 dpi = 300; end if nargin < 4 capstr = ''; end if nargin < 3 skipeps = false; end if nargin < 2 fig = gcf(); end figure...
4f1228ac1e5a314f6d53817137164380817518f5d24bf03eb57b7aad882a0e46
MATLAB
1,785
60
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Reduce an image applying Gaussian Pyramid. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function IResult = GPReduce(I) %#codegen Wt = [0.0500 0.2500 0.4000 0.2500 0.0500]; dim = size(I); newdim = ceil(dim*0.5); IResult = zeros(newdim,class(I)); % Initialize the a...
68aa40f11dd66300c00d88fdb2e3fc683b93856d008f5cf2b8e77215f0f3f4c9
MATLAB
1,785
54
function [H Wp] = boxstat(d1,d2,l1,l2,alpha,str) %BOXSTAT Box plot with statistics. % [H WP] = BOXSTAT(D1,D2,L1,L2,ALPHA) plots box plot (H, figure handle) % of data sets D1 and D2 using x axis labels L1 and L2. It performs % Mann-Whitney U-test with significance level ALPHA (default is 0.05) and % retur...
722f527ea77e5a3a6e8242f4f0b02abcbfc3f491a6355fe341f7db131c6f7e4e
MATLAB
1,788
45
%average together the 9 session/person - output: a matrix for the scalp map clear all; % close all; %------------------------------------------------------------------------- subjects = ['A_'; 'B_';'C_';'D_';'E_';'F_';'G_';'J_';'K_'; 'L_';'M_'; 'N_'; 'P_'; 'Q_'; 'R_'; 'S_'; 'T_'; 'U_'; 'V_'; 'X_'; 'Y_'; ...
7b049e64881312b4a513e61ff9b4efdaf013e4d8ca73476ed7b0901fc86997a8
MATLAB
1,788
73
function [binTable_SAVE] = eventwindowBins(ProcessedEventWindowData,BinParam,TrialParam,x) ST = BinParam.type; VN1 = {'signal' 'sigsubref' 'dFFentire_sig' 'dFFentire_sigsubref' 'Zentire_sig' 'Zentire_sigsubref' 'dFFbytrial_sig' 'dFFbytrial_sigsubref' 'Zbytrial_sig' 'Zbytrial_sigsubref'}; if contains(BinParam.process...
fdf497ab373153f718c8f6e148e373a4b84dfeee14bf8bd8d49e0d4eba921d96
MATLAB
1,790
53
function [A, B] = pica_matrices(x, peaks) % pica_matrices - Calculates covariance and lagged-covariance matrices % required for the pseudo-periodic component analysis algorithm (PiCA). % % Usage: % [A, B] = pica_matrices(x, peaks) % % Inputs: % x: Matrix of input signals (rows represent channels, and colu...
01e0fb1f819e3d037848e7ace4040b7742cb117262f5ad84197b0f1202eef21f
MATLAB
1,791
63
function diam_bound = max_diam_bound_of_regions(regions) %MAX_DIAM_BOUND_OF_REGIONS The maximum diameter bound in an array of regions % % diam_bound = max_diam_bound_of_regions(regions); % Copyright 2004-2005 Paul Leopardi for the University of New South Wales. % $Revision 1.10 $ $Date 2005-06-01 $ % Function s2e chan...
9160f95a8eafc54222870146180bbf2ca00f56bab920ea9fbc0c52e06d5303f6
MATLAB
1,791
54
function property = eq_regions_property(fhandle,dim,N) %EQ_REGIONS_PROPERTY Property of regions of an EQ partition % %Syntax % property = eq_regions_property(fhandle,dim,N); % %Description % PROPERTY = EQ_REGIONS_PROPERTY(FHANDLE,dim,N) does the following: % 1) uses the recursive zonal equal area sphere partitioning a...
0cabb494d56f79d32fc58957b4d9acd4f485953f2a37d3d787ac96977cf10b67
MATLAB
1,794
61
close all clear clc % Convert all dat files in bash using this command: find ./*/ -type f -execdir wfdb2mat -r {} \; datafilepath = '../../../../DataFiles/PTBDataset/Physionet.org/files/ptbdb/1.0.0/'; directory_list = dir([datafilepath 'patient*']); filelist = dir(fullfile([datafilepath, '**/*lr*.mat'])); % get lis...
0d9351ebc1755853c6c07333e4518742d8ea5b3a8b8dd4bf0655ca9359af7c8f
MATLAB
1,796
61
clear clc close all % Generate a synthetic fHR sequence x = zeros(1, 300); x(50) = x(50) + 1000; x(51) = x(51) - 1000; x = cat(2, x, 15.0*ones(1, 50)); x = cat(2, x, zeros(1, 180)); x = cat(2, x, -28.0*ones(1, 30)); x = cat(2, x, zeros(1, 80)); x = cat(2, x, linspace(0, 35.0, 80)); x = cat(2, x, 35.0*ones(1, 70)); x =...
c9733b3959973922faa2b4c75005f80afd938f33412b609e2fdee42b6caedd37
MATLAB
1,796
55
function orientation=hbf_CheckTriangleOrientation(p,e) %HBF_CHECKTRIANGLEORIENTATION tests, how triangle mesh is oriented % orientation=HBF_CHECKTRIANGLEORIENTATION(mesh) % orientation=HBF_CHECKTRIANGLEORIENTATION(points,elements) % mesh: hbf struct for triangle mesh % points: mesh vertices, [N x 3] % elements:...
bf68176f6b160781f8f3cd986aa837a3d26067140c8238c725b938d828e63220
MATLAB
1,797
67
kDatasetFolder = '/media/sergeyd/OS/Users/sergeyd/Workspaces/SVHN/data'; load(fullfile(kDatasetFolder, 'train_32x32.mat')); samplesNum = size(X, 4); xSize = [size(X, 1) size(X, 2) size(X, 3)]; classesNum = 10; %TrainX = single(X) / 255; TrainX = X; TrainY = single(zeros(samplesNum, classesNum)); for j = 1 : classesN...
33018f4b540c2a429b3ced6646079a1e33c24e83a9f85645749b791187fd2f60
MATLAB
1,799
38
function [ inputMovie ] = downsampleMovie(p,inputMovie,dimension) %downsampleTime downsamples a movie in time, uses floor to calculate downsampled dimensions. switch dimension case 'time' % downsample the movie in time by downsampling the X*Z 'image' in the Z-plane % an...
83ab1ee2ac65e0a0e36563d1f7d6f3bd1a3d65655d428294a107509698fd1008
MATLAB
1,799
62
function [alphas, beta] = nufft_alpha_kb_fit(N, J, K, varargin) %function [alphas, beta] = nufft_alpha_kb_fit(N, J, K, varargin) %| %| Return the alpha and beta corresponding to LS fit of L components %| to optimized Kaiser-Bessel scaling factors (m=0, alpha=2.34J). %| This is the best method I know currently for choo...
d6f0111c2b07c4e98181c4376cf66ac82452370c560bb45e266bbd90c9df84ba
MATLAB
1,799
60
clear p = params_2DAA; saveFig = 1; % load raw frames and std-frames fpath = 'G:\E7_2DAA\misc\raw_data_snippets\raw_frames'; load(fpath,'raw_frames') fpath = 'G:\E7_2DAA\results\std_frames'; load(fpath,'frames_aligned') fpath = fullfile(p.rootDir,'results','filters.mat'); load(fpath,'filters') %% for sub = 11%1:12 ...
69fd408fe72878ccf13eb06d9a3a182a102821068f446759cbd281143a3cff40
MATLAB
1,801
71
clc, clear; addpath(genpath('D:\QcData\XxMatlabUtils')); %% calculate OTF0 % OTFPath = 'Detection_OTF_488_NAo0p6_NAi0p505.mrc'; OTFPath = 'Detection_OTF_560_NAo0p6_NAi0p505.mrc'; % OTFPath = 'Detection_OTF_642_NAo0p6_NAi0p505.mrc'; SaveOTF2d = [OTFPath(1:end-4) '_2D.mrc']; % parameter of 3D OTF files nx = 512; ny = 5...
7231480d31817db68c4b69007cc60b559976071eef3fecc48a075c1b8049961f
MATLAB
1,803
65
%% quantify and plot [cols,alpha] = chooseColors; % calc mean over reps action_full = mean(action_vals); tone_full = mean(tone_vals); % restrict to end period action_end = action_full(41:70); tone_end = tone_full(41:70); % find timepoint with maximal drop for action start / tone end alignment [~,max_drop_action] = m...
b5cfb30d6d7fca15ae74a266f0a9d2f9854f3af8207d0d1b5a40d5091fe6257e
MATLAB
1,803
59
% % Test program for phase calculation of ECG signals. % % Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox % % Open Source ECG Toolbox, version 1.0, November 2006 % Released under the GNU General Public License % Copyright (C) 2006 Reza Sameni % Sharif University of...
0aea16ba163b79675d57b9b17176c3f62cc53a88218778a86b3902649a95d4ef
MATLAB
1,804
42
function target_sep(h,data) %% Draw number of targets per brain area for separate experiments % autocorrelatemap() and crosscorrelatemaps() depend on this function. load('structures','structures','groups'); subplot(h); % Create plot with double y-axes ax = plotyy(0,0,0,0); hold(ax(1),'on'); hold(ax(2),'on'); ...
bb447165d82e0495563afd476fad0d1d09c63063d08647797c63f050d9b3821a
MATLAB
1,806
59
function print_info_ww(fid,filename) fp = fopen(filename,'w'); suj=char(fid.sujet_name); [suj,ind]=sortrows(suj); fid=fid(ind); [B,I,J] = unique(suj,'rows'); fprintf(fp,'Patient_name,iscompleted,numSer,MC L,MC R, BG L , BG R , OCC , OCC MM , CER , MC L E2 , MC R E2 , BG L E2 , BG R E2 \n'); for k=1:size(B,1) f...
81f2c41e1d84ace36e4d6a94d195d7e0e78125c6630b166da52ef6ae0bfbc236
MATLAB
1,807
60
function touchparameterplot20191128 path=['C:\Users\C238\Desktop\CheetahWRLV20180729Part1']; cd(path) MaxA1RtArray=[]; MaxZRArray=[]; MaxA2LtArray=[]; MaxZLArray=[]; LS1=ls; for i=1:length(LS1(:,1)) trimFolder=strtrim(LS1(i,:)); if ~strcmp(trimFolder,'.') && ~strcmp(trimFolder,'..') && length(tr...
c72e5c97f9f4e0bf0ee81dd3011583223e5cd37a395f13f51d6101062512a9f4
MATLAB
1,807
54
function medsubDat(nChan,memToUse) %medsubData - Median Subtraction from dat file % % Usage: % medsubDat(nChan,memToUse) % % Description: This function takes dat files containing the raw data from % in vivo electrophysiology recordings and performs a median subtraction % on the data to decrease th...
4f34b8185de2290c3090598d19f545dfdf9971bee72f0b1af42e4f21b0f5ea28
MATLAB
1,809
40
function summarize(obj) %SUMMARIZE Summarize a JRCLUST session's results summaryText = cell(5, 1); countsPerSite = cellfun(@numel, obj.hClust.spikesBySite); [minCount, argMin] = min(countsPerSite); [maxCount, argMax] = max(countsPerSite); medCount = median(countsPerSite); summaryText{1} = ...
d1eaa924d2fa18738386ef4600f96bdb219d37228cfdaabec2e61a690d573e6d
MATLAB
1,809
39
%% Get all CG pixel conn mats from 3*3 HC schemes function [C_SS_meanU,C_CS_meanU,C_IS_mean,... C_SC_meanU,C_CC_meanU,C_IC_mean,... C_SI_mean, C_CI_mean, C_II_mean] = ... GetCGConnMats(... C_SS_Pixel_Us,C_CS_Pixel_Us,C_IS_Pixel_Us,... C_SC_Pixel_Us,C_CC_Pixel_Us,C_IC_Pixel_Us,... C_SI_Pixel_Us,C_CI_...
0477915fa60d767f6ca54630cbc54c6d38614755f2841c31f007223f422e9031
MATLAB
1,813
49
function NN_Probabilities = Apply_Trained_Network(Net,Im0) % This function gets a trained neural network and a grayscale image and produces a matrix of probabilities. % Each pixel in the output matrix contains the probability of the corresponding pixel in the grayscale image of being % a neuron pixel or a non-neur...
100805587d553cb507b6342ed945eb849cda958e697df83515de8b6d3da6514e
MATLAB
1,815
34
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [pops_PT, pops_met] = simulate_pop_PT_met_struct(... temps,... model_struct,... fixed_effects,... psi,... % covariance of the random effects param_transform,... resect...
5bfc7866b8c092d502a8eb69ac96ba79c4e3d7a5817368639b1461634e5927e0
MATLAB
1,816
36
% Date: 17-08-2021 Programmed by: D. Bolger % Script to call the channel rejection and ICA functions. % Each section can be run separately by selecting the individual section % and running "Run Section". % For each operation (channel rejection and ICA), the functions allow you % to manually choose the datas...
61e9ea4d93a7f8da5b4b9173ef8345952c1521f40a9c0887813273e6be86cc20
MATLAB
1,816
44
%Purpose: Implement Hungarian Matching Algorithm for MSHBM and k-means parcellations %parcellations. %Inputs: MSHBM and k-means parcellations (run directly following %parcellation BEFORE visualization) %Outputs: Individual parcellations with matched values (e.g., network 1 is the same across parcellation methods. % %...
10d80281c93143eee41691eb9f8e4628d45d60c9b059659b24aef9ec7299f62b
MATLAB
1,817
59
function [feature_vec, feature_info] = ecg_hjorth_features(data, fs) % [feature_vec, feature_info] = ecg_hjorth_features(data, fs) % Extract features related to the complexity analysis of ECG signal % % Inputs: % data: ECG signal as a vector (in microvolts (uv)) (1D array). % fs: Sampling frequency (Hz) % % Outpu...
4329e41ee056a67cccb2d8f50e20716c082d352ebcd93a784bc6a8d6814afa9b
MATLAB
1,819
59
function fig_alluvial_coms_9G(Rep_part,options,atlas,save) % Alluvial pplot between flex n => flex n+1 atlas_name = options.atlas{atlas}; From_To = [1 2; 2 3]; for gI = 1:2 for ft = 1:length(From_To) fg = figure; % from communities rest Par1 = Rep_part{gI}{...
516bc04365ec61ffbc24ea48398b5ea710dccd7a5193f460688c2b768caa6238
MATLAB
1,819
48
function img_regist = XxRegistration(img, ref, Regis_scale, maxshift, fix_y, fix_x, ShowRegisFlag) if nargin < 7, ShowRegisFlag = 0; end if nargin < 6, fix_x = 0; end if nargin < 5, fix_y = 0; end if nargin < 4, maxshift = uint16(2e15); end if nargin < 3, Regis_scale = 3; end maxshiftn = maxshift * Regis_scale; % cal...
c185d84c3a63ec5cdf519f8e9bb8a176c43830bbf58a0066d91c8bd21785739a
MATLAB
1,819
40
function plotLickAlignData(data,choice) if isfield(data,'lick') mouseName = data.mouse; expDate = data.date; nFP = data.final(1).nFPchan; nSweeps = size(data.final,2); left_color = [0 0.7 0]; right_color = [0 0 0]; time = data.lick.time; avgVel = data.lick.avgVel; velMat = ...
eb38f1be4b8ae5ea49992f298355c6ae4ee772d280f3e2c33dc14c3d66a0dd26
MATLAB
1,820
49
%Prerequest %rhd file with neural activity and behavioral data (ch4) %the first time point of ch4 is set as 10000ms, which means it needs at %least 10s before ch4 signaling %check session (wsq,ws,..) at the last line disp('select the RHD file'); read_Intan_RHD2000_file disp('select a spike csv file'); [file...
93d3da962d8488c3d6684f40e91b49b827c07624fbd9f77de145dc3c8ef4771f
MATLAB
1,821
33
function [MI, p_MI, ratio] = compute_MI_lme(data, demographics_tbl) MI = nan(size(data,1),1); p_MI = nan(size(data,1),1); for roi = 1:size(data,1) %tic % Extract data for this ROI this_roi = squeeze(data(roi,:,:))'; this_roi(:,roi)=[]; %remove nans to fit GLM (diagonal in FC data) missin...
beb3d5e1ceb8c9493c93c73490452401947fe3f9659f9ba9f9e1151797954044
MATLAB
1,821
36
% 测试文件夹中所有的Muli图片 clc clear load E:\SemanticSegmentation_Scale\CPL\GTruth_Revolve_1433.mat; load E:\SemanticSegmentation_Scale\Results\MuliImageSS_ResNet50_SeriesClass_ResAttention\trainedNet_resnet50.mat; InputPicBG_XPL = 'E:\B\*.png';% 背景原图的存放位置里的tif文件 InputPicPath_XPL = 'E:\B\';% 背景原图的存放位置 InputPicBG_CPL = 'E...
7d7f161a2cbd726b310b61d53c238efe92289743c328822370f8bff87fc9b3e9
MATLAB
1,822
51
close all clc clear % Load data files load 89_PNs_array_data.mat % Load the four odorants used for conditioning experiments % Hexanol, Benzaldehyde and Linalool % For each odorant 10 trials % Each trial is 40 s of data collection binned into 50 ms time bins - 800 % time bins per trial % Odor presented during 1...
815e226b5c53de700d78cd7b18e9bb76dff646e050b4f1758d07809b6847a27c
MATLAB
1,822
59
function SIs = Sp_Inf_Cont_2022_update(OccupancyMap, frs, count) % Computes spatial information scores (SIs) based on occupancy and count data % Input: % OccupancyMap - Occupancy map data % frs - Firing rates data % count - Count data % Output: % SIs - Spatial information scores ...
82d33b6ca5f929b91df90c98961a64385aadacaea49a299ceede5303ac45e340
MATLAB
1,824
56
% A script to test the vcg_construction.m function for generating VCG with % physical coordinates from multilead ECG data clear; close all; clc; datafilepath = '../../../../../DataFiles/physionet.org/files/ptbdb/1.0.0/'; fs = 1000.0; filelist = dir(fullfile([datafilepath, '**/*.mat'])); % get list of all mat files ...
e4463f49f6947354c34d469fc7ba9a9db413d24321a71c74078425a0af1b50e7
MATLAB
1,824
58
% Function that fits deconvolution % Input % X_SPARSE % Xest % XDupdate % FR % LAMBDASS % DRIVER % ActiveNeurons % Output % LAMBDASS % X_SPARSE % DRIVER function [LAMBDASS,X_SPARSE,DRIVER]=fit_sparse(X_SPARSE,Xest,XDupdate,LAMBDASS,FR,DRIVER,ActiveNeurons) % AllStdNoises=std(XDupdate'-Xest'); for c=...
9f1c47195e57136df6bde3c6d1fe2932152d271789caea88c1f24a0cb79ea647
MATLAB
1,829
87
%% 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; sub = 11; % thisSub = 861 for ses = 1:p.nSessions thisSub = p.subjects(sub); fpath = fullfile(p.rootDir,'minis...
db0149b23c03612a013bebff0643292754f6b004c7300db8f9e986a49a4e20a0
MATLAB
1,830
60
function phasecorelation20190522 cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\RtInLtFolder'); LS=ls; RtInLtPhaseArray98=[]; RtInLtPhaseArrayCx=[]; for i=1:length(LS(:,1)) RtInLtPhaseFL=strtrim(LS(i,:)); if length(RtInLtPhaseFL)>2 && strcmp(RtInLtPhaseFL(end-7:end-4),'...
be279bbfd12b244c2a2f1c59caab6aeb9a8584349da34e2a1f19587810aaa200
MATLAB
1,831
61
clear all close all %% Setup figure and image matrix width_height = [516 490]; % should result in A being 400 x 400 FontSize = 300; % chosen to fit 'W' and 'Q' (largest letters) fig1 = figure('Color', 'White', 'Position', [100 100 width_height]); fig2 = figure('Color', 'White', 'Position', [100 100 width_height]); ax...
c07af3a56efbcf3104c71df1060434d951f30d904412b76bf4e92ff1acc0556b
MATLAB
1,831
39
% function [Distance_Matrix_Num,Distance_Matrix_Length] = Find_Tree_Center(Workspace1) function [Cxy_Num,Cxy_Length] = Find_Tree_Center(Workspace1) Vertices1 = Workspace1.Vertices; Segments1 = Workspace1.Segments; Mv = max(abs([Vertices1.Vertex_Index])); Distance_Matrix_Num = zeros(Mv,Mv); Distance_Matrix_Length...
e0904ff91c0641448460af3f5781643b714d7cfc4b384793e0b1b47a3ad3491f
MATLAB
1,834
53
function bvs = add_dlc_data(p,bvs) for sub = 1:p.nSubjects sub thisSub = p.subjects(sub); for ses = 1:p.nSessions % load csv file trackPath = fullfile(p.rootDir,'results','behavior','dlc_results',['subject' num2str(thisSub) '_session' num2str(ses) '.csv']); ...
bb5edc844047bb0dc0540edad3f220250a22f9cf524afda15415f6b2a8f315df
MATLAB
1,835
43
% GIfTI Class for MATLAB % % Geometry format under the Neuroimaging Informatics Technology Initiative % (NIfTI): % http://www.nitrc.org/projects/gifti/ % http://nifti.nimh.nih.gov/ % % This MATLAB class is part of SPM: % https://www.fil.ion.ucl.ac.uk/spm/ %...
3408bd840013f34b685e51aca5d101c5b85294968a5a5051fbd7a99ffc630ce5
MATLAB
1,836
53
function [baseline, baseline1] = baseline_sliding_window_twice(x, L1, L2, approach) % baseline_sliding_window_twice - Baseline wander extraction from biomedical recordings using two stages of median or moving average filtering. % % Syntax: [baseline, baseline1] = baseline_sliding_window_twice(x, L1, L2, approach) %...
a048d64eec24a3c29d939d5d9a4fe7b28aad684c84b7f12255e8e980ee135e12
MATLAB
1,837
60
function Intervalcorelation20190527 cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\LtIntervalFolder'); LS=ls; LtIntervalArrayBgra=[]; LtIntervalArrayCx=[]; for i=1:length(LS(:,1)) LtIntervalFL=strtrim(LS(i,:)); if length(LtIntervalFL)>2 && strcmp(LtIntervalFL(end-7:end-...
326e3e1b0738626dbd30b3b5bfa83d41969f9893a6f306e7a7bd316df1721568
MATLAB
1,838
50
function y = bp_filter_complex_equiripple(x, fc, bw, factor) % bp_filter_complex_equiripple - Bandpass filter using an equiripple FIR filter % y = bp_filter_complex_equiripple(x, fc, bw, factor) % Bandpass filter using an equiripple FIR filter. % % Inputs: % x: vector or matrix of input data (channels x sam...
3467abd78108f42eb6396ff4fdbc4555d0de85850b4b2a990d47114a114fa3cc
MATLAB
1,838
49
clear clc %% ir x = [15.4000000000000;14.9000000000000;14.4000000000000;13.9000000000000;12.9000000000000;11.4000000000000;9.40000000000000]; cd('C:\Users\elyashivz\OneDrive - huji.ac.il\מחקר\current_analysis\DREEDS_VS_control\plot_control_vs_drreedds_per_cluster(figure5g)') load('dreedds_IR_mean_sem.mat', 'ir_m...
99fa0f8c8a11a7c2b417911a8194c15ba2dcb2765f6f022b0bdee0e4b0ef8e1e
MATLAB
1,838
57
function [pred, loss, loss2] = classify_ext_mat(layers, weights, test_x, test_y, ceps) layers{1} = cnnsetup(layers{1}, 0); layers{1} = initact(layers{1}, test_x); layers{2} = cnnsetup(layers{2}, 0); layers{2} = setweights(layers{2}, weights{2}); assert(size(test_x, 1) == layers{1}{1}.mapsize(1) && ... size(...
9c20353920d2e9061ee0bf8035d1cff56a9a8a09fb1df65a7e4bc056e6d73e2b
MATLAB
1,838
83
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_latency_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) yyaxis(app...
677c342fd206a33d0f0b4ade962cda968f70156c503659ee8bc2a0d32d544b8a
MATLAB
1,839
79
function [T, reuse] = build_gram(ob, W, reuse, varargin) %|function [T, reuse] = build_gram(ob, W, reuse, varargin) %| build "gram matrix object" T = A' W A %| in %| ob the system matrix A %| W typically diag(wi), having size [1 1]*size(ob,1) %| reuse stuff returned by previous call that can be reused %| the nex...
1fa76bf044a0c4f93c09e0e1bccd21ee241bf8e71d706b88f7343e68093cf04f
MATLAB
1,840
89
% function RunningXcorr for ECG phase wrapping analysis % Reza Sameni, 2015 % close all; clear; clc data = load('ECG1.txt'); fs = 1000; % data = load('16265m.mat'); data = data.val(1,:); % fs = 128; data = LPFilter(data - LPFilter(data,5/fs),50/fs); % x = data(1001:11000); % y = data(1001:11000); x = data(1:5000); ...
2bf1f0716e91261185114528b0f47724c7c3f69034bff933a8b5f9a23f6fcbc4
MATLAB
1,840
84
% Kalman filter of sleep signals sample entropy clear all close all % Data Sampling Rate: 100 Hz fs=100; % Read sleep signals [hdr, record] = edfread('original\SC4001E0.edf'); EEG1=record(1,30630*fs+1:31170*fs); % [hdr, record] = edfread('original\SC4011E0.edf'); % EEG1=record(1,21540*fs+1:22200*fs); ...
0b6e6d4ce41aaf88a710d32ed069f48f12fd0c40c10722312617a5684bb91e49
MATLAB
1,842
58
%% GC_Analysis % This script visualizes the GC-MS results of the blackberry leaf % headspace. % % Version: % 05-Jan-2024 (R2023a) % Prepare clc; clear all; close all warning('off') % Add toolboxes % A MATLAB toolbox for exporting publication quality figures % (https://github.com/altmany/export_fig) addpath(genpath('....
575c1dae9d4cfae4bae6b6e7e8c9c51b0a57cd7f362b290123b6c513c20e1960
MATLAB
1,842
53
function [numchannels,numfrequencies,numblocks,samplingrate,channels,frequencies,thedata]=openfreq(openfilename) % openfreq: opens a Cartool frequency data file (.freq) % % inputs: full path and name of the file to open % % outputs: number of channels, number of frequencies, number of blocks and % sampling rate as 1-D...
94207ecbd901edcbb84c849c6ab40d58a3a242478b7096db82c23dd29e01d9ed
MATLAB
1,843
62
%% Interclsuter Coefficient (ICC) & Effective N (Neff) % As defined in AArts et al. 2021 % % Input % X: numerical input data % Y: category of input data % Ouput % ICC: VarB/[VarB + VarW], where: % VarB: variance between research objects % VarW: the sum of the variance within research objects % % ICC...
7eb67122ef79905e04ed223b4be9453855705a41b291bcb16a47ec6bb9ee8eb6
MATLAB
1,844
53
function h = fig(varargin) % function h = fig(varargin) % % Copyright (c) 2011, Rafael Oliveira % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are % met: % % * Redistributions of source code must re...
aaf388b1b8989f08b49628f7027fa71d80ad6bb9cbd044b7ea5aac9dc2eb2ca5
MATLAB
1,844
49
function [p1_output, f] = getFft(rawS) %%Discrete Fourier transform. % % [p1_output, f] = getFft(rawS) % % Description: Discrete Fourier transform of multiple photometry signals, % previously extracted from data files using extractRaw_fft. % The function will pad each signal such that the vector to be an...
db2f550d32d3453f5bd595de400d970252213a4ff566101d76dd233923d20260
MATLAB
1,844
71
% Function to plot Calcium Transiens clean and raw % in a sliding window for a simultaneous video (other script) function showmeyoursignals(X_SPARSE,XD,Raster,SlideWin,NameOutSignals) %%Setup % if isempty(varargin{1}) % SlideWin=500; % else % SlideWin=varargin{1}; % end disp('>>Started to Visualize:') [Ns,Fram...
689a3f6e83de1097e453a861fbb9cbaecef20367e329fb38512bbffcbf6397c3
MATLAB
1,845
64
clear all, close all %% Plot time data, with Membrane off-on-off load Freq_res_data.mat fig = figure(1); fig.Color = [1 1 1]; fig.Position = [30 30 600 500]; ax = semilogx(freq_res.f, freq_res.Z, 'LineWidth', 1, 'Color', '#F5266D'); xlabel('Frequency (Hz)') ylabel('|{\itH}_{AB}| (dB)') ylim([-0.3 0.101]) ...
629c8a838eb2c0ea6b87bf8de47a8ed35da8296667ee68374c73e16d837cdf1d
MATLAB
1,849
47
% Script To Evaluate Which Category of Features % Classify the Best the Measured Conditions %% Setup %% Load Dataset Dirpwd=pwd; slashesindx=find(Dirpwd=='\'); CurrentPathOK=[Dirpwd(1:slashesindx(end))]; % Finder Spiker Main Folder % Load File [FileName,PathName,MoreFiles] = uigetfile({'*.csv';'*.xlsx'},' Dataset file...
a88160bda5083c8d26edba82f54585cdc06ca9b5b99763b22c8fd7eee54e7c27
MATLAB
1,851
80
function c = get_water_content(cmet,c1,c2,c3,Wat,lesions) %% c = get_water_content(cmet,c1,c2,c3,Wat,lesions) % % Function to extract % of classes from a spectroscopy voxel % % Added lesions (optional) to add a lesions voxel marsbar('on'); %if ischar(c1), c1=cellstr(c1);end %if ischar(c2), c2=cellstr(c2);end %if i...
04284393f42c0598ae76c56ed089575522f0266f0cd658cc7de755e894f4fb6c
MATLAB
1,852
66
%% PLOT PSTH BY STUFF like for phb [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save path %shift = 0.116; pretime = 3; shiras_shift = 1.1; binsize = 0.01; %% create...
add9e57d15a6c133c18c5f04b31baeefedfe70d255ccf7d80cff9ffab45b2c38
MATLAB
1,852
66
function out = fatrix2_subsref_brace(ob, iblock) %function out = fatrix2_subsref_brace(ob, iblock) %| %| Manage subscript references of the form ob{iblock} %| This will called from ../subsref with ob %| %| User can use subset_starts to select blocks in other orders %| in which case this "iblock" is really "istart" %| ...
c3cc8f93f8de6d012b40e5aa39c469b3a78c367ac4c100ad0610e521f1000251
MATLAB
1,854
56
function [] = amodel(session, channel, unit) % Approximates the fitted S-kernels with Gaussian functions % % Parameters % ---------- % - session: scalar % Session number with format: yymmdd % - channel: scalar % Channel number fprintf('===== A-Model =====\n\n'); main_timer = tic(); info = get_info();...
e550045ae4d3d89cecd37bd97599fcc7584d5e94d292a16188e7579604db43fa
MATLAB
1,855
94
function sn = nufft_scale(Nd, Kd, alpha, beta, Nmid) %function sn = nufft_scale(Nd, Kd, alpha, beta, Nmid) %| %| Compute scaling factors for NUFFT %| %| in %| Nd,Kd %| alpha {d} %| beta {d} %| %| option %| Nmid [d] midpoint: floor(Nd/2) or default (Nd-1)/2 %| %| out %| sn [[Nd]] scaling factors %| %| Copyright 2004-...
16ea12f96046e78a289dd55398fbb1f684fe49fe52efa99c4f16284a985847d3
MATLAB
1,856
52
function [tunedStart, tunedFinish, nBouts, tunedDuration, ... tuneFlagWeak, tuneFlagMed, tuneFlagStrong] = ... getTuningTimeInfo_paper(R2Vector, R2pVector) %% get tuning start and finish times + logical tuning flag binSize = 0.01; windowLength = 0.2; binVector = -0.2:binSize:1.8; binVector = round(binVector...
e929c43feecec714c30afbf414aec273f3dcdb982d09a48d5a6e1fd0f3d97ae0
MATLAB
1,857
41
function ratios = relative_spectral_power(x, fs, freqs, Q_factor) % relative_spectral_power - Calculation of relative signal power in narrow frequency bands % % Syntax: ratios = relative_spectral_power(x, fs, freqs, Q_factor) % % Inputs: % x: multi-channel input signal (channels x samples) % fs: sampling frequency...
7a9e09ab6423e1750d9a58d6f3db734b66bf4d8b0acf004e2b66373fb25e1236
MATLAB
1,858
70
function [ channel_observation , channel_hidden_states ] = generate_chmm_time_series( T , channel_num_states , channel_dim_observ , chmm_gmm_para , transition_chmm , pi_0_chmm ) C = length(pi_0_chmm); weight_state_column = cumprod( channel_num_states(C:-1:2) ); weight_state_column = [1;weight_state_column(:)]; wei...
f4756aae283bd62ad92f8db01e546b47783b7dd1baa3b37abb46640ad24c76bf
MATLAB
1,859
48
function check_input(F,y,X,opts) % Check that things are in order. % ------------------------------------------------------------------------ % Check F, y and X num_obs = size(y,1); num_features = size(F,2); assert(iscell(F), 'F should be a cell') assert(ismatrix(y),'y should be a matrix') assert(num_obs > 1,'y shou...
b7499593c7950f04966ab70478036875a88cf5bf3a0e736549e2ea8c61b10f61
MATLAB
1,860
57
function Generate_Orders_Result_Demo() % Run Example: Apply_To_AllFiles_SubDirs('tif'); Dir1 = uigetdir; % Let the user choose a directory. Files_List = dir([Dir1,filesep,'**',filesep,'*.','mat']); % List all .mat files under this directory (including subdirectories). Save_Dir = 'D:\Dropbox (Technion Dropbox)\O...
c89f5db7089fd3db13ca3f41310e47b973d4e41f85bf9c07b1b4ad4e365fb94a
MATLAB
1,863
54
function samplesOut = sgFilter(samplesIn, nDiffOrder) %SGFILTER Savitzky-Golay filter % works for a vector, matrix and tensor fInvert_filter = 0; useGPU = isa(samplesIn, 'gpuArray'); n1 = size(samplesIn,1); if n1 == 1 n1 = size(samplesIn,2); end if nDiffOrder == 0 sampl...