sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b22df11e6f81a51d285a2f7d12f603fd6b1035b60e41dcab0a7d57cb4707e070
MATLAB
2,691
82
function [xposfireone, xposfiretwo, xposfirethree, xposfirefour] = placeFiring2(nZones, texture, startAndEnd, distanceX, activeindices) activepts=zeros(nZones,1); activeindices=logical(activeindices); %indices of active points for all zones for zone=1:nZones activepts(zone,...
d0064d4b409513ea0c12ef6deb577d68c68088e1c2c95e5a24e5db34319beb92
MATLAB
2,692
74
clear, close all %% Frequencies plot % Data extracted from simulations, measures and analytical model in eq. 5 % of the paper. load data_frequency_analytical.mat f = figure(1); f.Color = [1 1 1]; f.Position = [25 25 485 425]; ax1 = plot(CL, freq, "LineWidth", 1.5, "Color", "#F5266D"); hold on ax2 = plot...
2a2d076c01fd688c455f9f0cc6cb90419179f3aeab608a5fed358219a4af5ca1
MATLAB
2,693
73
function [flag, val, errMsg] = validateProp(obj, propname, val) %VALIDATEPROP Ensure a property is valid if isfield(obj.oldParamSet, propname) % map the old param name to the new one propname = obj.oldParamSet.(propname); obj.isV3Import = 1; end flag = 1; errMsg = ''; % found i...
439143733047fff655cffe540003ad96ac3e718cc35444e8a842d94c95fd3a16
MATLAB
2,695
70
clear, close all load data_panels.mat %% Prepare figure main f = figure(1); f.Position = [30 30 1100 500]; f.Color = [1 1 1]; t = tiledlayout(1,2,"TileSpacing","loose","Padding","compact"); ax1 = nexttile; plot(R1on.Vin, R1on.V, 'LineWidth', 1, 'Color', '#F5266D') hold on plot(R1off.Vin, R1off.V, '--', 'L...
9e98b6e5385be807b8bd73beb6c9442323fe7f3d8d3e098021e06a93ee0e569e
MATLAB
2,695
81
%% Figure OVAs ************************************************************ function plot_ova(x1Grid,x2Grid,posterior,CMprobs,Xpca,ONEpca,labelconditions,... TWOpca,Y,CM,ColorIndx,RangeProbs,Yconfident) % setup Labels=unique(Y,'legacy'); numClasses=numel(Labels); % Plot: fprintf('>>Making Plot: ...\n') figur...
fc39f8673c6928096a09b6c7d45bd1d809204f9b3f424d26203bb38ce7277de3
MATLAB
2,697
66
function [LFParray LFP_aligned]=LFPCrossCorr(LFPsamples_RunCC,CCselect,GaussSmooth,MovW,Direction,TimestampArray,duration) %MATLABƒtƒHƒ‹ƒ_‚ÉNlx2MatCSC.mexw32‚ÆNlx2MatCSC.mexw64‚ð“ü‚ê‚Ä‚¨‚­B‚½‚Ô‚ñ‚Ç‚¿‚ç‚©•Еû‚ł悢B %timestamps‚Í270336‚¸‚‘‰ÁB270ms‚ÆŽv‚í‚ê‚éBtimestamps‚̐”‚˜512ŒÂ‚̃Tƒ“ƒvƒ‹B %270336/512=528. ƒTƒ...
16dae5db2e87dbfb66d5899c799b022c945f898566ba025897a3df7be91719e9
MATLAB
2,698
66
function update_intervall_popup(app) %update_intervall_popup updates the selection options for all popup menues %for the selection of specific intervals. to be called after intervalls %were edited % Detailed explanation goes here if ~isempty(app.burst_ints) names = {'full'}; for i = 1 : length(app.burst_ints)...
0bbb88d6911788ab511fda30c7b551267a207625fbd09563f64d74b7138b74e2
MATLAB
2,701
52
function idxStates = extractBehavioralStates(beh) %Extract behavioral states using data in beh structure. % % First column contains indices of samples during immobility, excluding % reward if present. % Second column contains indices of samples during locomotion, also % excluding reward if present. % Third...
6c411ae10955e0546f28c860397d2a25fe0d7b3b7c99d0b4b789b050eb2eac89
MATLAB
2,703
61
function [pval,rho,gr] = scatter_gramm(g,Z,labels,colors,color_fp,fp,varargin) % scatter_gramm plots a scatter plot using the gramm toolbox with the % parameters used to reproduce figure 9 in the manuscript. Statistical % tests are performed as well in accordance to whether the data is normally % distributed or n...
f864a3934895d00f1e0fe139d5bfaef95f3dda5886198caa676de6ca3a2cc98a
MATLAB
2,704
82
% This script takes the output files of `extract_checkerboard_task_rois.m` % and plots the result into a `.ps` and `.pdf` file. % % TODO: finish this script % % ------------------------------------------------------------------------------------------------------------------------- fmri = fMRIMethods; roi_list_name ...
85c81d9ae6d88e9151d4a5712e99a749d0e627e14f47b07f27f859b264041b6c
MATLAB
2,705
78
function Touches202003003 path=['C:\Users\C238\Desktop\touchcellLtRt_terashita']; cd(path); TouchesArray=[]; PNTouches=[]; morePPoint=0; moreNPoint=0; morePTouches=0; moreNTouches=0; OOTouches=0; NOTouches=0; NOTouchesFire=0; NOTouchesFR=[]; LS=ls; for i=1:length(LS(:,1)) TrimFolder=strtrim(L...
5d2c24025ff548875ce3c42ab2327a8f7130d84d7f50a398bd5ebf19cc77252b
MATLAB
2,707
108
%This will be the simulation script. Data is generated according to a %gaussian distribution. Currently requires the Mathematics toolbox to %generate the precision matrices: Omegas. addpath('pibdfc_functions'); seed = 2; rng(seed); %% Generating the data. N = 300; %The length of the time series Subs = 5; %The number ...
305ae4371426c7d7c1d58a9419ab167dbd22b6bd696284b8deaadbd7fb71eb14
MATLAB
2,708
57
% 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...
f622387050cce08ef50ac399366bb3c1a8468f5b839aefcf68f50281f7eadffc
MATLAB
2,708
164
function write_conc_res_summary_stat(conc,resname,field_list) dottest=1; stdrel=1; if ~exist('field_list') field_list = find_metab_list(conc); end fid = fopen(resname,'w+'); npool=1; fprintf(fid,'\n\n,'); for kf = 1:length(field_list) fprintf(fid,',%s,%s',field_list{kf},field_list{kf}); end if isfield(con...
9e96b91f10d164bc57279e11e28db1bf09b4ac8fd118c297cdb8890756566056
MATLAB
2,709
73
%% LDE iteration w/o figures % Output: Iteration firing maps, and L1 diff norm function [LDEEpoOut,L1DiffNorm] = ... LDEIterationMain(... PixInptCtgr,LDEIni,p,Epoc,... C_SS_mean,C_CS_mean,C_IS_mean,... C_SC_mean,C_CC_mean,C_IC_mean,... C_SI_mean,C_CI_mean,C_II_mean,... L4EmeshX,L4ImeshY,LDEFrfun...
7c328dcd335b5b0c17dec83551bbd5a31525db64d57ba0633c589dee26be1878
MATLAB
2,710
106
function parse_data_int(filename, max_memo_GB) % max_memo_GB is an idea of the number of GB allocated for the data to be % stored in RAM, so it is used to compute the number of segments in which % the data should be split for processing % Based in read_intan_data.m version 1.1, June 26, 2010 % (c) 2010, Intan Technolog...
ffa4c01b45bcfb65bca9ca9a5292b10db071f549d8db5eea5f3c744fb7cc5af4
MATLAB
2,710
92
function h=mnl_boxplot_NoChoices(data,ColumnNames,YvalueLabel) % Marcus' version of boxplot where outliers are not recorded, and raw data % points are plotted too % % Red line is the mean, red whiskers are the standard deviation, blue line % is the median, blue box is the interquartile range, and the blue whiskers % ar...
54f64a3c3a60da9f0426e1fe01814a6f99d0f12814b8bce12b3e358ab8c85ab2
MATLAB
2,713
109
function map = lbmap(n,scheme) %LBMAP Returns specified Light-Bertlein colormap. % % LBMAP(N,SCHEME) returns an Nx3 colormap. SCHEME can be one of the % following strings: % % 'Blue' Single-hue progression to purlish-blue (default) % 'BlueGray' Diverging progression from blue to gray % 'Br...
1c08d0fd11d6638ec59d1c2d4f6feb89faa88d1531118d2be2788cb5640ca5aa
MATLAB
2,715
71
% Statistical test for functional modularizations % % Example of how to use the toolbox for the statistical test in % "Correlations reveal the hierarchical organization of networks with latent binary variables" (2023) Stefan Häusler % Runtime on an Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz (28 cores): < 1 sec execut...
dc63d88b441a78947708b76b2a23c66404db406de6789a3fbfc07a8ba71d74ef
MATLAB
2,715
88
function lbmrn= mst_density(spatial,density) %INPUTS: spatial = spatial coordinates of the nodes % (M x d) = M # of nodes,d dimensions % density = number of connections divide by the possible number of % c...
ef2cdd84a1bddc9ddf47c02b43f66f8c93a7241f15c902031a59df42e9c89de4
MATLAB
2,715
117
% interp_table_test.m hr = @(t, J) (1-abs(t/(J/2))) .* (abs(t) <= J/2); hi = @(t, J) (1-abs(t/(J/2))).^2 .* (abs(t) <= J/2); % 1D if 1, printm '1d' L = 10; J = 6; s = [-J/2*L:J/2*L]'/L; hs = hr(s, J) + 1i * hi(s, J); if length(hs) ~= J*L+1, error 'size', end if im clf, subplot(211) plot(s, real(hs), 'c.-',...
b5b6f022db1047e36acb689df019b1fd0aa9f57bde713e1e913e86fb3ab0f9e8
MATLAB
2,716
71
function class_out = force_membership_wc(f_in, class_in, f_out, par) % class = function force_membership_wc(f_in, class_in, f_out, par) % Given classified points, try to classify new points via template matching % % f_in: features of classified points (# input spikes x n_features) % class_in: classificat...
0b4ed8df8b368ef63344c6e6feba4b0d1e4b3bd60bf4fff845c5a3a37b776d21
MATLAB
2,717
89
% first it checks the first session for each person, then the second % session, so on... % hogy simple-t is számíts: írd át a type1...type4-et clear all eegdir = 'D:\BORI\bedrest\RENDEZETT\A) Bedrest_EEG\Bedrest_PreEEG_amb_ctrl\EEGErps'; %change this for HDBR data plus_ident = '_'; plus_ident2 = []; referenc...
0951c64b283fee8a7c388e10f36897ceb0821f0b42a1c1463426a3aa7413fd11
MATLAB
2,718
126
%% generate synthetic neural signal and synthetic BG signal pad_size = 200; fr_size = 500; fr_size_pad = fr_size + 2*pad_size; sd_cells = 5; sd_bg = 50; % BG frame = zeros(fr_size,fr_size); randIdx = randi(fr_size*fr_size,30,1); frame(randIdx) = 1; frame_pad = zeros(fr_size_pad,fr_size_pad); frame_pad(pad_size+1:end-...
1dd26fd1d24ff02ab9722cca0eb661686d96bf6febdd8c348c431442165b418a
MATLAB
2,718
60
function Data = Collect_All_Neuron_Points(Data) Scale_Factor = Data.Info.Experiment(1).Scale_Factor; Data.Points = struct('X',{},'Y',{},'Length',{},'Angle',{},'Curvature',{},'Is_Vertex',{},'Dorsal_Ventral',{}); Data.Points(3*(10^4)).X = nan; % Memory pre-allocation. % Vertices = struct('X',{},'Y',{},'Order',{...
a249e97a6060d74156e1fefd0e3e295194070fe4a9f42c2e7657646675333b40
MATLAB
2,721
88
clear, close all load single_neuron_vin_osc.mat load vin_osc_measures.mat %% Prepare figure startt = 3; endt = 6.5; f = figure(1); f.Position = [20 20 350 800]; f.Color = [1 1 1]; t = tiledlayout(6,1, "TileSpacing", "compact", "Padding","compact"); ax1 = nexttile; ax1.LineWidth = 1; hold on l1 = plot(d...
22b900d407f5e188962e3cfe7451426d017ca0e40e16e7c89fe0c7a249d3aa92
MATLAB
2,723
97
% this script calculates the average value of Free Water fraction in % selected ROIs clearvars close all addpath(genpath('/storage/stella/MATLAB_toolboxes/')); addpath('/storage/stella/Analysis/matlab_scripts/'); %% Select inputs masks_path = '/07_FAST_FIRST_outputs/FF_PVESEG/'; FWF_name = '_01_csfVolumeFraction_MAP_...
d80d7ec492008ea814b2c312c681ffc477151a57b7003b6608b4b81b104f2bdd
MATLAB
2,728
66
function [y, W, A] = spectral_component_analysis_bp(x, fl, fu, varargin) % spectral_component_analysis_bp - Spectral component analysis (SCA) using % time-domain bandpass filtering approach. Extracts and ranks linear mixtures of % multichannel data with maximal energy in a given frequency band. % % Usage: % ...
aecfaaf6b4d80d50c1b38026e9138049355e833032252755e62790481fb9f625
MATLAB
2,730
99
function modulation20190705 global ACresult ACresultW CCresultDrinkOn SpikeArray TurnMarkerTime RpegTouchallWon LpegTouchallWon... RpNum LpNum CCresultSpike locsP1time locsP2time locsP1time2 locsP2time2 pksA1 pksA2 CCresultRtouchWon CCresultLtouchWon dpath3... StartTime FinishTime DiffMaxMinR DiffMaxMin...
29cef3ab4315d3f37ed7358c00a513bd7c9f5bc7514a836b89166b90ac7e97ee
MATLAB
2,732
91
classdef SortTest < matlab.unittest.TestCase %SORTTEST Test spike clustering properties hJRC_CPU; hJRC_GPU; end properties (Dependent) res_CPU; res_GPU; hCfg_CPU; hCfg_GPU; end methods (TestClassSetup) function setupProps(obj) ...
44f9bdcb1448db5b039c753a02883e3d88798198aab4fd68bbeb8767ecea6466
MATLAB
2,732
102
clear; clc; close all; rng('default') assert(~isempty(strfind(pwd, 'embanded/examples/matlab')), 'Please change folder to the examples directory') run(strrep(pwd,'examples/matlab','setup.m')) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Simulate data. % Generate some training data num...
4b3b0c6f42dffcb836397e00c6ed99f8e72c00c77fc6dc321205fc3be0b15c3a
MATLAB
2,733
109
%% Figure S8a load('sampleLFP.mat') % Define parameters fs = 1000; filter_order = 4; ct = [4 10]; ct = ct / (fs/2); % Design a bandpass Butterworth filter [b, a] = butter(filter_order, ct, 'bandpass'); % Apply the filter to the data bpasstheta = filtfilt(b, a, double(head_movLFP)')'; % Compute the ana...
3e0d044a5f6966d5b2896b919cc27456dadc816c047a064f946d66a437d03798
MATLAB
2,734
98
function Randomizer_ShowHitDurationResults(out, flag) % Copyright 2009-2011 Thomas Koenig % distributed under the terms of the GNU AFFERO General Public License if nargin < 2 flag = 0; end figure(105+flag); clf DoF1 = (numel(unique(out.Design(:,1)))> 1); if size(out.Design,2) < 2 DoF2 = false; else...
bb5eeb81cc62dd0689c71b860e6ea2b1d6d390fe36cf81b801c9955dae771f90
MATLAB
2,734
95
function show_r3_point_set(points_x,varargin) %SHOW_R3_POINT_SET 3D illustration of a point set % %Syntax % show_r3_point_set(POINTS_X,options); % %Description % SHOW_R3_POINT_SET(POINTS_X) uses a 3d plot to illustrate a point set in relation to % the unit sphere S^2. % % The argument POINTS_X must be an array of real ...
10393c42afcca4f0f9bb274254e395e86b84c696409da45fe29d4591d56a96a4
MATLAB
2,735
82
function reset_results(app,res_data,res_derived) %UNTITLED Summary of this function goes here % Detailed explanation goes here if res_data app.data = []; app.comments = []; app.settings = struct('interval', [nan, nan; nan, nan],... 'channel_sheet', [nan, nan],... ...
3cdae367cdf6d3f8ccc636320bcd33b24ff528dec3a74bf7c1427f6abd4d2a14
MATLAB
2,735
92
function supp_fig4_region_dos(folder, save) %% Supplemental figure 4: DOS region diagonal graphs (right side) %% Load if nargin == 0 folder = 'All'; end load('structures', 'structures', 'regions'); load(fullfile(folder, 'data'), 'dos', 'mode', 'thresholds', 'nodelist'); N = size(dos.density{1}, 1); NR = length(re...
5a967b0851af969cdf3e69f784f3c8b89eb27fffd1e8037356ae62ef929ed6d7
MATLAB
2,735
49
%% Extracting SNPS with main effects for variant prioritization for interaction testing snps=readtable(strcat('D:\Canada_2020\UK_biobank\reports\AD\genetics\EURnoWB\METAL\FUMA_WMH_META\GenomicRiskLoci.txt')); snps.Trait=repmat({'WMH'}, [length(snps.rsID),1]);snps.TraitNum=100*ones(length(snps.rsID),1); allsnps=snps; s...
235cc283666dd8f991d10f8252a9732592cd671289171089b396b0aaa4ff1755
MATLAB
2,737
104
function DrinkTouch_Analysis(DrinkOnArray,DrinkOffArray,RPegTouchAll,LPegTouchAll,TurnMarkerTime,DrName) % RPegTouch‚¨‚æ‚ÑLPegTouch‚ðDrink‚Åalign‚µ‚½‚Æ‚«‚Ìfrequency‚ð”äŠr‚·‚é global DrinkOnArray DrinkOffArray RPegTouchAll LPegTouchAll TurnMarkerTime DrName DrName % ACselect=DrinkOnArray; ACselect=DrinkOffArray...
d79d426f154377f95d5f18cd6fc4a65ed537933ee49d5b5c8a27cec41e09d576
MATLAB
2,737
100
function processing_LCmodel(type,preproc_dir,par) if ~exist('par'),par ='';end defpar.sge=0; defpar.jobname='lcmodel'; par = complet_struct(par,defpar); if ~exist('preproc_dir') preproc_dir = ''; end %if ~isempty('type') % type='ws'; % type='mega'; %end root_dir=pwd; sel = spm_select(inf,'dir','select a dir...
16f7eea900f24fe153ae36795c57ac51d7800771d79abd3336ecf15099a8524c
MATLAB
2,738
88
function k = findknots(x, nknots, varargin) % % Description: % This function finds suitable knots along the ECG signal for spline or % polynomial fitting. Starting with the first and last samples as initial % knots, it iteratively selects points with the maximum distance from the % reference line (the lin...
ea8f75e6a8e87566da32293117f886e9352dc062379d39096da8152770065cb4
MATLAB
2,738
84
function [WS_m, parcel_ws] = senpai_spinecatch(seg,cIM,sz_th) % senpai_spinecatch: % takes the result of a k-means clustering performed by % senpai_seg_core and % defines catchment basins for branches with watershed method. % Dendritic spines are expected to fall within the catchment ...
72408ddb7546128521b3d81b5f037614204e4a4a05276c5145255f6d05a2655e
MATLAB
2,739
70
function [feature_vec, feature_info, mean_beat] = ecg_snr_features(data, R_peaks_indexes, increasing_beat_length, Pre_Rpeak_segment, Post_Rpeak_segment) % function [feature_vec, feature_info, mean_beat] = ecg_snr_features(data, R_peaks_indexes, % ...
dc2f912b4372a9fb315cc209ef6444060cb858fa3ab8514cf2c8b11d5bc90053
MATLAB
2,743
116
function Analyse_Osteocytes_python(filename, foldername ) diary ('matlab.log')%------------------------------------------------------- % Filtering, automatic thresholding, segmentation and % skeletonization of osteocyte lacuno-canalicular network % based on confocal image stacks. % % Philip Kollmannsberger, las...
e68dad062553063a45f23fdbda7e5b8f1b8cd3808d96881c98f443b03277638c
MATLAB
2,743
63
clear all close all clc %% load example multisubject FC matrices load example_mats.mat A = A(:,:,1:5); [N,~,T] = size(A); % number of nodes/layers C = cell(T,1); % create cell array for i = 1:T % populate array C{i} = A(:,:,i); end %% set some parameters gammarange = [min(A(:)),max(A(:))]; % range of ...
bd34da530f6c9463cad98c8e56870f5920fe72878f70ae01d1556194a81b9a57
MATLAB
2,749
93
function generate_maps(category) %% Generate maps % This function should generate all maps used for the figures, and store them % in designated folders with their respective figures or something? %% Select experiments, folder etc. if nargin == 0 category = 'All'; elseif ~ischar(category) category = char(catego...
f3cdd391eb99a3e578ac0e7af0e37a213b75865f3bfd0e82a620f1671f141eaa
MATLAB
2,750
80
function [spikes] = spike_alignment(spikes, par) % spike_alignment_batch % function for alligning spikes detected outside wave_clus. % INPUT: Matrix of spikes in an ascii file. Spikes must be grouped in a % matrix called 'spikes' with a spike per row. % OUTPUT: matrix of spikes alligned with the maximum in sample set...
df80b66b388048c570072d604bcec7329c6e8679e5e87c7847ba60090685361a
MATLAB
2,752
76
function derived_burst_signals(app) %DERIVED_CARDIAC_SIGNALS interpolates the hb_res.dt_instantaneous % Detailed explanation goes here tmp = nan(1,length(app.data)); idx=0; for i = 1: length(app.data) tmp(i) = app.data(i).tic_multipl; if strcmp (app.data(i).name,'BURST INTEGRAL') idx = i; end end...
5488e4943cfbe27e28ecbea894858bc13ef67fe77b252016e1d98916cbc6503f
MATLAB
2,756
84
function exportToHDF5File(objs,fobj,save_path,conversion_options) % % adi.channel.exportToHDF5File % % See Also: % --------- % adi.file.exportToHDF5File DEFLATE_VALUE = conversion_options.deflate_value; MAX_SAMPLES_PER_READ = conversion_options.max_samples_per_read; CHUNK_LENGTH = conversion_op...
f20da48ea40933e14eebd8bc1b1559e4d64df81e579f524fb8fc35c3495e0153
MATLAB
2,756
73
function y = bp_filter_complex_ma(x, fc, bw, order) % bp_filter_complex_ma applies a zero-phase bandpass filter to the input % signal using a multi-stage moving average (MA) filter with complex-valued % frequency shifting. % % Syntax: % y = bp_filter_complex_ma(x, fc, bw, order) % % Inputs: % x - Input...
2688fd086bbdf99d8aeb0c02de9680e6e4a1aaf9c8378dbf121a14ac78a55fad
MATLAB
2,757
75
function [spikes, spike_times_all, n_ch, present_unit_ids] = construct_spikes(firings, templates, Fs) % NOW ASSUMES EVERY UNIT IS ON THE SAME SHANK (SINGLE SHANK DEVICE) n_ch = size(templates,1); n_clus = size(templates, 3); % disp(n_clus) START_TIME = 0*Fs; DURATION = 400000*Fs; % more than ten...
7fc17a291d425faf8565a9240a2256d9a1210779924dffea7a9d6b9519bb6427
MATLAB
2,757
85
function gui_cg() % % This function is needed by FASTICAG % This file just removes the global variables % that are used in FASTICAG from the memory % 8.5.1998 % Hugo Gävert clear global c_FastICA_appr_strD; clear global c_FastICA_appr_strV; clear global c_FastICA_dMod_strD; clear global c_FastICA_dMod_s...
850e50f71db8877384f0781b046916d7261bebb78566000634956afec6ef8432
MATLAB
2,757
96
%% plot diam distributions this_cols = {'g','r'}; this_alpha = {0.5,0.6}; saveFigs = 1; ad = cat(2,all_diam{:}); ad = ad*1.25; % convert from pixel to microns av = cat(1,all_valid{:}); figure('Position',[100 100 300 300]) hold on histogram(ad(av ~= 1),0:2:60,'Normalization','Probability','FaceColor',this_cols{2},'Fac...
6b9ad899ea5b75362885a9b31f3ac65370347d8207e0f47e64d61b459db1213d
MATLAB
2,758
75
function p = mcnemar(x,varargin) %MCNEMAR: Permorm McNemar's chi square on a 2x2 matrix % In statistics, McNemar's test is a non-parametric method used on nominal % data to determine whether the row and column marginal frequencies are % equal. It is named after Q. McNemar, who introduced it in 1947. It is % applied to ...
876662ed22085bc92c231f03eb89ffea97a9341caa5ff37207bd7109770ca41b
MATLAB
2,758
87
function intervals =... calcR2overtime_paper(spikeCellArray,binLengths,binStarts,opts) %% get metrics over different time windows % function simply loops through required intervals (defined in bin space) % and %% inputs: % - spikeCellArray: each cell is a condition, with nTrial cols and nBin rows % - binLengths: ...
fc4b9b2c65e238d1f3d3f39c513b2c7e21b1695d12beab6edaf0b13d01ef50be
MATLAB
2,760
99
classdef JRC < handle & dynamicprops %JRC Handle class for spike sorting pipeline properties (SetObservable, SetAccess=private, Hidden) errMsg; % isCompleted; % isError; % isDetect; % isSort; % isCurate; % end proper...
8d05c84d459bcd016ccfd423e7b957ae56fd5008ac7c651aff82fcf3924a6cfe
MATLAB
2,761
89
function yhat = lsqisotonic(x,y,w) %LSQISOTONIC Isotonic least squares. % YHAT = LSQISOTONIC(X,Y) returns a vector of values that minimize the % sum of squares (Y - YHAT).^2 under the monotonicity constraint that % X(I) > X(J) => YHAT(I) >= YHAT(J), i.e., the values in YHAT are % monotonically non-decreasing wi...
98b53bb002e7e3225c7e8ce790268cc4c34e8c7d59a2e018a6f5a30b66736c38
MATLAB
2,764
82
classdef pointer < handle %POINTER manages the data to display and the rwaves to display % Detailed explanation goes here properties start_idx stop_idx dspl_idx pre_idx post_idx dur ax_1 ax_2 length end events ...
941ff602db175231c7de5f75da1917ae9e4e0296fe01c6e268e731520829ad92
MATLAB
2,765
87
function y=sgolayfilt(x,k,F,W,DIM) %SGOLAYFILT Savitzky-Golay Filtering. % SGOLAYFILT(X,K,F) smoothes the signal X using a Savitzky-Golay % (polynomial) smoothing filter. The polynomial order, K, must % be less than the frame size, F, and F must be odd. The length % of the input X must be >= F. If X is a m...
82ec878b861a8194fe8bb293f5f3d8851fdafb938e0963146e4c9a778b1cf010
MATLAB
2,766
95
function ICAtests(x,emb_dim,emb_tau,kneig,algo,kmax) % Reliability test for any ICA output (linear transformation version!) % Output: Dependency Matrix, Variability Matrix, and MI vs rotation angle % plot (to check if the components are indeed the most independent one) % x....input data mxn m...channelnummer n...s...
a4d2df926a2633e143fff109b39bc11da1e82527d2dd2f9db6f19899c7a0aae0
MATLAB
2,768
64
function [threshold,bic] = ggmm_thresholding(stat_filename, mask_filename) % read the data (spmT and mask), call the EM code and return the T value % for the cluster forming threshold % % FORMAT: [threshold,em,bic] = ggmm_thresholding(stat_filename, mask_filename) % % INPUT: stat_filename: full name (ie with path) of ...
d84ae4b60484b8fc470b14b610925101889e3803da7a84b129f6836e8a5130ef
MATLAB
2,768
51
function Coordinates1 = InRect_Coordinates(Mat1,Rxy) % TODO: % flipud. the y-axis is now upside-down. % maybe I can use the sign(+\-) of the distance and check only 2 perpendicular side (instead of 4). % Scale 'S' based of the # of pixels in the smallest bounding matrix. % Make sure the coordinates of the re...
da54b217a4ceaa1629b3792a1d4ca9b4eb2497633299b845913f84948d0a6f42
MATLAB
2,768
90
close all; clear; clc; resultfname = 'testFreqDomainEnergyIncreaseRate01.txt'; % parameters subject = {'Dog_1', 'Dog_2', 'Dog_3', 'Dog_4', 'Dog_5', 'Patient_1', 'Patient_2'}; ffs = 160; % resample rate f0 = 60; % powerline frequency Hz Q = 30; % notch filter Q-factor % wlen = [0.5 1.0 3.0 5.0 10.0]; % energy window le...
6463f8b82ffd7e76c35c4935d1e1a99badcea4fe867ff59fd9ef3eea462fdb8f
MATLAB
2,770
56
function [outUnit] = burstIndex(unit,raster) %get the input data, and then run all the periods % outUnit is slope and then intercept of the bursting period, and then the same % for the late period. OutFRs is firing rate, and then burst fraction %https://pubmed.ncbi.nlm.nih.gov/9246432/ %tasks = fieldnames(Data.(unit));...
3524d9437917aa5f29239b822f3f181584f689ee2686cd8c65e59a04b7de5b5b
MATLAB
2,771
106
clearvars -except ONimageS OFFimageS refpic Error EC %% Calculate Rsp CC1 = EC;%total; NF=size(ONimageS,1); rep = size(ONimageS,2); currRsp = zeros(CC1.NumObjects,NF,rep); for ci=1:CC1.NumObjects area = mean(refpic(CC1.PixelIdxList{ci})); for j2=1:NF for j3 = 1:rep if...
069fa713a6e40e26f78a05b039f76dd61bae71c3ceba2f54d3b1122f9d8c0b1e
MATLAB
2,772
42
%clear % - can't use clear if running in loop (e.g. SUMMARY==2) or using !!MAIN_figs!! DATA_DIR = 'C:\Users\shirt\Downloads\anxiety-main-finale\anxiety-main'; %AZ changed accordingly ALL_DIR = strcat(DATA_DIR,'\\All'); % SUB_DIR = strcat(DATA_DIR,'\\Subjects'); GRP_DIR = strcat(DATA_DIR,'\\Group'); WORK_DIR...
b8d593b9f74f23a273615901bf2461acad0436447fb4b38742c5501af85f3859
MATLAB
2,774
80
function [index, rank] = sqi_saturation_detector(x, varargin) % sqi_saturation_detector - Signal quality index based on saturation detection. % % Usage: % [index, rank] = sqi_level_crossing(x, bins, ranking_mode, edge_bins_to_average) % % Inputs: % x: Input signal matrix with dimensions [L1, L2] % bins (o...
3eb24f10ca95c7873315807328b68857e135e9f2b83772ed3aea77af7fd271c9
MATLAB
2,777
81
% ************************************************************************* % * Test program for Instantaneous Phase estimation using the Zer-pole * % * Perturbation Phase estimation method (Z-PPP) [1] through analytic * % * representation, IIR filters and forward-backward filtering. * % * Refer to th...
c91b0ab193bca541bb967fc850e6d0f0d825dde5d689a814a7ac83b397af2fa1
MATLAB
2,779
86
% function [vlKeep_ref, channelMeansMAD] = carReject(vrWav_mean1, P) function [keepMe, channelMeansMAD] = carReject(channelMeans, blankPerMs, blankThresh, sampleRate) %CARREJECT channelMeansMAD = []; channelMeans = single(channelMeans); blankWindow = ceil(sampleRate*blankPerMs/1000); if blank...
5b4529eb59c85e1d77ea086df83947bb036c37eaa45a7bf3dc1d6fa86ff146d1
MATLAB
2,781
85
function helpbox(message) % helpbox(message) % % This function overrides Matlab's helpdlg box, since it is quite awful. % This function ensures font will be displayed big enough for both % windows and mac computers. % It also allows one to include new lines '\n'. % Copyright Benjamin Cowley, Matthew Kaufman, Zachary B...
2b94f9b4a5792c7924c12cd2f8407392e9c84405ec2feaca21712f20d3b0540d
MATLAB
2,788
86
%% save all_data files to breain render table % (10) cells that are both transient and sustained intensity-encoding. % A map showing the (11) cells that are transient intensity-encoding, (12),% cells that are sustained intensity-encoding, % all recorded cells. clc clear [file, path] = uigetfile('*.mat','MultiSelect','o...
b2513fde1936da275af3e00fe52852cf85f64c575976dcba6b1e60126d1b1a9b
MATLAB
2,788
93
function [AUC1, AUC2, meanTIMESERIES1, meanTIMESERIES2, maxTIMES1, maxTIMES2, Pvalues] = visualizeBOLDresponses(BOLDresponse1, BOLDresponse2, ROIname, resultpath, colors, type, stim) % This program is intended to visualize and calculate the BOLD signal. % % input: % BOLDresponse1 % BOLDresponse2 % ROIname % re...
41694e85c9fdc0a93f7224085fb34e430291e02b5b2506ee0b02eb15397b6d56
MATLAB
2,789
79
function [Training_Frames,Training_Classes] = Generate_Training_Set3(Frame_Half_Size,BG_Samples_Num) TrainingSet_MaxSize = 50*10^6; TrainingSet_MaxSize0 = 10^6; % Min_Num_of_Neuron_Pixels = 0; Training_Frames = {}; % xTrainImages. Training_Frames(TrainingSet_MaxSize) = {1}; Training_Classes = []; % tTrain. T...
712120cbe73bbfd2a62e497d54f679eeccf7148070c41bb18a7df27c4cb33663
MATLAB
2,790
61
%% RdLight Paper Figure 1E %% Light Artifact Across Time: NAc load('N1609A_fig1d_L.mat') concatenate = [data.final(3).allFP_dFF(:,2); data.final(3).allFP_dFF(:,3); data.final(3).allFP_dFF(:,4); data.final(3).allFP_dFF(:,5); data.final(3).allFP_dFF(:,6)]; % Need to multiply the baselined values by 100 to get perce...
03d9e0aeb3762dd3b8f964fa12b4e2c02e406671c7800e455dfcf9df382de2cd
MATLAB
2,792
105
%% Plot rate functions from LDE data % Input: L4EPlot Grid for E Y*X % L4IPlot Grid for I Y*X % FrLDE LDe computed firing rates (XY)*5: SOn COn SOff COff I % a1,a2 lengths of X Y range % CtgrName Name of OD Category % ODCtgr OD Category: 1-3 % CellCtgr: S C I % va...
086c20eadd7fba2be9314f51d4d30269a54e0a918e913d27df8c8cca8cac270d
MATLAB
2,793
68
function update_intervall_popup(app) %update_intervall_popup updates the selection options for all popup menues %for the selection of specific intervals. to be called after intervalls %were edited % Detailed explanation goes here if ~isempty(app.burst_ints) names = {'full'}; for i = 1 : length(app.burst_ints)...
730c48626a67b66206d01520e84c7b279ebc14c6c8c7621eab4bc722efa4fd19
MATLAB
2,793
73
% A script demonstrating how updates to the ionic activity coefficients involving decadic rather natural logarithm (see our comment/annotation at the % Elife article https://elifesciences.org/articles/48890) maintain a very similar-to-the-original % behaviour both for the fixed-Cl and dynamic-Cl variant of the model. %...
16cde915450b0fdbfcaa562e6cdb63952ef21a45ac1fec84f7790ad88f73ac88
MATLAB
2,794
64
function [peth] = getClusterPETH (st, events, bin, window) % Peri-Event Time Histogram (PETH) - alignment of spike times to event time % % [peth] = getClusterPETH (st, events, bin, window) % % INPUT % Note: all inputs must be in same time scale (e.g. seconds) % 'st' - cell array with spike times % 'events'...
28d6c37c9f4cb05785c1d0fd23ba51ce8a595e35ee379a199eb4bb72c829fcd7
MATLAB
2,794
76
%% ENTROPY ALGORITHM --> LOADING ONE CHANNEL fs = 12500; %sampling frequency (for Axion) WS = fs*0.5; %window size to calculate Spectral Entropy in samples fs for 1s overlap=0.5;%other than 0.5 makes it more complex and code needs to be changed TotalDataSample = length(DataCell{1,7});%length data in samples SElength = ...
41c00c05dd49c63c747b1bec7775f3505850230b31449d6c51b76833643747f9
MATLAB
2,796
90
function [sqrl] = Holsclaw_Param2(sqrl_old, st_ind, xDat, a, b) %% This function is a Gibbs sampling step to sample new values for the log linear coefficients %% in the Holsclaw et al. paper for sampling from heterogenous HMMs. %% Inputs: % Xi_old: The values of the Xi parameter for the previous iteration % Z: The a...
f720ca9d14462918f565436f96f383da62dc7cbcf68a7e46ce25c247ea1528cd
MATLAB
2,798
81
%% Remove effect of spike rate: clear; load H1\H1_Data_Simple; %% lambda = 0; ynlags=50; unlags=25; npc=5; % PCA cuts=[10,5]; %% exclude high spike cases from bright time data trials_to_include =1:135; [Y,Ylag,U,Ulag]=prepYU(Y_trial,U_trial,ynlags,unlags,trials_to_include); spikes=sum(Ulag>0,2);% calc spi...
a89d788ca390826d9e0b1497ee837acc6b2284af1e98eddba4e7f067028d76d8
MATLAB
2,802
88
function S = loadMetadata(metafile) %LOADMETADATA convert SpikeGLX metadata to struct % TODO: build into Config workflow to cut down on specified parameters % get absolute path of metafile metafile_ = jrclust.utils.absPath(metafile); if isempty(metafile_) error('could not find meta file %...
b2392bd41779feb939f52b0f02a0ea2f1c7e135b1de24f9b4ea89212f8595778
MATLAB
2,802
73
%% all ramps from all data clc %% get relevant parameters [file, path] = uigetfile('all_rampT.mat');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) load(file) baseline = cell2mat(cellfun(@(x) x.mean, allT.baseline_vector,UniformOutput=false)); psth = ce...
7b0b88c2da604c2e6f23a6a8bcc3f70c79d3896d0495472c6d84c8e74075d469
MATLAB
2,803
85
function terashita190508 %ƒ^ƒbƒ`ŠÔ‚ÌˆÊ‘Š‚©‚çƒ^ƒbƒ`‚ɑ΂·‚é”­‰Î‚ð—\‘z‚µ‰¼‘z‚Ì”­‰Îƒpƒ^[ƒ“‚ðƒ^ƒbƒ`‚ōĂуAƒ‰ƒCƒ“‚·‚é cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); dpath=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\'); dpath3=('C:\Users\C238\Desktop\Cheet...
c32653e70192f03ef9e2f949e18115b0064a89df0956c7526c63a4c08967b138
MATLAB
2,803
73
% This function reads the PMDFs of the feasible channels selected by AD from the % PMDFs.data file and place them in the allPMDFs matrix % % INPUTS: srcs sources selected by AD % dets detectors selected by AD % nVoxels number of GM nodes % minR...
b85995ccfafb6161363b7ef2657ad63a13d3777e48af080973c25725695ad957
MATLAB
2,804
141
function [T,N,M,H,VV,PP,XU,XD,Fext]=HHmodelWpiston(gkFactor,gmFactor,ghFactor) %Best results in: %50,5,0.5 which come out to be 0.103, 0.0103, 0.00103 Cm=1; %R= an=@(x) 0.01*(x+55.0)/(1.0 - exp(-(x+55.0) / 10.0)); am= @(x) 0.1*(x+40.0)/(1.0 - exp(-(x+40.0) / 10.0)); ah=@(x) 0.07*exp(-(x+65.0) / 20.0); bn=@...
d0fdf38b37b3456ba3f52c8d6d585666703a0eeac9c2c2c246e125b150c769be
MATLAB
2,807
73
function data = alignData2Rew(data,tBefore,tAfter) %alignData2Rew - Align photometry and velocity data to reward delivery % % Usage: % data = alignData2Rew(data,tBefore,tAfter) % % Description: This function aligns data to the delivery of a reward % within a specified window. % % NOTE: If you per...
38ee520927b1a7a061428b63a44fdabed89f90e120b797661aa9e85d4419f84a
MATLAB
2,808
74
function probe(obj, probeFile) %PROBE Plot a probe layout if nargin > 1 [~, ~, ext] = fileparts(probeFile); if isempty(ext) % a convenience for a forgetful mind probeFile = [probeFile '.prb']; end probeFile_ = jrclust.utils.absPath(probeFile, fullfile(jrclust.utils.b...
ba100c100572df7adb336cd21a8a2e7a96327ab0ab13c83230972c75e2120bb8
MATLAB
2,808
78
function RLphase global ACresult ACresultW CCresultDrinkOn SpikeArray RpegTouchallWon LpegTouchallWon TurnMarkerTime RmedianPTTM RpegMedian LmedianPTTM LpegMedian... RpNum LpNum OneTurnTime CCresultSpike locsP1time locsP2time locsP1time2 locsP2time2 bin=20; phase1R=zeros(1,bin); phase2R=zeros(1,bin); phase1...
521f19132d4e6e9c05e8ace0a815ff43051b044fb39a29aa112b35bf228e3499
MATLAB
2,812
100
function td_data = load_atis_data(filename, flipX, flipY) % td_data = load_atis_data(filename, flipX=0, flipY=0) % % Loads data from files generated by the ATIS CAMERA % This function only read (t,x,y,p) and discard other fields (if % any) of events. % timestamps are in uS % td_data is a structure containing the fields...
05ab4a5c7df62b55e951ef556d560e393a3f81d96a587fe997df09ee7010bc93
MATLAB
2,813
72
function [Signal, t] = simulate_aperiodic_eeg2(Exponent, Offset, Duration, SampleRate, WelchWindow) arguments Exponent = 2; Offset = 2; Duration = 30; % seconds SampleRate = 250; WelchWindow = Duration; end % [Data, t] = simulate_aperiodic_eeg(Slope, Intercept, Duration, SampleRate, WelchWindow) % ...
eaa80f76930a60030be7fd6867b755a95cab598cae1b035ed38dfa724e8d938f
MATLAB
2,813
86
function Matching global ACresult ACresultW CCresultDrinkOn SpikeArray RpegTouchallWon LpegTouchallWon TurnMarkerTime RmedianPTTM RpegMedian LmedianPTTM LpegMedian... RpNum LpNum OneTurnTime CCresultSpike locsP1time locsP2time locsP1time2 locsP2time2 fname tfile WaterOnArrayOriginal A1Rt A2Lt htouch TouchSpik...
eb88309b3f43f0d5c81534d488b407ae3b952d53ddb68957e9b7e369fe52fff5
MATLAB
2,813
87
% smm to tif file, a file or all file in a folder //MJ 2121 clear all %% Filme Info. path = '/Users/brunger/Dropbox/archive/programs/single_molecule/smCamera_conversion/smm_conversion/examples'; AllFileInFolder = 'y'; %'y' all smm file in the folder will be converted filehead = 'film1'; % for single file %% ...
f47766f5186c3cb4a756fd85d41ee12b04b9bc6bcc5a2b117a416605c21961da
MATLAB
2,813
99
clear all % this script contains code to reproduce Figure S9a-c %% load data % drag and drop corresponding file (S10 Data) %% data content description % variables contain average T scores from GLMs (.Tmoy) and uncorrected p values % (.mask) % I_awake_ChR2 is from awake animals expressing ChR2 in M2 % ...
bb60acb402a6bcb7d8c2276dcebdb3cd3e1166e70ade833d56ca309759031b76
MATLAB
2,814
61
function [pval,effect,gr] = boxplot_gramm(g,Z,colors,varargin) % boxplot_gramm plots a boxplot using the gramm toolbox with the parameters % used to reproduce figure 8 in the manuscript. Statistical tests are % performed as well in accordance to whether the data is normally % distributed or not. % % [p,d,gr] ...
cd249339581d0f44d73645a7fa33dbb49668d02a3c24fba42ab7646fec0891ac
MATLAB
2,815
66
function data = processOnsetOffset(data,params) %Process Onset and Offset Data % % data = processOnsetOffset(data,params) % % Description: This function takes a data structure with velocity traces, % onset and offset indicies, and fiber photometry data and aligns % photometry to movement onset and offset...
97c50141a1482130b4417e1908caca9e6681ef079e11056509d0466b50b8a17d
MATLAB
2,816
113
close all; clear; clc; % parameters subject = 'Dog_1'; number = 2; path = ['E:\Sameni\Projects\Seizure\' subject '\']; mode1 = 'interictal'; mode2 = 'preictal'; ch = 1:16; % desired channels time = [8 10]*60; % in seconds nfft = 5000 - 1; SpectralWinLen = 10; % in seconds SpectralOverlapPercentage = 50; % [0 99] % lo...
1194df088df765570e9e47e7c598c651bb2141308ff25a54c5bc0035903eb19d
MATLAB
2,818
66
function data = processOnsetOffset(data,params) %Process Onset and Offset Data % % data = processOnsetOffset(data,params) % % Description: This function takes a data structure with velocity traces, % onset and offset indicies, and fiber photometry data and aligns % photometry to movement onset and offset...
ee022944eac156948c3c9f3b38b7060912a95fde05806d5dda8e05a48f4ab682
MATLAB
2,822
77
function [cData,Scale,dim]=mnl_ProcessImageForNeurolucidaImages %The first step of the Neurolucida Imaging % Inputs % User prompts to define images and other properties % % Outputs % -cData - The 4D image that has been corrected for chromatic abberation % -Scale - The XYZ scale % -dim - The dimensions of the image. %...
96cb1e1582ff64968aba55ebcd9ecedc1b567e7bc7b66e51c00771c4b0d086fa
MATLAB
2,823
107
function h=BreakPlot(x,y,y_break_start,y_break_end,break_type) % BreakPlot(x,y,y_break_start,y_break_end,break_type) % Produces a plot who's y-axis skips to avoid unecessary blank space % % INPUT % x % y % y_break_start % y_break_end % break_type % if break_type='RPatch' the plot will look torn % i...
8133d2a5b4ee3f5a9096286171371e8426d186cccf29b1e7c905bb07e72136d5
MATLAB
2,825
90
function [modelParams, R2] =... fitDescFunAndValidate_spikeCounts(spikeCountCellArray,xAxisVals, k, randFlag,... fitMeans, validMeans, customFun, x0, lb, ub, nSolvers) %spikeCountCellArray = units(4).dmSC_trial_speed; %xAxisVals = 1:7; if numel(xAxisVals)~=numel(spikeCountCellArray) error('xAxisVals must h...