sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6138e36e7b7682a7efea4b700c2a0ce14a42a830750cba9130ecc305a0648f7b
MATLAB
9,191
227
%% Nat Comms Ictogenesis Figure 1 clear load('20230127_PooledData.mat'); recdat = load('OP138B-210310-135833_ch2'); % Set up binning ranges ephistbins = 1:15; ephistedges = (1:16) - 0.5; EXP5HZ = "B30_P5F5_"; EXP10HZ = "B30_P5F10_"; EXP20HZ = "B30_P5F20_"; rec = struct(); rec.stim5Hz = st...
ac940d4c925222732a3ab019a5a3c7228fa5f364bce28fa10ef78c1d1fc2faed
MATLAB
9,204
229
%-------------------------------------------------------------------------------- % utm.m % % This demo is included in % Triple equivalence for the emergence of biological intelligence % Takuya Isomura % % The MATLAB scripts are available at % https://github.com/takuyaisomura/reverse_engineering % % Copyright (C) 2024...
3034a42cbab2df12a0a68fdfd1809bdf8488749894d5d88d351fbe0e92d0896c
MATLAB
9,222
188
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function zef_plot_parcellation_time_series(void) void = []; time_series = evalin('base','zef.parcellation_time_series'); plot_type = evalin('base','zef.parcellation_plot_type'); selected_list = evali...
86ecd4a868294b260776a93c7b57659fd35d93e50fe76a9e0914b0224e39802a
MATLAB
9,233
144
% MAT2NLXSPIKE Exports data from Matlab into a Neuralynx NSE, NST or NTT file. % % Mat2NlxSpike( Filename, AppendToFileFlag, ExportMode, ExportModeVector, % FieldSelectionFlags, Timestamps, ScNumbers, CellNumbers, % Features, Samples, Header); % % Version 6.0.0 % % Requires MATLAB...
e3625ee28496f3d237c2732825cd14075a5316d19c88dc04a06afbedf218ac2e
MATLAB
9,235
232
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [sensors_attached_volume] = zef_attach_sensors_volume(zef,sensors,varargin) if isempty(zef) zef = evalin('base','zef'); end attach_type = 'mesh'; bypass_functions = 0; I_get_functions =...
441aad7629ae679a2ae1f26ffb3cc3e2e4b33dfb0feff4968fddc2e2bdd43a4a
MATLAB
9,236
145
% MAT2NLXNRD Exports data from Matlab into a Neuralynx NRD file. % % Mat2NlxNRD(FileName, ChannelNumber, AppendToFileFlag, ExportMode, % ExportModeVector, FieldSelectionFlags, Timestamps, % Samples, Header); % % Version 6.0.0 % % Requires MATLAB R2012b (8.0) or newer % % % IMPORTAN...
1a262763f4e0930838d02147ea5b5004199597fe8f14ac76b21cf4e1d3662444
MATLAB
9,255
193
%% initialize clear; clc; currentPath = pwd; cd ../temp load('tempFileForAnalysis.mat'); cd(pathBIDS); cd derivatives pathDeriv = pwd; cd(pathDeriv); cd('spm-preproc'); % For saving preprocessed file from SPM pathPrepFile = pwd; prepSubjFolders = dir('sub*'); cd(pathDeriv); cd('behavior'); pathBehav = pwd; load('be...
b55bedf06171a8b2d0d951da361c52d9b9ccbf75e0eae2e0f539b4dd4e5d84bc
MATLAB
9,265
320
function [noise,dat]=sw_simple_noise_rejection(varargin) % %sleepwalker help--------------------------------------------------------- % sw_simple_noise rejection accepts different input argument combinations % sleepwalker simple noise rejection % detect extreme values in signal based on squared - zscored signa...
c8a685b7cd54935dd1a379b14022810c4c924cba086b329bf5fac4c38ef60098
MATLAB
9,282
245
function [x, info, options] = stochasticgradient(problem, x, options) % Stochastic gradient (SG) minimization algorithm for Manopt. % % function [x, info, options] = stochasticgradient(problem) % function [x, info, options] = stochasticgradient(problem, x0) % function [x, info, options] = stochasticgradient(problem, x0...
81ec646142de14ec7c4c64e92c785a56d96775db541c12729bb253fca5344a4a
MATLAB
9,317
283
function [UI] = fn_UI_fmincon(P,nz,ny,nx,flag) % flag: 0 if fmincon is blackbox, 1 if derivative is included and 2 if Hessian and derivative is included if flag==0 % Blackbox fmincon TSTART = tic; [~,UI,~] = fn_UI_fmincon_main_BB(P,nz,ny,nx); t = toc(TSTART) else % flag =...
102745a96804ff08e1c4038a91be183eeb6a9fd15e3c85cce15db309839f7bc5
MATLAB
9,324
272
%%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [L_eeg, dipole_locations, dipole_directions] = lead_field_eeg_fem( ... zef, ... nodes, ... elements, ... sigma, ... electrodes, ... p_nearest_neighbour_inds, ... o...
4fee291704abb5f428965558207665125f82104ed87edb94fa8094c588fe12b6
MATLAB
9,333
331
classdef UKFNMMInverter < inverse.CommonInverseParameters % % KalmanInverter, Copyright © 2025- Joonas Lahtinen % % A class which defines the properties needed by the Kalma filter / Standardized Kalman filter inversion method, % and the method itself. % The method is based on the article: %...
fe588128c80c9325d8e2adcfa62a975d65b8948ecc0319747442073d2b5b174a
MATLAB
9,357
293
function M = essentialfactory(k, strSigned) % Manifold structure to optimize over the space of essential matrices. % % function M = essentialfactory(k) % function M = essentialfactory(k, 'signed') % function M = essentialfactory(k, 'unsigned') % % % Quotient representation of the essential manifold: deals with ...
db181a56f2cef6eb704e2d8b3383a9d1320d05c6b9775cd1c33ecf530da8ce5b
MATLAB
9,358
308
function [opt,delta,stats] = sw_run_delta_hEEG(varargin) % [rip] = run_ripple_LFP(dat, opt) % top level function to perform ripple detection % inputs: % 1) dat - data input which can be either % a) a string: dat='data/human_eeg3.edf' % or % b) a data structure wit...
dca1dae8e91732327bb6d86fdaea25238ec6dddc8eef8a225b8db92dc9479274
MATLAB
9,394
165
zef_init_forward_and_inverse_options; zef_data = zef_forward_and_inverse_processing_options; zef.fieldnames = fieldnames(zef_data); for zef_i = 1:length(zef.fieldnames) zef.(zef.fieldnames{zef_i}) = zef_data.(zef.fieldnames{zef_i}); if find(ismember(properties(zef.(zef.fieldnames{zef_i})),'ValueChangedFcn')) ...
f6a21dc14d4c622030d3e170a889117ccb945ec15cec96d18bbbe549966db57a
MATLAB
9,399
148
function project_struct = lead_field_example ( kwargs, mesh_kwargs, lead_field_kwargs ) % % examples.lead_field_example ( kwargs ) % % Demonstrates how one might construct a lead field matrix with Zeffirro % Interface, from the Matlab command line. Look into the wiki page % https://github.com/sampsapursiainen/zeffiro_i...
0ada5f2bf48658c125a7b1df7a11c9921ac769c72e8ed92083b32838af525e02
MATLAB
9,407
202
% Parameter values and their initial values for Zeffiro-Brainstorm plugin. % % zef_bst.save_project = 1; % % This flag (logical 1 or 0) defines whether the % Zeffiro's project file with mesh is saved on disk. % % zef_bst.import_settings = ""; ...
f559e2569c9b979fbb7285b27ab998cf80eeb335757ee46232b9ad10646d7b09
MATLAB
9,414
234
function zef = zef_nse_iteration(zef) [zef.nse_field.nodes, zef.nse_field.tetra] = zef_get_submesh(zef.nodes,zef.tetra,zef.active_compartment_ind); signal_pulse.dir = zeros(size(zef.inv_synth_source,1),3); flux_val = 7.5e-4/60; flux_vec = [0.5 0.5 -1/3 -1/3 -1/3]*flux_val; n_smoothing = 0; atmosphere_pressure = 1.0...
a7ae6a5a881560c90f810cc95ccdeaed13683e788c19d14b5240410c55d81e30
MATLAB
9,433
200
function signal = clean_channels(signal,corr_threshold,noise_threshold,window_len,max_broken_time,num_samples,subset_size) % Remove channels with abnormal data from a continuous data set. % Signal = clean_channels(Signal,CorrelationThreshold,WindowLength,MaxBrokenTime,NumSamples,SubsetSize,UseGPU) % % This is an automa...
1f917779da77f21eb9ea784d47c80e77375d5c61397efbfbc1db74f454e761b9
MATLAB
9,474
264
%% Nat Comms Ictogenesis Figure 5 clear load('20230127_PooledData.mat'); EXP5HZ = "B30_P5F5_"; EXP10HZ = "B30_P5F10_"; EXP20HZ = "B30_P5F20_"; sz = struct(); sz.stim5Hz = startsWith(sztable.ExpProtocol, EXP5HZ); sz.stim10Hz = startsWith(sztable.ExpProtocol, EXP10HZ); sz.stim20Hz = startsWith...
2dc184685daeedf09955dc68357ae3b3daea6dcc1e1385e4a11313b3efc3bb6a
MATLAB
9,503
278
function [hmm,Gamma,Xi,fehist] = hmmtrain(data,T,hmm,Gamma,residuals,fehist) % % Train Hidden Markov Model using using Variational Framework % % INPUTS: % % data observations - a struct with X (time series) and C (classes) % T Number of time points for each time series % hmm hmm structure...
3e67d6e79d3c753e5896ef146e3b402479ac9438119cb092b23428889702bb5e
MATLAB
9,511
239
function M = hyperbolicfactory(n, m, transposed) % Factory for matrices whose columns live on the hyperbolic manifold % % function M = hyperbolicfactory(n) % function M = hyperbolicfactory(n, m) % function M = hyperbolicfactory(n, m, transposed) % % Returns a structure M which describes the hyperbolic manifold in Manop...
142cf159cc9f485ea6fcf7b531707de341abe0f2aa22b18810586845ae3bad0f
MATLAB
9,527
241
function [x, cost, info, options] = steepestdescent(problem, x, options) % Steepest descent (gradient descent) minimization algorithm for Manopt. % % function [x, cost, info, options] = steepestdescent(problem) % function [x, cost, info, options] = steepestdescent(problem, x0) % function [x, cost, info, options] = stee...
cd42e0a7bbec3520e852f0745d6c32f6a79e427d74d3f80142626b40a581c5b0
MATLAB
9,556
231
function zef = zef_ES_find_currents(varargin) %% Loading data switch nargin case {0,1} if nargin == 0 zef = evalin('base','zef'); else zef = varargin{1}; end [alpha, epsilon] = zef_ES_find_parameters(zef); case {3} [zef, alpha, epsilon] = deal(vara...
43fc5481507ff8d069b1b24ed489614f9c94a586d5a9fcf2c992349c3bf5a73e
MATLAB
9,618
244
function L = obslike(X,hmm,residuals,XX,cache) % % Evaluate likelihood of data given observation model, for one continuous trial % % INPUT % X N by ndim data matrix % hmm hmm data structure % residuals in case we train on residuals, the value of those. % XX alternatively to X (which in this case...
a9be78e05c06535f874842f30eec2556cd8d95f3ffa3516b850e75e3af54dd61
MATLAB
9,628
249
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [parcellation_interpolation_ind] = zef_parcellation_interpolation(zef) domain_labels = eval('zef.domain_labels(zef.brain_ind)'); submesh_ind_vec = eval('zef.submesh_ind'); parcellation_compar...
17374ae92022edb3a9a2754fb3cb9a8cd3e511cd71a7577fb5b7a15888064d09
MATLAB
9,695
157
% MAT2NLXNDE Exports data from Matlab into a Neuralynx NDE file. % % Mat2NlxNDE(FileName, AppendToFileFlag, ExportMode, ExportModeVector, % FieldSelectionFlags, StartTimestamps, EndTimestamps, % SamplesLost, DataTypes, ObjectNames, Header); % % Version 6.0.0 % % Requires MATLAB R2012b (...
3076c48d170698b4cbb46298d6ffdfc04a9f9598cbcb83e167b40eed0f640b0d
MATLAB
9,699
222
function computeSyncResults(varargin) %% function computeSyncResults(N, b, c, undirected, discretized, repeats, networkType, p, d, S, maxMotifLength, folder, MaxK, dt) % function computeSyncResults(properties) % % Generate networks and compute the synchronizability for a number of networks assuming gaussian dynamics % ...
651ffdadc450061e134b2f174e7695c6ddb7249f5948456ea1e333decea2985c
MATLAB
9,762
316
%=============================================================================% % generate_tube frames: Given a 3D curve (x,y,z) build a tube as a mesh of % % polygons (mainly triangles of quadrilateral) % % % ...
f1e5c5e501f31d053d0a757661ebea4d0a4483b9360f5d64e7f49d0f9f2408e3
MATLAB
9,821
230
function plotSyncResults(varargin) %% function plotSyncResults(N, b, c, undirected, discretized, repeats, networkType, p, d, S, maxMotifLength, folder, MaxK, dt) % function plotSyncResults(parameters) % % Plot the synchronisation versus p or c for a number of network samples % (discrete time AR or continuous time Orns...
1f453fe70f1b22cd5018b2c209507333e65a3072e412c774480a8e206b0ee3f5
MATLAB
9,831
237
%-------------------------------------------------------------------------------- % adder_evo.m % % This demo is included in % Triple equivalence for the emergence of biological intelligence % Takuya Isomura % % The MATLAB scripts are available at % https://github.com/takuyaisomura/reverse_engineering % % Copyright (C...
92effdb2e3eed24e243a8f8f5390dba052f616ea1407e854cb5da0b959ad0c8d
MATLAB
9,881
270
function [hdr, record] = edfreadUntilDone(fname, varargin) % Read European Data Format file into MATLAB % % [hdr, record] = edfread(fname) % Reads data from ALL RECORDS of file fname ('*.edf'). Header % information is returned in structure hdr, and the signals % (waveforms) are returned in struc...
9e9751c00199c9d85a5692adc47b61c6bee7a2dd131846d34f23113b7f265f64
MATLAB
9,900
324
function M = productmanifold(elements) % Returns a structure describing a product manifold M = M1 x M2 x ... x Mn. % % function M = productmanifold(elements) % % Input: an elements structure such that each field contains a manifold % structure. % % Output: a manifold structure M representing the manifold obtained by %...
0948366e2e06d151db076fad60d828edb5523e44336ce8d430397018fb7de0c2
MATLAB
9,906
262
function [hdr, record] = edfread(fname, varargin) % Read European Data Format file into MATLAB % % [hdr, record] = edfread(fname) % Reads data from ALL RECORDS of file fname ('*.edf'). Header % information is returned in structure hdr, and the signals % (waveforms) are returned in structure reco...
fe2da6727ef74390c878ab04933e4f3182c05144937ee7a12b76994017c99e1c
MATLAB
9,919
306
h1 = figure(... 'PaperUnits',get(0,'defaultfigurePaperUnits'),... 'Units','normalized',... 'Position',[0.4325 0.754529914529915 0.184722222222222 0.271111111111111],... 'Visible',get(0,'defaultfigureVisible'),... 'Color',get(0,'defaultfigureColor'),... 'IntegerHandle','off',... 'Colormap',[...
073952a330369f5c6eb5a70e3b3acfe519549cf6a6c5f3ace8befb52f8f9abf1
MATLAB
9,932
317
function [ sensitivities_with_statistics, L ] = main ( ... project_path, ... inverse_method, ... n_of_runs, ... noise_level_db, ... diff_type, ... dispersion_radius, ... args ... ) % % examples.studies.santtus_peeling_article.main % % Computes normed distance, direction and magnitude differe...
a0eb3a6fada9c0f9f2a8abd55cc1cce9db63b31de05998ebdc7d37b23559a118
MATLAB
9,933
307
function [dat] = sw_load_LFP (opt) % [dat] = detect_load_LFP (opt) %-------------------------------------------------------------------------- % function to load LFP data % add custom load routines as needed % % inputs: 1) structure opt with fields % opt.pat : path to data file in string % ...
23a727c84a62abe39546721296445eae39d09cff581282a53dbbe33f94c30693
MATLAB
9,970
359
function [G, interpolation_positions] = zef_hdiv_interpolation( ... p_nodes, ... p_tetrahedra, ... p_brain_inds, ... p_intended_source_inds, ... p_nearest_neighbour_inds, ... p_optimization_system_type ... ) % Documentation % % Produces a lead field interpolation matrix G with position-base...
1ce63636cd5b4f8746bed9f2913dc98c744442c28dbf5c627abe2cd6e6c0b3d5
MATLAB
9,975
290
function [fh,fnprnt,cdata]= sw_plot_detection(dat,ev, stats,opt) % funtion to plot a summary of detection results and save as pdf %% if isfield(ev,'auto') ev=ev.auto; end % Get the length of noise epochs and discard it when computing the total duration % and the frequency of spindles per seconds noiseLe...
0c3eb3a27287b1ae52f9277ae83c6163255d619e84e847501d92a90354bea353
MATLAB
9,978
285
function [x, cost, info, options] = neldermead(problem, x, options) % Nelder Mead optimization algorithm for derivative-free minimization. % % function [x, cost, info, options] = neldermead(problem) % function [x, cost, info, options] = neldermead(problem, x0) % function [x, cost, info, options] = neldermead(problem, x...
ebf45dcc32d42cfbf888d1d26055ac5c5b0fed114f0b15a6a36243a78e621df3
MATLAB
9,984
307
function [net,stats] = cnn_train_dag_seg(net, imdb, getBatch, varargin) %CNN_TRAIN_DAG Demonstrates training a CNN using the DagNN wrapper % CNN_TRAIN_DAG() is similar to CNN_TRAIN(), but works with % the DagNN wrapper instead of the SimpleNN wrapper. % Copyright (C) 2014-15 Andrea Vedaldi. % All rights reserved...
57b8b434be1d78585e15bd5775f17f9818db2e49bce4a513dc3332b1013ad7dc
MATLAB
10,011
237
function obj = simulate_seq_randomwalk(obj,varargin) % Simulate a random-walk decision-tree microstate sequence % check inputs options = microstate.functions.make_options(varargin) ; % default options defaults = {'Nsample',[] ; 'fsample',[] ; 'Nstates',4...
3dd3d26c8c3d6bb1d42b2c9629686ac9447c29416b1f996cec15e264c528596d
MATLAB
10,051
337
h1 = figure(... 'PaperUnits',get(0,'defaultfigurePaperUnits'),... 'Units','normalized',... 'Position',[0.4325 0.754529914529915 0.184722222222222 0.271111111111111],... 'Visible',get(0,'defaultfigureVisible'),... 'Color',get(0,'defaultfigureColor'),... 'IntegerHandle','off',... 'Colormap',[...
57288595b7deb1ada95e3dbc4cb5dde29c8bd1949c323d6842f6a82f618f14c4
MATLAB
10,058
244
function checkhessian(problem, x, d) % Checks the consistency of the cost function and the Hessian. % % function checkhessian(problem) % function checkhessian(problem, x) % function checkhessian(problem, x, d) % % checkhessian performs a numerical test to check that the directional % derivatives and Hessian defined in ...
420b2f6d916e88bd098b3d08a9fd110a46010a8f6f200b546bc4284206d97f60
MATLAB
10,087
164
%% Demo code ver. 02/17/2020 %============================================================================================================= % A brain-inspired architecture for cost-efficient object recognition in shallow neural networks % Prerequirement % 1) MATLAB 2018b or later version is recommended. % 2) In...
af6c926b194029085428583ef0bddbbd5b3ffe514a7097641d6a09f0fdf3e80f
MATLAB
10,127
257
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [z,reconstruction_information] = exp_iteration(zef) parameters = fields(zef.EXP.parameters); for n = 1:length(parameters) eval([erase(parameters{n},'exp_'),'=',num2str(zef.EXP.parameters....
9d53d874aa1bf0359cce345625e9d5318f372ffc1da1fe041db25177ef2bc6ac
MATLAB
10,136
273
function hiso=plot3t(varargin) % PLOT3T Plots a (cylindrical) 3D line with a certain thickness. % % h = plot3t(x,y,z,r,'color',n); % % PLOT3T(x,y,z), where x, y and z are three vectors of the same length, % plots a line in 3-space through the points whose coordinates are the % elements of x, y and z. With a rad...
e11b309cec16ff747862f37540e7571e947e99eb0d6052eb710b38505046f267
MATLAB
10,137
264
function [acc_t,predictions_hard,predictions_soft,genplot] = standard_classifier_test(model,X,Y,T,options,binsize) % Fit an already trained classifier given by the structure model to the % test data given in X with labels Y. % % INPUT % model: a classification model outputted from the function % standard_cla...
0d4bcfd0b446d108fee639502c9454fc76e49c32027b51884336131e74fbc87b
MATLAB
10,159
334
function [dat]=sw_noise_rejection(dat,opt) % %sleepwalker help--------------------------------------------------------- % sw_simple_noise rejection % sleepwalker simple noise rejection % detect extreme values in signal based on squared - zscored signal % case 1 switch off % inputs: dat = sw data structure % % ...
95d847b3499da1f855b8ad310681adf8218e87935f4e66350b399ec8b3a05451
MATLAB
10,167
337
function [opt,spindle,stats] = sw_run_spindle_hEEG(varargin) % [rip] = run_ripple_LFP(dat, opt) % top level function to perform ripple detection % inputs: % 1) dat - data input which can be either % a) a string: dat='data/human_eeg3.edf' % or % b) a data structure...
b0d88d68062e917d465ed0ff00e3641421715d0de43342b4a7c798f09da6aada
MATLAB
10,180
304
function [tuda,Gamma,GammaInit,vpath,stats] = encodertrain(X,Y,T,options) % Performs the Temporal Unconstrained Decoding Approach (TUDA), % an alternative approach for decoding where we dispense with the assumption % that the same decoding is active at the same time point at all trials. % % INPUT % X: Brain data, (...
7ad964b3dbea39c27095a5aaf8ea1293592028b75d4702ccc6dda6798a7f9096
MATLAB
10,192
304
function [reconstruction, reconstruction_info] = zef_nse_reconstruction(nse_field,type) reconstruction = cell(0); reconstruction_info = cell(0); if isequal(type,1) for i = 1 : size(nse_field.bp_vessels,2) aux_vec = zef_nse_threshold_distribution(nse_field.bp_vessels{i}(:),nse_field.min_reconstruction_qu...
00606490217d31ce445bc46a16da9fa950184e5b7ce1b10a072a7bb226097db2
MATLAB
10,197
239
classdef TrainingOptionsSGDM_conv3 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Train...
65ff72b9a9a4cfb9cc022def33d83f81372773a06aa8735f72d5108bb690f43a
MATLAB
10,197
239
classdef TrainingOptionsSGDM_conv5 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Train...
7eadb95d801b1c8218888dd2a6f9ea18b28a7a7184f25adf6bb31a4d111894b1
MATLAB
10,197
239
classdef TrainingOptionsSGDM_conv3 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Train...
eb3a0b89f165d73b9caa3bed030884c5e8d130893c45dd96b7b412d3312aa476
MATLAB
10,197
239
classdef TrainingOptionsSGDM_conv5 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Train...
04c56daf2fa0ecae1a4ef90c969a1961f24c8b229b21b934895950c02a7fb0c2
MATLAB
10,198
239
classdef TrainingOptionsSGDM_conv4 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Trai...
57fbd2eef4c839c9e0df31fd324d99453e49ded533ab78cf76c92fe5c05908be
MATLAB
10,198
239
classdef TrainingOptionsSGDM_conv4 < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM Trai...
d1bafdc2f5b8fa4a03160419fd8f2d3a97e2cc0342fe2d7263b72786a42249b3
MATLAB
10,209
239
classdef TrainingOptionsSGDM_conv3_LRC < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM T...
d38dc500cc2bef1fbf41012210a3d9e49fb2e4e7d39aa98ffeabf7ec03cd2ed1
MATLAB
10,209
239
classdef TrainingOptionsSGDM_conv3_LRC < nnet.cnn.TrainingOptions % ================================================================ % dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+cnn % ================================================================ % TrainingOptionsSGDM T...
d709ac5c4364111988572e277789f5bb1eb0dfa7d0834625fdf844aa03e0f4de
MATLAB
10,248
245
%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [z,reconstruction_information] = exp_em_iteration_multires(void) h = zef_waitbar(0,1,['EM MAP iteration for EP.']); n_multires = evalin('base','zef.exp_multires_n_levels'); sparsity_factor = ...
f6007bb5b38d4c6ad7275983ed6023716940af98fec2cc3b0e877e27e45d756b
MATLAB
10,260
290
function [varargout]=gscatter3(x,y,z,g,clr,mrksle,mrksze,mrkfclr,leg,legloc) %------------------------------HELP START---------------------------------- % gscatter3 - 3D scatter plot by group % % Ussage: % gscatter3(x,y,z,g); % gscatter3(x,y,z,g,opt_param); % opt_param - optional parameters such a...
489497fe50db8064d53d8a4e4f3b7bce198744a8041c9eed9da1412b2179be55
MATLAB
10,328
262
function sFiles = RP_CompileDataLibrary(sRP,ptrText) %% %strOutputPath: 'D:\Data\Processed\Neuropixels' % strTempPath: 'E:\_TempData' % strEphysPath: 'D:\Data\Raw\Neuropixels' % strStimLogPath: 'D:\Data\Raw\Neuropixels' %strEyeTrackingPath: 'D:\Data\Raw\Neuropixels' % strProbeLocPath: 'D:\Data\...
fb9af6c9ea7af0369953d24f27e4f420ca20b7ddabd7c66ff75f2f7924ffe08c
MATLAB
10,351
316
function [zef, Y, info] = zef_simulate_measurements_from_outPub(zef, sourceTree, outPub, varargin) %ZEF_SIMULATE_MEASUREMENTS_FROM_OUTPUB % Plot-driven measurement simulator (outPub -> sensor data): % - iterates over outPub.nodes exactly like zef_plot_outPub % - takes y = upAbsByPass(:,pass) and ignores NaNs like p...
10d242ee6fdcc37ccb72be33fb9c5d1f426c1eb6de6f98afcf747459e5024afc
MATLAB
10,373
295
%% Nat Comms Ictogenesis Figure S3 clear load('20230127_PooledData.mat'); EXP5HZ = "B30_P5F5_"; EXP10HZ = "B30_P5F10_"; EXP20HZ = "B30_P5F20_"; sz = struct(); sz.stim5Hz = startsWith(sztable.ExpProtocol, EXP5HZ); sz.stim10Hz = startsWith(sztable.ExpProtocol, EXP10HZ); sz.stim20Hz = startsWit...
ad69fa83e0076612f41dca9ce1ead60a5dff768ed15f59fa6999f8719e18acca
MATLAB
10,415
286
function [params] = parameterize(varargin) % Reviewed Darik A ONeil 04-15-2023 % %Primary validation is done in-line. % %Secondary validation functions are constructed below and performed last. %Steps %(1, Construct the Parser) %(2, Global Parameters) %(3, Structural Learning Parameters) %(4, Parameter Estimation Pa...
6a8c3bced41260653fb47ba8a92a86be2fc203bb68a7a4046033ebd225e043d1
MATLAB
10,441
310
classdef HALpRInverter < inverse.CommonInverseParameters & dynamicprops % % HALpRInverter, Copyright © 2025- Joonas Lahtinen % % A class which defines the properties needed by the Hierarchical Adaptive Lp-Regression (HALpR) inversion method, % and the method itself. % The method is based on the...
66184a6c26c2449010fd8742a9adfbf565d16c679c59960d2666af8c1e652fd3
MATLAB
10,452
303
function M = grassmannfactory(n, p, k, gpuflag) % Returns a manifold struct to optimize over the space of vector subspaces. % % function M = grassmannfactory(n, p) % function M = grassmannfactory(n, p, k) % function M = grassmannfactory(n, p, k, gpuflag) % % Grassmann manifold: each point on this manifold is a collecti...
b6eb30b156704b539b5c87bbc51698d5539836af1f022ccd7b0658527439d3a3
MATLAB
10,521
273
function [hdr, record] = sw_edfread(fname, varargin) % Read European Data Format file into MATLAB % % [hdr, record] = edfread(fname) % Reads data from ALL RECORDS of file fname ('*.edf'). Header % information is returned in structure hdr, and the signals % (waveforms) are returned in structure r...
40fb25b948bd8de5a5c97082a2ca69969970b9f0e9fe00584d5be13c14daadd3
MATLAB
10,529
211
%% initialize clear; clc; currentPath = pwd; cd ../temp load('tempFileForAnalysis.mat'); cd(pathBIDS); cd derivatives pathDeriv = pwd; cd(pathDeriv); cd('spm-preproc'); % For saving preprocessed file from SPM pathPrepFile = pwd; prepSubjFolders = dir('sub*'); cd(pathDeriv); cd('behavior'); pathBehav = pwd; load('be...
d7f6d7f39678716ae248b3368ad2a40899b151713809d6b3067ed35a390f95fb
MATLAB
10,592
291
function progressbar(fractiondone, img, position) % Description: % progressbar(fractiondone,position) provides an indication of the progress of % some task using graphics and text. Calling progressbar repeatedly will update % the figure and automatically estimate the amount of time remaining. % This implementa...
3d48c95ed87396a41eb604493ef5a732b55070326ea01d9ca5d35fde8ec091b6
MATLAB
10,594
329
% %%Copyright © 2018- Sampsa Pursiainen & ZI Development Team %See: https://github.com/sampsapursiainen/zeffiro_interface function [L_tes, S_tes, dof_positions, dof_directions, dof_ind, dof_count] = lead_field_tes_fem( ... zef, ... nodes, ... elements, ... sigma, ... electrodes, ... p_nearest_ne...
fc00c4408faffbf4e01b21e20d966825df2e3aea9fabb473ef46ed99945d9cac
MATLAB
10,630
288
function [eta, Heta, inner_it, stop_tCG] ... = tCG(problem, x, grad, eta, Delta, options, storedb, key) % tCG - Truncated (Steihaug-Toint) Conjugate-Gradient method % minimize <eta,grad> + .5*<eta,Hess(eta)> % subject to <eta,eta>_[inverse precon] <= Delta^2 % % See also: trustregions % This file is p...
1fee97615d5b1432528a9deca23a8dbc478899af5c272b03ed2457eea913e783
MATLAB
10,643
302
function [accumMatrix, gradientImg] = chaccum(varargin) %CHACCUM Compute 2D accumulator array using Circular Hough Transform % H = CHACCUM(A, RADIUS) computes the 2D accumulator array H using % Circular Hough Transform for 2D grayscale input image A with the % specified radius. The size of H is the same as the in...
5a8c81774cf5f19c5aea8ee7b9d1a7d9ed16a8b6893af997e85ef02ad2c7c78d
MATLAB
10,649
247
function SleepFragTC = Fun_ComputeSleepFragTC(NumberOfFilesPerSubject,... ScoringTC, EpochLength, NumOfTimePoints, WepochsSkip, SepochsSkip,... NepochsSkip, RepochsSkip) %% Written and updated by M. Nollet (Aug 2023) % % Function to be used to compute sleep fragmentation and consolidation % data per tim...
d7b57dd937c87d4d8a9def6cb52788acbddb90d956a7b4dbf7a221001ca544c9
MATLAB
10,653
349
function outPub = zef_publish_jr_tree_delays(outTree, sourceTree, gd, varargin) %ZEF_PUBLISH_JR_TREE_DELAYS Publish per-pass signals into absolute-time arrays using delays. % % Key idea: % - Do NOT sum overlapping segments. % - Do NOT replace missing samples by zeros. % - Keep NaN padding; plotting will ignore Na...
c8214c19dfbd31d6459da4cb49d328c0b609318884018fee01477ec76e5e1652
MATLAB
10,661
221
function [outdata,outstate, Y] = asr_process(data,srate,state,windowlen,lookahead,stepsize,maxdims,maxmem,usegpu) % Processing function for the Artifact Subspace Reconstruction (ASR) method. % [Data,State] = asr_process(Data,SamplingRate,State,WindowLength,LookAhead,StepSize,MaxDimensions,MaxMemory,UseGPU) % % This fun...
22701890d06db7d9df709cc4c905b7ae38fa087fe836a31e7e949a81bf02898d
MATLAB
10,684
229
%This is the startup script for GMModel app. One must add this as launch %script to zeffiro_plugins file: %GMMing, inverse_tools, GMModel_start %don't allow to open multiple app window because it cause ether App %Designer or app's functionalities to crash or both of them %9.7.2024 updation - Joonas Lahtinen if isfi...
ff081c0b9a0d79c5de1a936355d1c564e4bd0110f33510dd15799bfeeffcede9
MATLAB
10,697
312
function [ripples,sd,bad] = detect_ripples_Zugaro(filtered,varargin) %FindRipples - Find hippocampal ripples (100~200Hz oscillations). % % USAGE % % [ripples,stdev,noise] = FindRipples(filtered,<options>) % % Ripples are detected using the normalized squared signal (NSS) by % thresholding the baseline, mergi...
756808dcf938039ed1e62f6273db163d5dd8122095e11b9d73e013b3a063dc2d
MATLAB
10,818
298
function [tuda,Gamma,GammaInit,vpath,stats] = tudatrain(X,Y,T,options,noGamma) % Performs the Temporal Unconstrained Decoding Approach (TUDA), % or Temporal Unconstrained Classification Approach (TUCA) if the stimulus % is discrete. For the latter, options.classifier must be specified. % This is an alternative approac...
7742f96632511603b7d8e73db7f919f89ddeef5b6b1dcf937ed7ba50d9fd8a9b
MATLAB
10,827
237
function zef_PlotGMMcluster m_size = evalin('base','zef.GMMcluster_markersize'); m_width = evalin('base','zef.GMMcluster_markerwidth'); m_sym = evalin('base','zef.GMMcluster_markercolor'); s_length = evalin('base','zef.GMMcluster_veclength')^2; plot_ellipsoids = evalin('base','zef.GMMcluster_plotellip'); ellip_trans =...
7f4d8d844064cd48504ad2f1ab32e573a69deaeae49074e75d56f61f3c8b2b4a
MATLAB
10,847
368
%% statistical analysis of the lognormal parameters you gathered in the "logfit" script % first step is to read the data into the script % repeat / copy this section % change the folder to where you saved all the parameters and values % cd('C:\Users\Nina R��ler\Google Drive\PhD\Paper\12_2021_new figures\gof_sig...
1aac991d6f46fb7c13e29ea5331f452bcd4b3459ad3d4f28597149494cd71725
MATLAB
10,860
309
clear all files={''}; alldata=[]; alldataSTD=[]; cells=0; framerate=28; stdz=1; baseper=round(framerate*1.2):((framerate*2)-3); %for baseline correcting df actper2=1:(framerate*2);%for calculating standard deviatiion of df (for scaling/selecting) ends=[91 91 76 84 85 86 86]; for stim=1:7; actper{stim}=ends(stim):((f...
02600060ac8eb58c4f738e195c95e98d7b741573adbeacbb01e76ce86969e0ba
MATLAB
10,886
254
function ETC_redraw(varargin) %get globals global sETC; global sFigETC; %% redraw image %get data vecT = sFigETC.ptrAxesX.Children(contains(arrayfun(@(x) x.Type,sFigETC.ptrAxesX.Children,'UniformOutput',false),'line')).XData; vecX = sFigETC.ptrAxesX.Children(contains(arrayfun(@(x) x.Type,sFigETC.ptrAxesX.Chi...
7801ab098c1e85f9d77f1db4d2835433e3f79dcedf5f103ee4c1db7d57fbfb74
MATLAB
10,911
337
% TD custard % quick version function custardOutput = TDcustard(n,signal,sigthresh,minAmp,minWidth,tXrise,noFig,detailFlag) % n, number of points to test for a change % signal, 1xnpnts % sigthresh, significance to call an up % minAmp, to be a peak the relative amplitude needs to exceed this nBase = n; if detailFlag==...
d98a7175e89ef29bfec93b041d1dc7b036fb6ad6c01639948ce7619831f25ae5
MATLAB
10,962
176
% pop_clean_rawdata(): Launches GUI to collect user inputs for clean_artifacts(). % ASR stands for artifact subspace reconstruction. % To disable method(s), enter -1. % Usage: % >> EEG = pop_clean_rawdata(EEG); % % see also: clean_artifacts % Author: Makoto Miyakoshi and Ch...
c5f9e7deccd333d849901c0b28cf252d980e633dde73cc4c86fdc2cf2969ff70
MATLAB
10,976
267
%% Nat Comms Ictogenesis Figure 4 clear load('20230127_PooledData.mat'); EXP5HZ = "B30_P5F5_"; EXP10HZ = "B30_P5F10_"; EXP20HZ = "B30_P5F20_"; sz = struct(); sz.stim5Hz = startsWith(sztable.ExpProtocol, EXP5HZ); sz.stim10Hz = startsWith(sztable.ExpProtocol, EXP10HZ); sz.stim20Hz = startsWith...
defdd3cca198f2999cf42fa8abbb5e31a99bf5099fa0249df0c7a3b3f6fed4bf
MATLAB
10,984
254
function obj = FitAdvGMM(positions, weight, k, varargin) %FITGMDIST Fit a Gaussian mixture distribution to data. % GM = FITGMDIST(X,K) fits a Gaussian mixture distribution with K % components to the data in X. X is an N-by-D matrix. Rows of X % correspond to observations; columns correspond to variables. FITGMD...
daeff74af45a3999189466a24e2f5824ce0daa159c13b88026f1f34b6a74f775
MATLAB
11,010
420
function zef = zef_DBS_strip_struct_window(zef) h1 = figure(... 'PaperUnits',get(0,'defaultfigurePaperUnits'),... 'Units','normalized',... 'Position',[0.43 0.52 0.20 0.45],... 'Visible',get(0,'defaultfigureVisible'),... 'Color',get(0,'defaultfigureColor'),... 'IntegerHandle','off',... 'Colormap',[0 0 0.5625;0 0 0.625;...
615cefb0211c8fe0378dff34f37bd825d548914d48c416f0fde2fd893b6d594a
MATLAB
11,089
251
function zef_nse_plot_graph(zef, nse_field) if nargin == 0 zef = evalin('base','zef'); nse_field = evalin('base','zef.nse_field'); end if zef.nse_field.graph_type == 1 roi_ind = zef_nse_roi_ind(zef, nse_field); plot_vec = zeros(length(nse_field.bp_vessels),1); for i = 1 : length(nse_field.bp_vesse...
aac6a40bcaeef87daa12576587ab7c00089a7f4e9b6ea7b804b55e347b518db9
MATLAB
11,101
232
function [outdata,outstate] = asr_process(data,srate,state,windowlen,lookahead,stepsize,maxdims,maxmem,usegpu) % Processing function for the Artifact Subspace Reconstruction (ASR) method. % [Data,State] = asr_process(Data,SamplingRate,State,WindowLength,LookAhead,StepSize,MaxDimensions,MaxMemory,UseGPU) % % This fu...
beb7cc3ca1f903f52e22f279117bad51ec3a4d8404e459c99b27c6c69153ecdb
MATLAB
11,143
346
classdef MNEInverter < inverse.CommonInverseParameters & handle % % MNEInverter % % A class which defines the properties needed by the Minumum Norm Estimate (MNE) % inversion method, and the method itself. % properties % % Parameter for prior variance selection % ...
7ec1d76f474f7d2f1631cb910cbf11ef6b68feb3cfb1050e12849b31165be429
MATLAB
11,165
225
%% initialize clear; clc; currentPath = pwd; cd ../temp load('tempFileForAnalysis.mat'); cd(pathBIDS); cd derivatives pathDeriv = pwd; cd(pathDeriv); cd('spm-preproc'); % For saving preprocessed file from SPM pathPrepFile = pwd; prepSubjFolders = dir('sub*'); cd(pathDeriv); cd('behavior'); pathBehav = pwd; load('be...
96de1a1361e028902172d7d7c261cb9835517c68d84998c8834b3895e1a77ea5
MATLAB
11,187
230
function hmm = updateOmega(hmm,Gamma,Gammasum,residuals,T,XX,XXGXX,XW,Tfactor) is_gaussian = hmm.train.order == 0; % true if Gaussian observation model is being used K = length(hmm.state); ndim = hmm.train.ndim; S = hmm.train.S==1; regressed = sum(S,1)>0; if nargin<9, Tfactor = 1; end Tres = sum(T) - length(T)*hmm.tr...
bad237e9183ada71888ddc6f971e112a7ae0bb2926f36d446e9b5f4ca5e81a78
MATLAB
11,196
261
function bsliang_TMS_main(ambtag,is_getshamrepvals) % clear all % close all % ambtag='ambiguous'; if isequal(ambtag,'unambiguous') AMB=[1 5]; elseif isequal(ambtag,'halfambiguous') AMB=[2 4]; elseif isequal(ambtag,'ambiguous') AMB=3; end %...
f87287222a3f93940f4bbfdd22ec31b16c74e9ede4e36ee20da55514a6ade102
MATLAB
11,232
270
function zef_PlotGMModel %This function plots the point clouds created by the GMM tool. t = evalin('caller','f_ind'); parameters = evalin('base','zef.GMM.parameters.Values'); num_of_vars2 = evalin('base','zef.GMM.meta{2}'); m_size = str2num(parameters{8}); m_width = str2num(parameters{9}); m_sym = parameters{7}; s_le...
6985bcbab7da3c3dc2d1b4d57a8a83f8b740dbef9d6a06df5924efd02600c85c
MATLAB
11,264
326
% TD custard % quick version function custardOutput = TDcustard2 (n, signal, sigthresh, minAmp, minWidth, tXrise, noFig, detailFlag, silent ) % n, number of points to test for a change % signal, 1xnpnts % sigthresh, significance to call an up % minAmp, to be a peak the relative amplitude needs to exceed this %detailFla...
38cf39ea53756763f6caab77e7507c2f9d79582d6e9b9093a2d9498789c66da9
MATLAB
11,265
300
function [sp_fit_group,sp_profiles,sp_fit] = spectdecompose(sp_fit,options,chan) % % From a multitaper or MAR estimation of the states spectra (per subject), % it factorises the spectral information (which is given by frequency bin) % into a set of spectral components (which are much fewer than the % frequency bins),...
db08764ef7992de360c4761a4214a793a8059e4d01e15b20f4fb2e1eafe7764d
MATLAB
11,280
273
function zef_PlotGMModel %This function plots the point clouds created by the GMM tool. h = evalin('caller','h_axes_image'); %axes(h); t = evalin('caller','f_ind'); parameters = evalin('base','zef.GMM.parameters.Values'); num_of_vars2 = evalin('base','zef.GMM.meta{2}'); m_size = str2num(parameters{8}); m_width = str...
96a95db8304e30d77a55b7086c9a1836dd0c77ea48f50b5d77df73afd973ac8a
MATLAB
11,342
305
% SYNOPSIS % -------- % % The @SpikeGL class is a MATLAB object with methods to access the % SpikeGLX program via TCP/IP. SpikeGLX and MATLAB can run on the % same machine (via loopback socket address 127.0.0.1 and port 4142) % or across a network. % % This class provides extensive control over a running SpikeGLX proce...