sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fe51bc9e0e887aa1f1ce192528f078913e39dc7a0c187dbf0936c191343f817b
MATLAB
4,184
116
function [Header] = w_ReadDF(Header) %function [Header] = w_ReadDF(Header) % Read image header to get DF % ------------------------------------------------------------------------ % Input: % Header - The Header of image data, use y_Read.m to get it. % The elements in the structure are: % Header.fname - the filen...
3f5898693831479f24cc6a91fcb6b3663939f82850be2b5a2d28d8784264e707
MATLAB
4,185
88
%% List all the 100 subjects and loop through them current_dir=pwd; list_subj_ID=dir('/home/andrea/miplabsrv2/HCP/*'); list_subj_ID(1)=[]; list_subj_ID(1)=[]; %min_length_task={1000,1000,1000,1000,1000,1000,1000}; min_length_task={176,253,316,284,232,274,405}; load('min_size_tasks_regressors.mat') %min_size_tasks_regre...
9b7ec6a64ff8f24480a0fe03db9d355e02b4cc2ba2b9a9ff01ac2cc57f35259d
MATLAB
4,185
101
function WriteImageBoutonsAndROIs(Image,FileNameAndDir,BoutonROIArray,MaskBouton,ROIs) OS=computer; if strcmp(OS,'MACI64') dc='/'; else dc='\'; end if length(FileNameAndDir)>260 error('Shorten Name and or dir...') end % Image=double(TempContr...
f93b895af53e7a615d8a2ead6381afdf88de733465852b5a5ac8a80745391c37
MATLAB
4,185
122
% FADE-SAME: Table 3 % clear % close all %%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load results file FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_only.xls'; [num, txt, raw] = xlsread(FADE_file); clear num txt % specify inference conf_lvl = 0.9; % extract variable...
f2c2425e44f3bfb43a18450f6db079544e7786abe6e4b881b6805d947110e0ee
MATLAB
4,187
170
function wlPlot_plotEventScatterMulti(cfg, eventseries, ... freqrange, durrange, amprange, figtitle, filelabel) % function wlPlot_plotEventScatterMulti(cfg, eventseries, ... % freqrange, durrange, amprange, figtitle, filelabel) % % This function makes a scatter-plot of burst amplitudes and burst durations % (in pe...
43091f6012b7c12fdcc50b9632c6f8c8729f60c636013138997f21c388b63318
MATLAB
4,188
115
function extract_spikes_samples %extracts sample indices of spikes. calls subroutine extract_kwik_file(kwikfile,tet_number) cluster_data.spikes.SUA=[]; cluster_data.spikes.MUA=[]; if exist('raw')==7 cd('raw'); end disp('folder: ') pwd tetrode_list= dir('*.kwik'); for i=1:length(tetrode_list) st= strfind(tetrod...
9e1635a3daad637a4d47fb166fa6121811e369cfbad1159b3f029f0efae85a71
MATLAB
4,188
102
function plot_ICs(params,EEG) % Recording ids s_ids = cellfun(@(x) regexp(x,'.*(?=_eeg.set)','match','lineanchors'),{EEG.filename}); % Check that the number of channels is the same for all the recordings etc = {EEG.etc}; if range([EEG.nbchan]) ~= 0 error('Different number of total channels in at least one recordin...
6e19a4f1bc26d34998e82c7b72c7e104ec67d979a69d059e4b73c87be80c9dbe
MATLAB
4,189
138
%% test_choose_orientations MINVEL = 3; MINANGLEDIFF = 3*pi/4; MINANGLECHANGE = 3*pi/4; MININTERVALLENGTH = 5; velocity_angle_weight = .05; max_velocity_angle_weight = .25; WINDOWRADIUS = 100; tag = 'movie20071007_165047'; path = '/home/kristin/FLIES/data/walking_arena/highres/'; ext = '.fmf'; moviename = ['/media/da...
83b5ac69ac7d3a5d612fae81df95f60eb6214f012bf8f250666d521c9f7ac902
MATLAB
4,189
525
%% SH suggested flyID2rm flyRmCalib = [ 90 96 103 120 125 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 355 356 357 358 453 454 455 456 457 ]; %% fl...
9250959f7d7ad85b6236bd666c8caf3849dc9b7305a31a070c8a7f021446e9b8
MATLAB
4,189
117
function [spkZ, spkMapZ, spkViewZ, spkZnan, spkMapZnan, spkViewZnan] = normDat(spk, spkMap, spkView, par) % Normalize firing rates based on mean and std of activity between 200 and % 600 ms after motion onset during RDM discrimination trials % Inputs % - par = basic information about the recording session and p...
066fc7d989a6fa8490866a2c2887d8e89f3a6ed529f2f29e449f9d3ee4aa39fc
MATLAB
4,195
178
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
44231beda6dff05d111c8819c840dd46cd8f9c10f62811d0afaff829b761bcd9
MATLAB
4,195
112
classdef LabelROI methods (Static) function s = new(n) if nargin < 1, n = 0; end % s.id = ... s.verts = nan(4,2,n); s.f = nan(n,1); end % Barebones add/edit API for now. Can improve over time if nec function s = setF(s,v,f) % set/replace all rois for frame ...
6c0cf8df7936f7987f645bc982abeeae60838c0cc94a89ea9d7a1d0c2fd75ba7
MATLAB
4,195
168
function y = recurrentQuadratureFilter(x,lambda,omega,tau,n,RIC,deltaT) % Feb 2023 % y = recurrentQuadratureFilter(x,lambda,omega,tau,n,RIC,deltaT) % % x: 3D input signal with time in the 1st dimension (real or complex % valued) % y: output signal (real or complex valued: see RIC) % omega: preferred tempora...
b867efb8a6df5dfd7910eeffd3ed07a6878fe384cc39b294d4e576caf77c213b
MATLAB
4,195
138
function [Theta0,Re0] = lme_mass_fit_EMinit(X,Zcols,Y,ni,maskvtx,nit,prs) % [Theta0,Re0] = lme_mass_fit_EMinit(X,Zcols,Y,ni,maskvtx,nit,prs) % % Starting values at each location for the linear mixed-effects iterative % estimation. These starting values are based on the ordinary least squares % estimators plus some fa...
305a785cb642f1bdb5d0dccb44bf954fc7517d8e751fe3654669ebaf3431d60b
MATLAB
4,197
125
function [P]=ExpandBoundaryBufferZone(t,p,P,shell_normals,density,DELTA,llc) % Expands each triangular facet of the boundary by a factor (depending on % local mesh density) and then extrudes a prism out of the expanded % triangle. Then checks for all the pixels that are within this prism and % tags them as buffer pixel...
d7819fcaf54c8633b8c44d5eb86f68b577de14d7b607c00df15e84b59cd5131d
MATLAB
4,197
187
clear clc % close all %%% This script reproduces panel d of Figure 5. %%% It is also used to reproduce panels c and d of Ext. Data Fig. 8. rat_names={'P049','P055','P059','P095','P100','P101','P102'}; %%% load results of logistic regression load data/logistic_regression_results_ephys_rats %%% (generated by compute_...
2f7eb1131dbf34910073483373ae7da8792f701a2b94cf410426f782ac83ec68
MATLAB
4,198
106
% FT_POSTAMBLE_SAVEVAR is a helper script that optionally saves the output % FieldTrip data structures to a *.mat file on disk. This is useful for % batching and for distributed processing. This makes use of the % cfg.outputfile variable. % % Use as % ft_postamble savevar data % ft_postamble savevar source mri % % ...
b55f413f7a96025a6abc19b392cdc788fd9fbb93720cece5f64d7c8992a764ab
MATLAB
4,198
107
% SearchDir=ParentDir3 % Destination=['Z:\Temporary QuaSOR File Backup']; SearchString='_MiniEvoked_SOQA_Data2.mat' SearchDir='/Volumes/Time Machine Backup/Enterprise Image Analysis 3/' Destination='/Volumes/Zach/Temporary QuaSOR File Backup/' function Search_and_Destroy_or_Save(SearchDir,SearchString,Destination)...
059d2c9549e460c6aa74a86be4c6ecb4808d101928b1e784b6f8d4e92ad6b918
MATLAB
4,201
215
clear clc load('Sfast_G1.mat'); load('Sfast_G2.mat'); load('Sfast_G3.mat'); load('Sfast_G4.mat'); load('Sfast_G5.mat'); load('Sfast_G6.mat'); load('Sfast_G7.mat'); load('Sfast_G8.mat'); load('Sfast_G9.mat'); G1_corrected = Sfast_G1(:, 6:10); G1_corrected(:,6:10) = Sfast_G1(:,1:5); Sfast_G1 = G1_corrected; G2_correc...
8acb36b92bd52d29ade1883f025e85008cd23b3c34017a047dbc7e5f9decfc3c
MATLAB
4,202
89
function detector = acfModify( detector, varargin ) % Modify aggregate channel features object detector. % % Takes an object detector trained by acfTrain() and modifies it. Only % certain modifications are allowed to the detector and the detector should % never be modified directly (this may cause the detector to be in...
a81fe2f8ecadcdef420bf06030a686c6487d353c0c492377f2d325d2686a4878
MATLAB
4,202
123
function [eeg] = read_ns_eeg(filename, epoch) % READ_NS_EEG read a NeuroScan 3.x or 4.x EEG File % % [eeg] = read_ns_eeg(filename, epoch) % % filename input Neuroscan .eeg file (version 3.x) % epoch which epoch to read (default is all) % % The output data structure eeg has the fields: % eeg.data(..) ...
b303443003ec1087f47e0e025171eb176929cc390634cff6ac98269d5b011489
MATLAB
4,202
152
function [HL,CLIN] = cmlines(varargin) % CMLINES Change the color of plotted lines using the colormap. % % SYNTAX: % cmlines % cmlines(CMAP) % cmlines(H,...) % [HL,CLIN] = cmlines(...); % % INPUT: % CMAP - Color map name or handle to be used, or...
239f2625a65f2715f8ff3bdd4e94fede3c4e0ba50358d8cf2e6b69cc46d903d0
MATLAB
4,204
139
%GHOSTSCRIPT Calls a local GhostScript executable with the input command % % Example: % [status result] = ghostscript(cmd) % % Attempts to locate a ghostscript executable, finally asking the user to % specify the directory ghostcript was installed into. The resulting path % is stored for future reference. % % Once ...
d481a5682f6a3641c4797c701bb0cd54449328709a7c6aefe01bb76632ec5489
MATLAB
4,205
144
% DELCODE-SAME, Table "FADE SAME dc" % _ % original paper: Soch*, Richter* et al., HBM, 2022 % Table 3: Within-subject ANOVAs for FADE-classic and FADE-SAME scores % % DELCODE paper: Soch et al., medRxiv, 2023 % Table S3: Effects of diagnosis group and fMRI contrast on single-value scores % % written by Joram Soch ...
dbff286bc0bda0fbc0aa87775f83285f5dc93d5028559d19efb64651b9ef4de0
MATLAB
4,206
70
function params = initPhotoreceptorParams(modelType) % Initialize parameters for different photoreceptor models. % Default values (could be adjusted based on needs) params.sigma = 22; % receptor activity decay rate (1/sec) params.phi = 22; % phosphodiesterase activity decay rate (1/sec) params.eta = 2000; % pho...
1434825221898ae7d8c2d6eeae27642c0eadd6566416dd320eb7cd8e30a40660
MATLAB
4,207
151
% fourieeg Single-Sided Amplitude Spectrum of your continuous dataset % % [ym f] = fourieeg(ERP,ch,f1,f2) returns the module (magnitude) ym of the FFT output % of your dataset, evaluated at channel ch, between the frequencies f1 and f2 (in Hz). % f contains the frequency range. % % [ym f] = fourieeg(ERP,ch,f1) returns ...
5470bb7f2cd6a883a924f9c33889ffff29989b525e59f737289a22755712e093
MATLAB
4,209
82
%% Description % This example shows the use of the helper functions MCmatlab.plotAzFz() % and MCmatlab.plotRadialReflectanceTransmittance(). They generate plots % similar to those made by MCML, available at omlc.org. Use the log scale % button to see the details in the wings of the distributions. % % The radially reso...
c67eb1b7aa6b17f218c4b45db16e6f3ff9d346e23bbba631dd7294e25fa7e19e
MATLAB
4,210
87
ind = 1; data = dir('/DATAPOOL/ERRORMONITORING/SEM_mri_data/P*'); %% for i = 1:size(data,1) data_func = dir([data(i).folder, '/', data(i).name, '/mri/SEM_', data(i).name, '/nifti/func/run*']); fprintf(data(i).name); runs = [1:size(data_func,1)]; for j = runs dir_folder...
a3cdb2e6d5b7465906f95043215facf0c6e85eac410f5e39464450b1c80679c0
MATLAB
4,211
141
function [gmdmproduct] = y_gmdmp(tensor1, d1, tensor2, d2) %GMDMP General Multi Dimensional Matrix Product. %C = GMDMP(A, d1, B, d2) Computes the product %C(i[1],...,i[d1-1],i[d1+1],...,i[m],j[1],...,j[d2-1],j[d2+1],...,j[n]) = % A(i[1],...,i[d1-1],k,i[d1+1],...,i[m]) * B(j[1],...,j[d2-1],k,j[d2+1],...,j[n]) %(Sum ...
496f6ec0167fe040956df2d6e3e600a48238f6ed430a24b65993015677393138
MATLAB
4,212
213
function runAutomateAction(self) menu_items = self.handles.menu_name(4).Children; % go over all the files and load them [~,~,ext] = fileparts(self.file_name); allfiles = dir([self.path_name '*' ext]); n_files = length(allfiles); switch self.automate_action case crabsort.automateAction.view_only channel = self...
29c61ba6644ea1f46a3d181d693161a79d72838bff87472cc19318aba315f7a6
MATLAB
4,213
133
function vol = dilate3d(vol, dop, r, res) % dilate3d - perform 3D dilation with operator % % FORMAT: vol = dilate3d(vol [, dop, r, res]) % % Input fields: % % vol 3-D boolean volume % dop dilation operator with odd size ! (default 3x3x3 cube) % r 1x1 double radius, wei...
ae5c7ca00c1d1a8f39c0af0003c955dbd433f4ed1add18a3bca67eb5598e5a45
MATLAB
4,214
146
function [Theta0,Re0] = lme_mass_fit_init(X,Zcols,Y,ni,maskvtx,prs) % [Theta0,Re0] = lme_mass_fit_init(X,Zcols,Y,ni,maskvtx,prs) % % Starting values at each location for the linear mixed-effects iterative % estimation. These starting values are based on the ordinary least squares % estimators (OLS). % % Input % X: O...
a318fac8d2d874782fe1e6685bfcba79031f3efe2c454302d96eb554aa096c63
MATLAB
4,215
58
function replay_decoding_split_events %splits each replay event approximately in half, based on when the MUA is %lowest in the middle third of the event. This is used to seperately analyze the %first and second half of long duration replay events % Load parameters parameters = list_of_parameters; load('decoded_repla...
f62aaff919dd368e27525a0ae243d331b8eba43f942ccf7d39aae41abe2afd68
MATLAB
4,215
96
% Correlation table all NTs all Freqbands % Prerequisites, parcellation image, input image - smap/fmap, wjn toolbox addpath C:\Code\wjn_toolbox-master addpath C:\Code\spm12 addpath(genpath('C:\Code\leaddbs')) % % Atlas_dir = 'C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Neuromodula...
312601d251f1b58f2c84812d11b0afe1d541e8b0dd474b29bd615298507569d3
MATLAB
4,216
127
function [missing, extra, copyProblems, missingExtra] = pmlOrganizeCode(bookSource, dest, demosOnly, includeCodeSol) % Organize the PMTK code files referenced in PML into folders % according to the chapter in which they are referenced. If a file is % referenced in more than one chapter, the first chapter is used unles...
3e0aae73f67557499ca5a17093eb03d4a70ac634163566db4558f958906905ab
MATLAB
4,217
148
clear all trialCOUNT = 1; b = [0, 0.4470, 0.7410]; o = [0.8500, 0.3250, 0.0980]; y = [0.9290, 0.6940, 0.1250]; p = [0.4940, 0.1840, 0.5560]; g = [0.4660, 0.6740, 0.1880]; a = [0.3010, 0.7450, 0.9330]; r = [0.6350, 0.0780, 0.1840]; %% DATA with rule biased towards depression (with no plastic F -> VIP) external_sti...
47a37a041e986a581b5668eed6aaeae3f099380984bed67d309188f1c857f777
MATLAB
4,217
123
function [tfr,t,f] = tfrbj(x,t,N,g,h,trace); %TFRBJ Born-Jordan time-frequency distribution. % [TFR,T,F]=TFRBJ(X,T,N,G,H,TRACE) computes the Born-Jordan % distribution of a discrete-time signal X, or the % cross Born-Jordan representation between two signals. % % X : signal if auto-BJ, or [X1,X2] if cross-BJ. % ...
5e04f9b17645c59e4757bcf25816d8adcecd03a099c29cdfe1d36f708759d0c4
MATLAB
4,217
114
function [th,boot_values] = limo_ecluster_make(bootf,bootp,alphav) % ECLUSTER_MAKE creates a multivariate, cluster based, statistical threshold based % on bootstrapped F tests. The function operates along the last dimension of the % input data. For each bootstrap, independently at each electrode: % (1) signi...
9f2213bae9258b5cd2021ba6e5c24f5e9cb28ae7762757d6f9dfeb883ad0b94d
MATLAB
4,217
145
function [minPos,fmin] = polyinterp(points,doPlot,xminBound,xmaxBound) % function [minPos] = polyinterp(points,doPlot,xminBound,xmaxBound) % % Minimum of interpolating polynomial based on function and derivative % values % % In can also be used for extrapolation if {xmin,xmax} are outside % the domain of...
b90d3aece6329712681cb75a4da376d47a50b70bbc25a2e9fc78eb83cbd76968
MATLAB
4,217
122
% FADE-SAME: Table S4 % clear % close all %%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load results file FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_only.xls'; [num, txt, raw] = xlsread(FADE_file); clear num txt % specify inference conf_lvl = 0.9; % extract variabl...
1ae33e83a8b44354e300f5881823768397223e9bf740ae5b6e56380a6f85a8ef
MATLAB
4,218
182
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
43c74f282917e550c9d535c1b165ceeb5ceb2399027bd5595075a109bd5d8aaf
MATLAB
4,219
88
function SOFAplotGeometry(Obj, index) % SOFAplotGeometry(Obj) plots the geometry found in the Obj. % % SOFAplotGeometry(Obj, index) plots the geometry for the measurements % given in the index. % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences; % Licensed under the EUPL, Version 1...
a9d164c57334f18eb836e70febf2aece7451da2f2c954e842763584f2f2d1b43
MATLAB
4,221
118
classdef MouseVocImporter < FeaturesImporter properties end methods(Static) function n = typeName() n = 'Mouse Vocalization'; end function ft = possibleFeatureTypes() ft = {'Vocalization'}; end function...
3298acd4072ef44af8bf41fe993e21eb80ae1c05dae0292cda2453d4c880f0b3
MATLAB
4,222
133
function h=plotgauss2d(mu, Sigma) % PLOTGAUSS2D Plot a 2D Gaussian as an ellipse with optional cross hairs % h=plotgauss2(mu, Sigma) % % This file is from pmtk3.googlecode.com h = plotcov2(mu, Sigma); return; end %%%%%%%%%%%%%%%%%%%%%%%% % PLOTCOV2 - Plots a covariance ellipse with major and minor axes % ...
51e3c9a967ac337779d209ad05c0980ab10d98ea8f2665a32bd7363ad4b5985e
MATLAB
4,222
105
function y_Call_DPABISurf_VIEW(SurfUnderlay,SurfOverlay,Flag_LR, N_Min,P_Min,Surf_Mask,Surf_Mask_Rule,ColorMap,N_Max,P_Max) %This is a function which is used to display the result by DPABISurf_VIEW. %FORMAT y_Call_DPABISurf_VIEW(SurfUnderlay,SurfOverlay,Flag_LR, N_Min,P_Min,Surf_Mask,Surf_Mask_Rule,ColorMap,N_Max,P_Max...
868db0a470f115e6c8a22fb5c1c30ff0ffe198ccbf0bcf110dea9865aeb9a3e8
MATLAB
4,222
134
function vol = erode3d(vol, eop, r, res) % erode - perform 3D erosion with operator % % FORMAT: vol = erode3d(vol [, eop, r, res]) % % Input fields: % % vol 3-D boolean volume % eop erosion operator with odd size ! (default 3x3x3 cube) % r 1x1 double radius, if given, ...
939a2401ca25226161044fed56762e246e8da3b88fab53717765774f2d9b81d7
MATLAB
4,222
196
local = true; if ~local ldir = '/localhome/kabram/Dropbox (HHMI)/PoseEstimation/Stephen/18012017_trainingData/justHead/'; Q = load('/groups/branson/bransonlab/mayank/PoseTF/headTracking/FlyHeadStephenCuratedData.mat'); else Q = load('/home/mayank/work/poseTF/headTracking/FlyHeadStephenCuratedData.mat'); ldir ...
920ae27b89bdd5ca046111885b1b04dea9cbbe2fed0a78e1165d571ee487b890
MATLAB
4,224
119
%% TODO: turn this into a function, rather than script %% %Plot the basic elements of a linear model that accounts for neural firing %as a function of the subject's choice and the cued action. From this %dataset it appears that there is no significant tuning prior to the action %cue suggesting some type of heir...
dcf7f912932adf3bf772ec9eab279ac04160a8f1634c49bc1cad7b2b9ab9b62d
MATLAB
4,224
152
function [img, Vto] = scn_map_image(loadImg, sampleTo, varargin) % This function takes an image name in loadImg % and loads the data, resampling to the space defined % in the image sampleTo. The resampled image will retain % the data type of the input image. % % :Usage: % :: % % [imgData, volInfo_mapto] = scn_map_i...
27230ea987ed91a86cc37490d64ce2dbb853776069d3405d577b1ad95ee08ad7
MATLAB
4,225
122
function [mappedX, mapping] = npe(X, no_dims, k, eig_impl) %NPE Perform the Neighborhood Preserving Embedding algorithm % % [mappedX, mapping] = npe(X, no_dims, k) % [mappedX, mapping] = npe(X, no_dims, k, eig_impl) % % Runs the Neighborhood Preserving Embedding algorithm on dataset X to % reduce i...
7d7253ac96d43281bc89fea056c5e26990f9c4a35fa55ac98baa0638d84db9ec
MATLAB
4,227
141
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % classdef CellB...
a7c121e6c0ddcfe6dcd4d016b98a40c177099bff33628d224cc3b0676b6cbfae
MATLAB
4,227
144
classdef ParameterVisualizationMemory < ParameterVisualization properties % If true, a prop for this pvObj is currently selected, and we are % successfully initted/displaying something. initSuccessful = false; hArgs = {'Color','k','LineWidth',2}; propPrefix = ''; imsz = []; net...
ee0fb701b8373be8046785af065446f249c36eb8386a110e4469b22964f3e5cf
MATLAB
4,229
106
function machine = train_rbm(X, h, eta, max_iter, weight_cost) %TRAIN_RBM Trains a Restricted Boltzmann Machine using CD1 % % machine = train_rbm(X, h, eta, max_iter, weight_cost) % % Trains a first-order Restricted Boltzmann Machine on dataset X. The RBM % has h hidden nodes (default = 30). The training is performed...
832bd4581f930327bbc196972233198207a88c7d2bbfc04b71e93990a66fdf31
MATLAB
4,231
164
function [samecost, sameassignment] = testassignment %TESTASSIGN Test and compare the assignment algorithms % [SAMECOST, SAMEASSIGNMENT] = TESTASSIGN randomly generates distance % matrices and solves the assignment problem using different algorithms. % Edit the header of this file to change the simulation parame...
798326a0abe281030152693a497ebb453670498d167d50d1e2c28dbb493d1391
MATLAB
4,232
142
function [] = LogScale( whichaxis,logbase,varargin) %LogScale(whichaxis,logbase) renames the tick labels on your axes for a %logarithmically scaled variable. % %INPUT % whichaxis which axis did you log scale (can be 'x' 'y' or 'xy') % logbase base of the logarithm you used for your points (ex 10) % %EXAMPLE %...
397cc20fb02628a797a665934a3cd15551e632c618acdd26cfce346a4be2ff4c
MATLAB
4,233
115
% Second-kind integral equation on the unit cube, Laplace single-layer. % % This is basically the 3D analogue of IE_SQUARE2. % % Inputs (defaults are used if not provided or set empty): % % - N: number of discretization points in each dimension (default: N = 32) % - OCC: tree occupancy parameter (default: OCC = 512...
8fe277022e11e4691f7e2d5bcd2769125c7411a9c41096d1424737e80cda6935
MATLAB
4,233
103
function C = normxcorrn( T, A, shape, Tm ) % Normalized n-dimensional cross-correlation. % % For 2 dimensional inputs this function is exactly the same as normxcorr2, % but also works in higher dimensions. For more information see help on % normxcorr2.m. Also see Forsyth & Ponce 11.3.1 (p241). % % Also, it can take ...
f9d52c44e399f91370f2e8475660b92f09a5c31e78b1683a99ab12a1cab1c62f
MATLAB
4,233
140
function [e,p,nodemap,elemap,dim,nnpe]=read_nod_elm(infn,tetgenflag) % [e,p,nodemap,elemap,dim,nnpe]=read_nod_elm(fn,tetgenflag) reads the node/elm list % from a file whose format is as follows. fn should not have any extension. % The format of .nod header is: % <# of points> <dimension> <# of attributes> <# of bounda...
ed514391240b3d4f1712c04f61e18aea9b5d6a338bf8228e8b4b80f0bc830ad6
MATLAB
4,234
106
function plot_badchannels(params,EEG,single_path) % Recording ids s_ids = cellfun(@(x) regexp(x,'.*(?=_eeg.set)','match','lineanchors'),{EEG.filename}); % Check that the number of channels is the same for all the recordings etc = {EEG.etc}; if range([EEG.nbchan]) ~= 0 error('Different number of total channels in ...
d71d03461f534f1adc3b3acef784cbafafd03da02261f658a4f6b275c57de207
MATLAB
4,235
115
% Second-kind integral equation on the unit cube, Laplace single-layer. % % This is the same as IE_CUBE2 but using HIFIE3X. % % Inputs (defaults are used if not provided or set empty): % % - N: number of discretization points in each dimension (default: N = 32) % - OCC: tree occupancy parameter (default: OCC = 512)...
3c9bb2d826e70a4dffdc38c950b712513f7e900bce9773883c9f2009d6dc8ae2
MATLAB
4,236
109
function [event] = read_shm_event(filename, varargin) % READ_SHM_EVENT reads the events in real-time from shared memory % this is a helper function for READ_EVENT % Copyright (C) 2007, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the documentation and details. % % ...
e0cd932f8128423e774c1d1fb146034dd91025b04480962efa291b3e143d1b47
MATLAB
4,236
133
%% choose sessions datRoot = '/Volumes/LaCie/Farries recordings/'; rat = 'IM1261'; sesList = dir([datRoot rat '/20*']); sesList = arrayfun(@(x) x.name, sesList, 'UniformOutput', false); sorted = cellfun(@(s) exist([datRoot rat filesep s filesep 'unitDat.mat']), sesList) == 2; behav = cellfun(@(s) exist([datRoot rat fil...
6b3c1876f386be247d2338401bf62717224b74d51c457f3edd0ebca89a13b41f
MATLAB
4,239
137
function [hmm,Gamma,Xi,vpath,LL,datat] = hmmdual_FK(data,T,hmm,Gamma,Xi,residuals) % % Dual estimation of the HMM, first Gamma and then the HMM structure % % INPUTS: % % data observations - a struct with X (time series) and C (classes; optional) % T Number of time points for each time series % hmm ...
aef52eb438e7942624c52fa6196b82b81cb8f6106227fe3e69d1bb575687b05f
MATLAB
4,240
65
psthPara.binsize = 10; psthPara.binstep = 10; % ms psthPushPara.binsize = 50; psthPushPara.binstep = 5; % ms cwStr = ["correct", "wrong", "all"]; if contains(protStr, "duration") devStr = "devDur"; end for cwIdx = 1 : length(cwStr) switch cwStr(cwIdx) case "correct" %% (cwStr(cwIdx)...
7b2abdf5760a71f51cb13587918049394c0a7306d3db16e747daf18ef7b3371e
MATLAB
4,241
181
%*********************************************************** % imsjm - imagesc tool with a few better features. 18-5-05 % % 11-8-08: beefed up version % % 10-9-08: use proper cartesian axes w/ 'xy' % % 22-10-08: flip second axis for corrct orientation wrt scanner % extra arguments: % phase or p - ph...
cf32f965ffbcee4baf28b9fa98b0acfc593a04496214707c6bb84340234b38e4
MATLAB
4,241
128
%%% Simple linear unmixing script for Guo et al (Science Advances) manuscript submission. %%% Written by Chetan Poudel, Ziyu Guo, and Joshua Vaughan. (2024) clear all % Enter path to the analysis script. script_path = 'A:\MATLAB scripts\'; cd(script_path) % Select region of interest (ROI) for unmixing (eg...
a6f35a1927502dd6774e52244a5b47bcefca4cb058f2f016e4755f72dc5d7d9b
MATLAB
4,243
115
function [select] = parameterselection(param, data) % PARAMETERSELECTION selects the parameters that are present as a volume in the data % add that have a dimension that is compatible with the specified dimensions of the % volume, i.e. either as a vector or as a 3D volume. % % Use as % [select] = parameterselection(...
c20b8fd18502fb81332004262c36c5b747570485e72f1217e7c5829776abf73f
MATLAB
4,243
176
function plotmesh(mesh, isPlotFiducials) % PLOTMESH Allows fast and easy viewing of meshes in NIRFAST format. % % SYNTAX: % PLOTMESH(MESH) % PLOTMESH(MESH, ISPLOTFIDUCIALS) % % PLOTMESH(MESH) MESH is NIRFAST mesh structure. % PLOTMESH(MESH, ISPLOTFIDUCIALS) MESH is the NIRFAST mesh structure. % ISPLOTFIDUC...
f17853c621b145657c95aa5ff46d3baa59c53c2424886757c0d0fb0e0a3a1aa6
MATLAB
4,243
125
%% make a plot avg LFP for each animals, raster of all detected waves, and a histogram clear;clc;close all %paths to dta files for each animal dataPaths{1} = 'D:\InVivo\S1-Baclofen\2022-04-19_Baclofen\3-baseline'; dataPaths{2} = 'D:\InVivo\S1-Baclofen\2022-04-21_Baclofen-Attempt\1-baseline'; dataPaths{3} = 'D:\I...
e9b200c96d60b908712461f22f6702aa186f1c6660de97433eeda95076f3f323
MATLAB
4,246
146
% topo2sph() - convert a topoplot() style 2-D polar-coordinate % channel locations file to a 3-D spherical-angle % file for use with headplot() % Usage: % >> [c h] = topo2sph('eloc_file','eloc_outfile', method, unshrink); % >> [c h] = topo2sph( topoarray, method, unshrink ); % % Inputs: %...
cbf5cae450063b312e001d516d4eb0dd5bc9963b10da79c9a943d833da1ae340
MATLAB
4,248
103
function [BlockdemonDispFields,myPool]=SmoothDemonField(myPool,BlockdemonDispFields,DemonSmoothSize,DynamicSmoothing,IsDFTMoving,CircularFilter,CircularFilterFrames,... PixelBlockSize,TotalSmoothingArea,VerticalPixels,HorizontalPixels) % PixelBlockSize=10; % TotalSmoothingArea=Intermediate_Crop_Props.Bou...
3155550fe2ee430bc5144f0f2e9d77a6ad70a31a0d789c846b286e21332462dd
MATLAB
4,252
99
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % Description: % This script computes a sensitivity analysis of the mean maximum muscle-tendon (MT) moment to changes in % muscle para...
c38f8c5121216b2714e3dfe57c3e6d3c6b2e4838fc21dcdde68d75bbce26edbd
MATLAB
4,253
110
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef LegacySupport %LEGACYSUPPORT This is a static class that contains resources for %loading old style Axis Data properties(Constant) P200D30S_PLATE_TYPE = hex2dec('0400001...
b656b135b1a2d575413a4b5b024ce7f74321b287ef67e7bfb0ee1d101f008cff
MATLAB
4,254
121
%% permtest_tsdata_to_mvgc % % Calculate null distribution for conditional time-domain MVGC from time series % data, based on a permutation test % % <matlab:open('permtest_tsdata_to_mvgc.m') code> % %% Syntax % % FP = permtest_tsdata_to_mvgc(U,x,y,p,bsize,nsamps,regmode,acmaxlags,acdectol) % %% Arguments % % See al...
deda9c685ff1c1d7941be2057437b8616a2a64e786706c1a57bcc43e3a53c64b
MATLAB
4,255
121
function write_edf(filename, hdr, data) % WRITE_EDF(filename, header, data) % % Writes a EDF file from the given header (only label, Fs, nChans are of interest) % and the data (unmodified). Digital and physical limits are derived from the data % via min and max operators. The EDF file will contain N records of 1 sampl...
18df9cac6756eccea6978e10dc502374cc3a87309ff2a38aa9eb14c05fd585cf
MATLAB
4,256
129
function [spike] = read_neurosim_spikes(filename,headerOnly) % READ_NEUROSIM_SPIKES reads the "spikes" file that is written by Jan % van der Eerden's NeuroSim software. The output is represented in a % structure that is consistent with the FieldTrip spike representation. % % OUTPUT % spike: A FieldTrip raw spike stru...
738f639b7109aba884585033752c1419d8cd75b3a46df3366e5cb4b74faf697a
MATLAB
4,257
182
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
e3b829e2134eb4ee8939ad5354f17b57bd4c4f86e57322325a2f5c499048955e
MATLAB
4,257
131
function [int_dat,mask_vol,outname] = iimg_intersection(varargin) % Make a mask of the intersection of n image files (pos or neg values) % If 'name' followed by an image file name is entered, writes output to % that image % % :Usage: % :: % % [int_dat,mask_vol,outname] = iimg_intersection(name1, name2, etc.) % ...
feb9347e3527710d748bfcdbb6054086f63ee4637637f23b471ba4410802f10e
MATLAB
4,258
182
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
673f54b3e6ff7bb5961b25ec706c3c5dd62913b3be32c16b4c76da75a1ef8a51
MATLAB
4,259
129
function [spike] = read_neurosim_spikes(filename,headerOnly) % READ_NEUROSIM_SPIKES reads the "spikes" file that is written by Jan % van der Eerden's NeuroSim software. The output is represented in a % structure that is consistent with the FieldTrip spike representation. % % OUTPUT % spike: A FieldTrip raw spike stru...
7fcbee84638723a1a961966aedf65306607da0153cb652c3972ffbf2f3f32aa8
MATLAB
4,260
134
function COR = modelr1(COR,cfg) % <*LAN)<] % v.0.0.1 % % % % Realiza modelos usando R % COR estructura de datos % .cfg configuraciones % .model = formula del modelo segun R % 'rt ~ BETA' % .command = comando a utilizar % 'lme' linwae mixed effect model % ...
1993803311c951f05c8645a5abc059d1040fa945992ad8a9b002bd9331a9aa3b
MATLAB
4,261
112
% Step 2-3: Keypoints and Descriptors % Calculate the SIFT Descriptors for a subset of subvolumes of the experiments % as dictated in the loadExperimentParams.m script. % % INPUTS: % sample_num is the index of the tissue sample to register % run_num is the index of the experiment for the specified sample % start_idx an...
e6834c0daca94d6b0434942cd29fcc1bb104a0fc7d0d29444b37560fd83573f4
MATLAB
4,261
104
function [masks,keepLocs] = maskGaussians( siz, M, width, offset, show ) % Divides a volume into softly overlapping gaussian windows. % % Return M^nd masks each of size siz. Each mask represents a symmetric % gaussian window, the locations are evenly spaced throughout the array of % size siz. For example, if M=2, the...
1ffd9a8980eb2830033bd05cb90c38dda411221ec6601d1ec1207725a0c42bd0
MATLAB
4,262
118
function basis=legs(x,n) % usage: [basis,gradbasis]=legs(x,dir,n) % % returns the values and directional derivatives of (n+1)^2 % spherical harmonics at locations given in x and, for the % gradients, for (in general non-normalized) directions given in dir. % % input: x set of N locations given as an Nx3 ma...
bec04b4299ea0e356f5f324fb678991c31b252482f724deb3f08cc3f88b0de02
MATLAB
4,262
125
function socialnetworks_convert_logfile_to_prt(logfile_to_convert, output_prt_filename, template_prt_file) % A function for conversion of presentation logfiles to BrainVoyager protocol (PRT) files % Open and read the log file fid = fopen(logfile_to_convert); text = textscan(fid,'%s'); text = text{1}; fclose(f...
64d4bd53d9f7c595f269421b20ef671cad7df0955d17e393cb50e601b82a57f8
MATLAB
4,263
145
% df = readtable("U:\users\ryanh\projects\hpc_ctx\sessions_v2.csv",'Delimiter',','); % df = df(contains(df.use,'TRUE'),:); df = table() df.basepath = {pwd}; check_original_states = true; % visual of current edges (states) for linearized pos % gui labeled as this: % ___ ___ % | 1 | 4 | % |2 |0 |5 % |__ | __|...
3e437a69fb563bc3fdf989fb7acf4f4db5bbdb0c752fb49e0e3620a2c7cd3c25
MATLAB
4,264
182
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
394b8ab62b79291a60c37533b21dd1e83e1b2327d703ecf3a5075d29dd169fee
MATLAB
4,267
159
%% Create the adjacency graph of a portion of the Web. % [U,G] = surfer(root,n) starts at the URL root and follows Web links % until it forms an adjacency graph with n nodes. U = a cell array of n % strings, the URLs of the nodes. G = an n-by-n sparse matrix with % G(i,j)=1 if node j is linked to node i. % % Example: ...
7f9f1f6b4921c525457721b5242a134c966bec0117293ef20b1bd53bbc587c57
MATLAB
4,267
151
function [stat,out] = RFT_GLM_contrast(X,y,c,type,u,verbose) % applies RFT to GLM-based contrast inference % function [stat,out] = RFT_GLM_contrast(X,y,c,type,u,verbose) % % In brief, this function uses RFT to test linear mixtures of effects, % under the general linear model (GLM): % y = X*beta + e % where y is the d...
5c286e7d153d38b35238a1ac5da3b27e51aaffd57eba5e460cd4c92d428b52b9
MATLAB
4,268
129
function [spike] = read_neurosim_spikes(filename,headerOnly) % READ_NEUROSIM_SPIKES reads the "spikes" file that is written by Jan % van der Eerden's NeuroSim software. The output is represented in a % structure that is consistent with the FieldTrip spike representation. % % OUTPUT % spike: A FieldTrip raw spike stru...
daa7bdeb2280395aedb9874aaf079339c78283757af03ce7747d6f438e6be3d0
MATLAB
4,268
151
function [ peak, clus, clusid ] = SurfStatPeakClus( slm, mask, thresh, ... reselspvert, edg ); %Finds peaks (local maxima) and clusters for surface data. % % Usage: [ peak, clus, clusid ] = SurfStatPeakClus( slm, mask, thresh ... % [, reselspvert [, edg ] ] ); % % slm.t = ...
3f9d508165233d5f951a4ff73939d0921f1c073863c884edf3469ae5ee50fe98
MATLAB
4,270
144
function gtdata = GT3DReconstruct(gtdatain,gtinfo,varargin) [isshexp,istime] = myparse_nocheck(varargin,'isshexp',false,'istime',false); nviews = numel(gtdatain); % run on all cells of networks if isstruct(gtdatain{end}) && ~all(isfield(gtdatain{1},{'pred','labels'})), gtdata = gtdatain{end}; netfns = fieldnames(...
99641d21c13927731173c43cc736e3c7983c2d400aa757f59a99db089ac0ed23
MATLAB
4,270
195
% Normalize % throught the 3th or 2th dimention % % Method 'z' % for z-score % % Method 'm' % for mean substraction % % Method 'mdB' % for decilBell : 10*log(signal/baseline) % % Method 'bz' % for bootstrapping z-score (Revisar por que esto es absurdo) % % % % V 1.7 % % Pablo Billeke % % 17.03.2015 ad...
6d8d9470797d83afb2f88f214ab21947b5d239037e325b676ca25b8077670082
MATLAB
4,271
132
%% Orig "truncated lbl" file from Mayank % % note, lbl.labeledposMarked doesn't have expected number of els compared % to .labeledpos and .movieFilesAll. So we ignore this field entirely as we % cannot even know the correspondence of labeledposMarked to the other % fields. % lbl = load('f:\aptStephenCPRInvestigate201...
b9748b1e1899372cb70b3fee51fb67ead175c2eadca8dec82ca64c5f25722bd7
MATLAB
4,274
133
function CBIG_VK2019_example_wrapper(out_dir) % Written by Valeria Kebets and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); current_dir = fileparts(mfilename('fullpath')); pos_v = strfind(current_dir,filesep); root_dir = fullfile(current_...
83a4fb78a3407c65fac6a45764675465b6942c771016c5b0a8209f7dcc085f3c
MATLAB
4,275
182
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
997b5e0d0be83b16e0550ca5362a5aef203ce1a95caaa196cebfde92588c858d
MATLAB
4,275
90
classdef (Sealed) AdjMatrixParams % defines the available parameters for an adjacency matrix properties (SetAccess = private, GetAccess = public) Type = adjmatrix.NetworkTypes.SqrLatt; % network type N = 400; % number of elements L = [ 20 20 1 ]; % linear dimension (sqr latt: number of e...
f6375ca5450378d1e3d471fd75fb6ac76b05e153081dd1b62e6dee379e24478b
MATLAB
4,275
126
function obj = TLprep1l(obj,Y_grayMatter_mask,V_grayMatter_mask) for i=1:length(obj.MPfile_name_run) obj.run(i).td.MPs=readmatrix(obj.MPfile_name_run{i}); end for i=1:length(obj.MPfile_name_run) obj.run(i).name=['run' num2str(i)]; %auto generate the run names end obj.run(1).p.def...
edfd859aa32e225b2746c09e503f9d69d7b017433baee5d883831e126198ddca
MATLAB
4,276
89
function [Obj, log] = SOFAcompact(Obj) %SOFAcompact % Obj = SOFAcompact(Obj) compacts the unique value to singleton dimensions % of variables where possible. % Current limitation: Variables with 3 dimensions will be only compacted % when the third dimension is the compressible one. % % SOFA API - function SO...
7d96f7518e7299bf35210f82bf7529189afc3f015874bc32c4ba8ea2c300a45f
MATLAB
4,278
151
% Author: Birgit Nierula % nierula@cbs.mpg.de function figure_singleTrial_cca(condition, srmr_nr, isubject, ... c_axis, iscolorbar, trial_number, is_norm) % set path savepath_ga = getenv('GADIR'); % condition info cond_info = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; nerve = cond_i...