sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8db024c0077b4c75574258504d166c2a1542201c744316b2f267a75e3187d3e3
MATLAB
2,569
65
%%% Figure 1 - Percept maps addpath("HelperFunctions") load(fullfile(DataPath, 'SurveyMainData_Processed.mat')) export_path = fullfile(DataPath, 'Figure1_Intro'); SetFont('Arial', 9) SubjectIDs = {'BCI02', 'CRS02', 'CRS07'}; subj_str = {'C1', 'P2', 'P3'}; [pbt_regions, dbt_regions] = GetHandSegments(); %% Get implant ...
fe7f5d8166c6310723f7011cceaddb09a99f1a636d7186634062147b1ca240ba
MATLAB
2,569
64
function model = plotMCmatlabGeom(model) % Displays % Geometry cuboid % Media optical, thermal and fluorescence properties % % Requires % NdimSliderPlot.m % %%%%% % Copyright 2017, 2018 by Dominik Marti and Anders K. Hansen, DTU Fotonik % This function was inspired by lookmcxyz.m of the mcxyz...
347572a0b1c1ceb18cfebc0173962439d64b294c79eb563a36047a366afa0f7c
MATLAB
2,570
61
function ts_denoised = meg_environmental_denoising_new(ts, opt) % This function uses the timeseries of the three MEG non-physiological % channels to denoise the physiological channels. % % ts_denoised = meg_environmental_denoising(ts, opts) % % INPUTS: % ts MEG timeseries (number of timepoint...
306124f3ec03933884ecf9a76d958f4381517a6ce3abd44c5787927825e55441
MATLAB
2,571
69
function str = VBA_summaryMFX(out) % writes a summary string from output of VBA_MFX model inversion % function str = VBA_summaryMFX(out) % IN: % - out: the 'out' structure of VBA_MFX inversion routine % OUT: % - str: a cell array of strings, which summarize the VBA inversion str{1} = sprintf(['Date: ',datestr(out....
e0268c56423ff2d2d71be843b5b8138c9935f7949c8a2bfb0e1063be5c49728f
MATLAB
2,571
86
function [mask sz] = mkMasksRadial(imSize,windows,verbose) % %----------------------------------------- % mask = mkMasksRadial(imSize,windows) % % generates a family of radial window functions % that tile evenly in angle and log eccentricity % % imSize: size of image (2-vector) % windows: structure containing window p...
e7cf1470831280268c55468260b0aab602b91db23866185b353d318ace5b04dd
MATLAB
2,571
70
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef StimulationChannels < Tag %STIMULATIONCHANNELS File data that enumerates channels used in a %stimulation properties (GetAccess = private, Constant = true) CurrentVersion = 0...
40f573babd077cfd471810ba63bded2ba8ccc3ac624c5be5ffb62d1b77edb978
MATLAB
2,572
102
function [d, pre, post, cycle, f, pred] = dfsPMTK(adj_mat, start, directed) % DFS Perform a depth-first search of the graph starting from 'start'. % [d, pre, post, cycle, f, pred] = dfs(adj_mat, start, directed) % % Input: % adj_mat(i,j)=1 iff i is connected to j. % start is the root vertex of the dfs tree; if [], all ...
7eaaf8216e33f0dbccafcae9c4eaae55c46626a6812c7f1c10d32d92f0a9be2d
MATLAB
2,574
84
function CBIG_ABCD_proc_rs_qc(id,proc_dir,bbr_thr,maxFD_thr,length_thr,FD_th,DV_th) % % CBIG_ABCD_proc_rs_qc(id,proc_dir,bbr_thr,maxFD_thr,length_thr,FD_th,DV_th) % % This function reads some qc measures and then remove runs that failed qc from the bold list % % Inputs: % % - id: % subject id % % - proc_dir: % ...
fa65fce43debe59d03af0d748a32b909d34fb4b9f9ffc0dacbf9ccfa090625ce
MATLAB
2,576
68
function [y,excl,rmsFd] = afxDenoising(y,subjectMasks,brainMask,rpFile,options) % if >options.unsmoothed< is true, tissue signal will be extracted from % unsmoothed data (y2), confound removal and filtering will be performed % also for unsmoothed data fprintf(' Denoising ...') % calcula...
53da11fd05e9b971e52a532a2761e9e4b05bf6429e3da0f65d28fcd1128e1192
MATLAB
2,577
85
function [x,mx,sx] = standardise(x,dim,lim) % X = STANDARDISE(X, DIM) computes the zscore of a matrix along dimension dim % has similar functionality as the stats-toolbox's zscore function % Copyright (C) 2009, Jan-Mathijs Schoffelen % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % fo...
4c7b5cbe70acf806ba9378958c7fb3c2d57d2b0a9344590b2d55d1c5dbe80574
MATLAB
2,578
112
%% Interpolate some data using a joint Gaussian % Based on p140 of "Introduction to Bayesian scientific computation" % by Calvetti and Somersalo % See also https://users.oden.utexas.edu/~tanbui/PublishedPapers/BayesianTutorial.pdf function main() demo(0.1) demo(0.01) end function demo(priorVar) setSeed(1); n = 150;...
cacb9be5e2357aa139449e1c6c8b6ad3adb5a7b8188df5d7bbc6ad7a84c905a7
MATLAB
2,578
53
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); for j = 1:size(data_func,1) images = [data_func(j).folder, '/', data_...
0c076efc3de5670cd027577c7797a659f4d3975b2f8a74aee32089000ac3a7a8
MATLAB
2,580
68
function [ F, J ] = diffofgauss2dfun( params, xy) %GAUSSIAN2DFUN evaluates modified gaussian with params at x % Output: % F: function value % J: Jacobian of the parameters %Written by Dimos. %========================================================================== %Unwrap inputs %=====================...
74dac547c4dd5d295fc9b2b8744178c182f315514c93af374b003e614a1e9544
MATLAB
2,580
95
%% ------------------------------ Initialize ------------------------------ % include all functions % clear all % addpath(genpath('src')); % parameters; % % name = 'P8_No28_Iba1-A647_DAPI_b1_h1_12'; % must be without tiff extension ! mkdir(['results/' name]); %% ----------------------------- Load the BW mask ------...
6b71ee239490082cb611eed31add306bc3565645718cf497b55a5b322ff26ad5
MATLAB
2,581
78
function event = read_spmeeg_event(filename, varargin) % read_spmeeg_event() - import evtns from SPM5 and SPM8 meeg datasets % % Usage: % >> header = read_spmeeg_event(filename); % % Inputs: % filename - [string] file name % % Outputs: % event - FILEIO toolbox event structure % ________________________________...
a591db6291a8051542eb7190a0f37251f67638565be6705f711d59a17131f849
MATLAB
2,582
87
%% smvgc_to_mvgc % % Average (integrate) frequency-domain causality over specified frequency range % % <matlab:open('smvgc_to_mvgc.m') code> % %% Syntax % % F = smvgc_to_mvgc(f,B) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % % _input_ % % f spectral (freque...
d252864e67eef020c4cb4658bfdaa4ff2a5c3af267a9e3df7f07d3685e6ae218
MATLAB
2,582
68
function [dat] = read_nihonkohden_m00(filename, begsample, endsample) % READ_NIHONKOHDEN_M00 reads data Nihon Kohden EEG system and converts the % floating point ASCII values to 16-bit signed integers from *.m00 file % format. This function is an adaptation of convert_nkascii2mat.m written % by Timothy Ellmore %...
3c27e10b0d8e961ae2b0ef5188a92c6b92e261f71d29cec857b44827d77835b8
MATLAB
2,583
84
%% Water sprinkler network Example % % Make DAG % C % / \ % v v % S R % \/ % v % W %% % This file is from pmtk3.googlecode.com nvars = 4; %% Create the dgm ordered = true; if ordered [dgmJ, C, S, R, W] = mkSprinklerDgm('infEngine', 'jtree'); dgmV = mkSprinklerDgm('infEngine', 'varelim'); dgmE = ...
e8c1ac818fcc40b64053a128d9f628624ab42cc126ef0fb66c658cbcbb3039cf
MATLAB
2,583
95
%% ------------------------------ Initialize ------------------------------ % include all functions % clear all % addpath(genpath('src')); % parameters; % % name = 'P8_No28_Iba1-A647_DAPI_b1_h1_12'; % must be without tiff extension ! mkdir(['results/' name]); %% ----------------------------- Load the BW mask ------...
e7d8eed9a09f4f87aa2c003c2544ce583577556befb901156bb57106dfda3758
MATLAB
2,584
74
% This is an electrode processor script: it imprints an arbitrary number % of electrodes. % % Copyright SNM GCNP 2012-2024 elec_path = fullfile(dipole_folder,strcat(patno,'_',model_name,'_', ... dipole_name,'_electrodes.mat')); %% load BEM-FMM Engine addpath(fullfile('...
cf7f0c9c45e73799e9dc7d189a59696564e8f2a4e4a8ac7618adbc9e3ed10376
MATLAB
2,586
87
function [p,out,hf] = doROC(xp,xn,displayWin) % implements a ROC analysis on samples from alternative hypotheses % function [p,out] = doROC(xp,xn) % IN: % - xp: values under the 'positive' hypothesis (H1) % - xn: values under the 'negative' hypothesis (H0) % OUT: % - p: area under the ROC curve (probability of di...
f6e31ed6c1e4e01a451d3e480230c007994cffedaa49ecaeadafdad34dd5afbc
MATLAB
2,586
70
function p = p_bt_median(w,w_boot,rng_seed,do_plot) % for each voxel: test weight from regression with original data against the % sampled null distribution of weights for this voxel % sort the bootstrap distributions for all voxels' weights by their median, % and choose voxels whose median value lies in either the s...
1019523869980c113155cdf58adfdf052fc651cc447e844a0d8dbe748ff06a71
MATLAB
2,588
69
%% Across time-point accuracy load(fullfile(saveLoc, 'par_sess')) load(fullfile(saveLoc, 'decoder_excl_SL'), 'excl', 'exclName', 'useN_dec', 'winCenter', 'winStart', 'winEnd') for sess = 1 : 8 disp(num2str(sess)) par = par_sess{sess}; %% Load normalized activity for this session ...
781ec1b783d60b78c27adb043c2bf1c67b3b002a2a5bf6b480256d2b03d9f695
MATLAB
2,588
150
if ~exist('calib_name')|~exist('format_image'), data_calib; return; end; check_directory; if ~exist('n_ima'), data_calib; return; end; check_active_images; images_read = active_images; if exist('image_numbers'), first_num = image_numbers(1); end; % Just to fix a minor bug: if ~exist('first_num'...
22483f9d3e28ade5a3d8f539122cea90ae8701bdc4d328fd2dd1e724f8a1e50c
MATLAB
2,589
70
% This script accurately computes and displays magnetic fields sampled on % a cross-section (sagittal plane) via the FMM method with accurate % neighbor integration % % Copyright SNM/WAW 2018-2024 %% Load/prepare data planeABCD = [1 0 0 -1e-3*Xm]; %Analytical equation of the observation point plane for neighb...
297bd6ace5a267f3276119d203ffdfa54be03e79ddcf06de9fb19d120b762346
MATLAB
2,589
69
% This script accurately computes and displays magnetic fields sampled on % a surface (coronal plane) via the FMM method with accurate % neighbor triangle integration. % % Copyright SNM/WAW 2018-2024 %% Load/prepare data planeABCD = [0 1 0 -1e-3*Ym]; %Analytical equation of the observation point plane for ne...
4b94adf27a712090a41bbde82a6aeca6a901c3fad7f251c081c3d0f33cfaae49
MATLAB
2,589
88
function M=movpwjph(N,Np,typesig); %MOVPWJPH Influence of a jump of phase on the interferences of the pWVD. % M=MOVPWJPH(N,Np,TYPESIG) generates the movie frames illustrating the % influence of a jump of phase in different frequency modulations % on the interference terms of the pseudo Wigner-Ville distribution. % %...
3c170e8656cdc40e990a0fad1e9f3ffb4e2c0407057437a04135d9378b89a36b
MATLAB
2,590
83
function [nrm] = normals(pnt, tri, opt) % NORMALS compute the surface normals of a triangular mesh % for each triangle or for each vertex % % Use as % [nrm] = normals(pnt, tri, opt) % where opt is either 'vertex' (default) or 'triangle'. % % See also PCNORMALS, PROJECTTRI % Copyright (C) 2002-2007, Robert Oostenvel...
d625b04ae94f41139a32f362737519dcd5f2f0e1636ee784a888b36e675f2b2c
MATLAB
2,590
57
%% select subset of stimuli for practice, which will not be shown during the task stimuli_all = load('/Volumes/LNDG/StateSwitch/B_paradigm/StateSwitchMR/C_Paradigm/StateSwitch/stimuli_corrJQK.mat'); stimuli_exp = load('/Volumes/LNDG/StateSwitch/B_paradigm/StateSwitchMR/C_Paradigm/StateSwitch/stimuliSelected.mat'); Cu...
2620440e064d9cf6b648e62ec3349eb6c502f746fd1a3578b717789d8b75d9cc
MATLAB
2,592
81
function testPmtk3() %% Minimal test that PMTK3 is correctly installed and working on your system % %% matlab Tools % This file is from pmtk3.googlecode.com %% Check that initPmtk3 was run % It generates a file called 'isOctave.m' that is not preinstalled fprintf('Checking initialization..........'); initPassed = ex...
9952bc33e018595615195c39bba3e0b8ea825efe84ea379e5dd2f6ae378c9db9
MATLAB
2,592
90
% create a channel map file Nchannels = 32; connected = true(Nchannels, 1); chanMap = 1:Nchannels; chanMap0ind = chanMap - 1; % ycoords = [100,100,120,120,... % 220, 220, 240, 240,... % 340,340,360,360,... % 460,460,480,480,... % 580,580,600,600,... % 700,700,720,720,... % 820,820,840,840,....
5d992dc07b23a091568478bdef9745fcfeb54eb7f32462b3e14bc3d0a4e15b1a
MATLAB
2,593
83
function [tfr,t,f] = tfrpage(x,t,N,trace); %TFRPAGE Page time-frequency distribution. % [TFR,T,F]=TFRPAGE(X,T,N,TRACE) computes the Page distribution % of a discrete-time signal X, % or the cross Page representation between two signals. % % X : signal if auto-Page, or [X1,X2] if cross-Page. % T : time instan...
c69166fcdd80fb71941818924e232a0187aa169d14aefc40bd1cfdae300b98be
MATLAB
2,593
87
function [subj_ids, dzne_ids, mbm_nos, subj_info, tab_hdr] = read_subject_ids(subj_file, varargin) % _ % Read Subject IDs and DZNE IDs from Excel or text file % % subj_file - an XLS or TXT file containing subject information % property - (optional) property to select sub-set of subjects % value - (opt...
2d4c4d23a1329c831e3341c092292401bab8f2789bf9b8ddfc143537cfc56811
MATLAB
2,594
67
%% Corr vs distance pooled % linear fit % [r_all,distance_all] = extract_variables ('corr_vs_dist','tot',resultsPath, 'r_all', 'distance_all',conditionType,conditionValue); % r_all = cell2mat(r_all); % distance_all = cell2mat(distance_all); % mdl = fitlm(distance_all,r_all); % figure % subplot(231) % plot(mdl); % xlabe...
f41dfbf3fe35e20e8d6e18ed8473c7e24e08463299aa65ee112f2a0ca82fb071
MATLAB
2,594
84
classdef MovieManagerModel < handle % State that backs the MovieManagerController view but is not % itself graphical. Lives on the Labeler so it persists across % MMC open/close cycles, and so batch code can mutate it without % a controller present. properties (Access=private) showPathEnds_ = true ...
f72812fde83703a1da06a872a3dacb475831966b7c205c4a665a1a70356fe2c1
MATLAB
2,594
75
function CBIG_RF_make_cortexMask(template_sub_id, count_map, num_sub, output_dir) % CBIG_RF_make_cortexMask(template_sub_id, count_map, num_sub, output_dir) % % This function creates loose cortical mask for a volumetric atlas, % using surface-to-volume count maps % The mask is created by thresholding the mapping by 15...
0c6302f27fb279c5bbc7a114f3faaa88e5d9f5985ca3156a8d18f057c858a529
MATLAB
2,595
61
% Demo for aggregate channel features object detector on Inria dataset. % % See also acfReadme.m % % Piotr's Computer Vision Matlab Toolbox Version 3.40 % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] % Licensed under the Simplified BSD License [see external/bsd.txt] %% extract training and testing images ...
e88711eb64f82f95458336a5ff8378cfbd57f218cb1dc235cc554017e61ef572
MATLAB
2,595
93
function CBH = cbhandle(varargin) %CBHANDLE Handle of current colorbar axes. % % SYNTAX: % CBH = cbhandle; % CBH = cbhandle(H); % % INPUT: % H - Handles axes, figures or uipanels to look for colorbars. % DEFAULT: gca (current axes) % % OUTPUT: % CBH - Color bar handle(s). % % DESCRIPTI...
7dd885fe7ca9402b961735a935ba46317b4796329e420592cf244ecd77c1fb15
MATLAB
2,596
50
function [censoredVolumes,lpffdCensoredVolumes,lpfdvCensoredVolumes] = ... getCensoredVolumesFromNifti(fileNameDataNifti,fileNameBrainMask3D, ... MPs,LPF_FD_Threshold,DV_GEV_d) % This is a wrapper for getCensoredVolumes that opens a nifti or cifti time % series using niftiread. It is identical, e...
2b7e8527bb541789f3607f31e6f1024bae87189e06b3b8eaf13a46275494f4ef
MATLAB
2,597
69
%% Across time-point accuracy load(fullfile(saveLoc, 'par_sess')) load(fullfile(par_sess{1}.saveLoc, 'decoder_excl_SL'), 'excl', 'exclName', 'useN_dec', 'winCenter', 'winStart', 'winEnd') for sess = 1 : 8 disp(num2str(sess)) par = par_sess{sess}; % Load normalized activity for th...
7a27d30f30bdffd3cb871ea5be88404620368acb78a65596880c777bc241db6a
MATLAB
2,597
94
function c = ttt(varargin) %TTT Tensor mulitplication (tensor times tensor). % % TTT(X,Y) computes the outer product of tensors X and Y. % % TTT(X,Y,XDIMS,YDIMS) computes the contracted product of tensors % X and Y in the dimensions specified by the row vectors XDIMS and % YDIMS. The sizes of the dimensions...
28aa4bb3650c3663dc8acd5afcc567cf458f85987eedd47543bbf1c6c201803d
MATLAB
2,598
82
function Draw_ROIs_on_Cortex(Anat,ROI) % % This function will draw ROI spheres on a model of the cortical surface. % Anat is a structure that describes the anatomy. % ROI is a structure that describes the regions of interest. % % Anat fields: % CtxL mesh for left cortex. mesh includes 2 fields, nodes and ...
5094d57908af04fe5a0d5da091d5d61ad5af386f501d7e4681243a5b1571a6b0
MATLAB
2,598
71
function str = gencode_substruct(subs, name) % GENCODE_SUBSTRUCT String representation of subscript structure. % Generate MATLAB code equivalent to subscript structure subs. See help % on SUBSTRUCT, SUBSASGN and SUBSREF for details how subscript structures % are used. % % str = gencode_substruct(subs, name) % Input a...
8efb0a283c0bf339d164924830267a5af99b4674c10899eae6bb64ba0a5b1eea
MATLAB
2,598
63
classdef ChristoffelPatch < diffgeometry.TransformableCP % TransformableCP that transforms like the affine connection %--------------------------------------------------------------------- % license %--------------------------------------------------------------------- % Copyright 2015 Idse...
72781adabda8787f18f603e440eec90593ab08609a5c9cd3c7ab933454d1c08e
MATLAB
2,599
64
function selected_color = color_picker_2(object_type) exponential_weight = 0.03; sigma = 1/3; % COLOR_PICKER assigns all colors to be plotted in a synthetic image. % Each object should have a representative color, a distribution, or % alternative data to support color selection. if strcmp(object_type, "table_backgro...
8e38c522e615f5df5a64046c3f8a335313eb735fd0f819f9c92d42352e03dbfc
MATLAB
2,599
56
function [I,T]=bspline_transform(O,I,Spacing,mode) % Function bspline_transform, is a wrapper of the mex % bspline_transform_2d_double and bspline_transform_3d mex functions % % [Iout,T] = bspline_transform(O,Iin,Spacing,mode) % % inputs, % Iin : Input image. % O : Transformation grid of control points ...
a4904effd516d4dba3725506676142819bf4be775299eff09f899bfd127ce576
MATLAB
2,599
100
function [ intersections, volumes, rr, k_coef, m_coef , Rsquared] = sholl( img_3d, name ) % function: Short description % % Extended description % loading the parameters parameters; %% ------------------------- Finding center of the cell ------------------- % Central position [x,y, z] % Just take c...
3868cdf85169c1d65f74ada9a25a2f651022f5cffd0edd7e7fa7fc1c59906282
MATLAB
2,600
70
% This script accurately computes and displays magnetic fields sampled on % a cross-section (transverse plane) via the FMM method with accurate % neighbor integration % % Copyright SNM/WAW 2018-2024 %% Load/prepare data planeABCD = [0 0 1 -1e-3*Zm]; % Analytical equation of the observation point plane for ne...
f48e4f13cfd0affaf40fabacb07cc72b39b7f2df238817078d4082dedcb49efc
MATLAB
2,600
91
function [ ampbins,phasebins,sig2powerskew,sig2prefangle,phaseamphist ] = PhaseAmpCouplingByAmp( sig1phase,sig1amp,sig2amp,numbins ) %PhaseAmpCouplingByAmp(sig1phase,sig1amp,sig2amp,ampbins,numphasebins) %calculates phase amplitude coupling between the phase of signal 1 and the %amplitude of signal 2, with respect to t...
30839af075b74202ec0edbdca36c7257f8e3e178cce1b179c8d82f8decc187eb
MATLAB
2,601
91
function dgm = dgmTrainFullyObs(dgm, data, varargin) %% Fit a dgm via mle/map given fully observed data % % See dgmTrain %% % This file is from pmtk3.googlecode.com [clamped, localEv] = process_options(varargin , 'clamped', [], 'localev', []); if ~isempty(localEv) && ndims(localEv) < 3 && dgm.nnodes > 1 localEv =...
dde30a1b21bb0e2c7c1430c7f65c75a8c1b09c5da8c2312413cf5bff06ef8145
MATLAB
2,601
67
% Relationship between columns in out.dataMat and out.dataMap or dataMat % and DataMap and behavior % Dot trials par.idx = struct('dot_on' , 1, ... 'dot_off' , 2, ... 'saccade' , 3, ... 'dot_dir' , 4, ... 'dot_coh' , 5, ... 'sig_coh' , 6, ... 'se...
66a8ab156d83f6a7da0d8bb0b7e9efa5e809a37f1007a5d4f538bb965d258423
MATLAB
2,602
99
% 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,...
4fa16375220d55e88670401c8b472ea1a30c1fc89e04ede4a998020432f585ea
MATLAB
2,603
89
function [] = graphVizIt(adj,labels,landscape,removeDisconnected) % graphVizIt(adj,labels) % % Path to graphViz is hard-coded in this function nNodes = length(adj); if nargin < 2 for n = 1:nNodes labels{n} = sprintf('%d',n); end end if nargin < 3 landscape = 1; end if nargin < 4 |...
bcd0301c67400ffde0c43f55d9d5289dee761e3131848460709ab1baa8be0c1c
MATLAB
2,603
77
%% Plot unigrams and bigrams of Darwin's "On the origin of species" % %% % This file is from pmtk3.googlecode.com loadData('ngramData'); % cotnains bigrams, ugrams, etc (use ngramMake to create this) if(0) % Plot bigram frequencies bigramFig = figure; axes1 = axes('Parent',bigramFig,... 'YTickLabel',...
3ec5f1962101e8d5093f3d4f61ce51212c2e81226c0aeb4c705e43487821139a
MATLAB
2,604
97
% _ _ % ___ _ __ __ _| |__ ___ ___ _ __| |_ % / __| '__/ _` | '_ \/ __|/ _ \| '__| __| % | (__| | | (_| | |_) \__ \ (_) | | | |_ % \___|_| \__,_|_.__/|___/\___/|_| \__| % % moves plots when scroll wheel or scroll bar is moved function scroll(self,src,event) d = dbsta...
eea0888f899fa40921ebe2a41342195e3613ee003885840768595f3215531f8a
MATLAB
2,604
75
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %-- Main 3D Scanning Script %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if exist('calib_cam_proj_optim.mat')~=2, error('The scanner calibration file does not exist. Make sure to go to the directory where the scanning images and the calibration file are located (folder scanning_exam...
389f5724296be45412fc6ce2cbd7671de6618bd40caeddac206ea86742690cc1
MATLAB
2,605
100
function [x] = VBA_spm_cat(x,d) % Convert a cell array into a matrix - a compiled routine % FORMAT [x] = spm_cat(x,d) % x - cell array % d - dimension over which to concatenate [default - both] %__________________________________________________________________________ % Empty array elements are replaced by sparse zero...
a7b260522e7f90a712100e3e8dd5ca9c7b05255aec407608fe045d53228d576c
MATLAB
2,605
86
%% Fit a student distribution as class conditional density to the bankruptcy data % % This file is from pmtk3.googlecode.com function robustDiscrimAnalysisBankruptcyDemo() setSeed(0); bank = loadData('bankruptcy'); N = size(bank.data,1); perm = randperm(N); trainNdx = perm(1:round(0.5*N)); testNdx = setdiff(perm, ...
84dca9c44d3dbe676188d8bff6c5ec7d32cba1336d01d3c00c4326f387153b38
MATLAB
2,606
58
function [fout, insignal,gbatch] = mleGradSubunitGridModel(mdlparams, xvals, yy, ArgSubs, iuse,lambda,wd) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here if nargout <3 Rf = calcSubunitActivationAmplitudes(mdlparams, xvals(iuse, 1)); subacts = Rf .* ArgSubs(iuse, ...
9788ffd653716389e8c38682fa05714095c95dd1c6095289727a703c8d3e6f8c
MATLAB
2,607
87
function errstring = consist(model, type, inputs, outputs) %CONSIST Check that arguments are consistent. % % Description % % ERRSTRING = CONSIST(NET, TYPE, INPUTS) takes a network data structure % NET together with a string TYPE containing the correct network type, % a matrix INPUTS of input vectors and checks that the...
d49fba351afdc2df0300afe4e95a27168fffd10012d6c89d95a0b67993c6206c
MATLAB
2,607
91
% Demo for distributed (locally multivariate) HRF close all clear variables % Choose basic settings for simulations TR = 3; % sampling time interval (in sec) n_t = 60/TR; % number of time samples (over 40 sec) deltat = 5e-2; % micro-time resolu...
56ea9d9392d86fb13c0ab2aafde4ac32d39962d5018b32b256e3d0d0220d76b9
MATLAB
2,608
76
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef DateTime < matlab.mixin.CustomDisplay properties (GetAccess = public, Constant = true) Size = 14; end %DATETIME class representation of a date and time. properties (Get...
879c18bfd80d7861f1057a7fa4eb45ffaae20290dc532df62134de039cfdc58a
MATLAB
2,609
93
% prepare load clab_example; sa=prepare_sourceanalysis(clab_example); % load functional data load cs_example; % this a cross-spectrum at 10 Hz [u s v]=svd(real(cs_example));field=u(:,2); % construct an example field for demo %% viewing options % fields figure;showfield(field,sa.locs_2D); % cross-spectra figure; s...
7e27446d73042424f6c9e242270abe1b60b0d1f21f9ae871f03d6c8945e57b9f
MATLAB
2,611
97
%% % BSIZES = [1 2 4 8 16 32 64 128]; % % for n=nets(:)',n=n{1}; % s.(n).t_overall = cell2mat(cat(1,s.(n).t_overall{:})); % s.(n).t_pred = cellfun(@cell2mat,s.(n).t_pred,'uni',0); % s.(n).t_read = cellfun(@cell2mat,s.(n).t_read,'uni',0); % end s = load('res20200210.mat'); nets = setdiff(fieldnames(s),'bsizes');...
26fb848e2f7e54969ca127c3fe88d1e71902ead9b3696f82faea26d775b287c8
MATLAB
2,612
87
function [p, tstat, df, stats] = stattest(data, test, settings) % _ % Perform statistical test for measured data %%% chi-square test for indepence %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if strcmp(test,'chi2ind') Y = data{1}; if nargin < 3 || isempty(settings) settings.corr = 'yes'; else ...
6267051f2cc5d2cc15d0737a066017c4568ad6a9720d97169278904fe9d86613
MATLAB
2,613
64
function EWsig=McNemar_Figs3(dataOut,Bxname,IM,B,params) % Plot network pairs meeting significance if ~exist('B','var'),B=1;end Pth=0.05./B; PthMcN=0.05; [NNidx,Tidx,TNidx]=IM2idx(IM); Npairs=length(TNidx); Nnets=max(IM.key(:,2)); NetKey=[[1:Nnets]',[1:Nnets]']; %cMap=[1,1,1;0,0,0]; %% Significant stats...
72eb2d3ab63e25450a0ac13803164c6230231c73632ad13e98564d6f1cccb94c
MATLAB
2,615
92
%% RSA fMRI-behavior script for: %% The transformation of sensory to perceptual braille letter representations %% in the visually deprived brain % Marleen Haupt and Monika Graumann % 22.02.2024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % RDMs are located in output folder % (as a default setting or...
7941b7c69e4eee99d94335ddd733d86d88227dcacdec73317cac5aef039f62d2
MATLAB
2,615
78
% Matlab version of the R function one_over_f % https://rdrr.io/cran/primer/src/R/one_over_f.R % #' Function to generate 1/f noise. % #' % #' Generates 1/f noise with a specified power or amplitude. % #' @param gamma spectral power, numeric, where 0 generates a white noise time series, 2 generates reddened noise. Defa...
b6226107497c063ceac4be0e82324b8f22bbd560642d54e526f4fd7b9d50e27f
MATLAB
2,615
78
function [sdims,vidx] = tt_dimscheck(dims,N,M) %TT_DIMSCHECK Used to preprocess dimensions tensor dimensions. % % NEWDIMS = TT_DIMCHECK(DIMS,N) checks that the specified dimensions % are valid for a tensor of order N. If DIMS is empty, then % NEWDIMS=1:N. If DIMS is negative, then NEWDIMS is everything % but th...
c7f483df56d595cdf904f6bc7ee2469c3320741742e86826f04f97f4d3ef2d3b
MATLAB
2,615
73
function [H] = quaternion(q) % QUATERNION returns the homogenous coordinate transformation matrix corresponding to % a coordinate transformation described by 7 quaternion parameters. % % Use as % [H] = quaternion(Q) % where % Q [q0, q1, q2, q3, q4, q5, q6] vector with parameters % H corresponding hom...
38e1cad61e661fa7fa160e972dd53feff24413e3faab787f19b485b2887e9ded
MATLAB
2,616
104
% Better Stitcher v 1.01, released 2021 0326 % An improved version of the wably stitcher done by YTW in YK lab clear close all % Basic setting Sorce_folder = 'E:\lab_member\HB\20210223_16_57_04_HB_HB408_3_16wk_WTctrl_AbdAorta_DRAQ5-488_Iba1-594_CD31-647_15x_1um_Rsht_Transfer'; % This one "refered" to be SSD ...
af8cdc0809dfdcba7e5e33dc13bda0a2ba9a04d2be5b72ae4d19fab7955d482f
MATLAB
2,616
73
function [gamma2] = DTFsigtest(gamma2,gamma2_sig) % DTFsigtest - perform significance test for the calculated DTF values. % % Usage: sig_gamma2 = DTFsigtest(gamma2,gamma2_sig) % % Input: gamma2 - the calculated DTF values (nchan x nchan x nfreq) % gamma2_sig - the significance cut-off values (nchan x nc...
0477377e4b29361f1d2bd2232b37f6850cb7ef21453c2c254cf92efab9632f36
MATLAB
2,617
65
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef StimulationWaveform < Tag %STIMULATIONWAVEFORM Storage element for StimulationEventData, before it %is linked to StimulationEvents properties(GetAccess = private, Constant = true) ...
0a5f77fffbde6c436452da4b1ab80a755d393cd8b3d38db9b3f996a5b47b3eaf
MATLAB
2,617
54
function [experiment,stable_cell_ids,stable_cells_new_ids]= get_stable_cells(folders,method) % calculates place fields for first and second half of laps for each track % cells that have peaks > 1Hz in both are kept, rest are discarded % OUTPUT: indices fo stable cells, coded by experiment, session cell id, and generali...
129292b1186108ec514f9385db694018d9b12ff299baf4fd9e4fe7a79114f366
MATLAB
2,617
84
function [scalo,f,T,a,wt,wavescaled] = contwtgnmir(x,fmin,fmax,N,wave); % [scalo,f,T,a,wt,wavescaled] = contwtgnmir(x,fmin,fmax,N,wave); % Continuous wavelet transform of mirrored 1-D signals % If x = [a b c e f] is the signal to analyzed, contwtmir.m runs contwt.m % on the mirrored version XxX = [c b [a b c d e f] ...
38c78309601efb83a35ba6a28ab558299fac1180d2801601571cc6053da0ff62
MATLAB
2,618
94
%% Plot contours of penalty(w1) + penalty(w2), where penalty(w) = -log p(w) % and p(w) = normalGamma(w | delta, c) % PMTKauthor Francois Caron % PMTKmodified Kevin Murphy %% % This file is from pmtk3.googlecode.com function normalGammaPenaltyPlotDemo() c = 1; pas=0.01; %[X,Y] = meshgrid(-1:pas:1,-1:pas:1.1); range= [...
acf0d93862e469591dae3d8c9c82e5f49d61aae72d7e47a1f46ea47b9c58fca6
MATLAB
2,618
66
function [miss,roc,gt,dt] = acfTest( varargin ) % Test aggregate channel features object detector given ground truth. % % USAGE % [miss,roc,gt,dt] = acfTest( pTest ) % % INPUTS % pTest - parameters (struct or name/value pairs) % .name - ['REQ'] detector name % .imgDir - ['REQ'] dir containing test images...
23a6ee4267790091d3e0ad7f1dabc67ae3c6d9f9371f13407bc56348e8ea5ec0
MATLAB
2,619
116
clear; clc; close all; %% hist_data = []; n_subjects = 6; srate = 400; for isub = 1:6 load(['ze' num2str(isub) '_cho_method_ecog_rest_v1.mat']); load([ 'ze' num2str(isub) '_brodmann.mat']); % ch_pk_freq_prob = []; start_time_ch = []; start_time_tp = []; ...
c7503462d1a499d9302e0359c8d7c0c5a356750928aa475c9e8b60a072e68fd6
MATLAB
2,619
66
function [options,dim] = prepare_kToM(K,payoffTable,role,diluteP) % specify input structures for k-ToM learning models % function [inF,inG] = prepare_kToM(level,payoffTable) % Note: k-ToM models can be extended with partial "forgetting" of the % opponent's sophisitication level [see RecToMfunction.m]. % IN: % - K: de...
1b192aa8d7957e6c6b38d2335367a6faa228f81aa3cd517a32a953981912d0b0
MATLAB
2,620
84
function refreshZipFiles(localSource, refreshList) %% Refreh the contents of the individual zip files in each data or pmtkSupport folder % If refreshList is not specified, do this for every data or pmtkSupport directory. % %% Inputs % localSource - this is the full path to the local copy of the pmtkData or % ...
18a85649694b88b50f236a5c579f44f5ad6fd23134cb08a5b30b2483edff4b4b
MATLAB
2,621
77
% Purpose: Calculate network for each MS-HBM network % Inputs: Hungarian-matched individual network parcellations % Outputs: rh_labels and lh_labels containing overlap values for % each network % % Written by M. Peterson, Nielsen Brain and Behavior Lab, under MIT License % 2024 % To run: % 1. Claim computing resourc...
267e5706aedc481704e07f07ff6d4c29d9f19845008d95929774da4d5d309658
MATLAB
2,621
65
loadParameters; filename_centroidsORIG = fullfile(params.punctaSubvolumeDir,sprintf('%s_centroids+pixels.mat',params.FILE_BASENAME)); load(filename_centroidsORIG); %% Load the number of puncta in each round and get an average num_puncta_per_round = zeros(params.NUM_ROUNDS,1); for rnd_idx = 1:params.NUM_ROUNDS nu...
8ca609f6b7066cf027ddf923cbb7467caa47d8f42bc4bbd39ed12dc309068b57
MATLAB
2,621
77
function mesh = prepare_mesh_tetrahedral(cfg, mri) % PREPARE_MESH_TETRAHEDRAL % % See also PREPARE_MESH_MANUAL, PREPARE_MESH_HEADSHAPE, % PREPARE_MESH_HEXAHEDRAL, PREPARE_MESH_SEGMENTATION % Copyrights (C) 2016, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the docume...
c0a52cc281a157c20625ffaa760fdfd84a8c7e3c9fd26cbc48dfea0dc02339c1
MATLAB
2,622
79
function [dat] = ft_preproc_hilbert(dat, option) % FT_PREPROC_HILBERT computes the Hilbert transpose of the data and optionally % performs post-processing on the complex representation, e.g. the absolute % value of the Hilbert transform of a band-pass filtered signal corresponds % with the amplitude envelope. % % Use ...
ca46c27a9fdef58171d58a2e87a640f6a9380218ff696ad07b3728bf6736691f
MATLAB
2,623
116
clear; clc; close all; %% hist_data = []; n_subjects = 6; srate = 400; for isub = 1:6 load(['ze' num2str(isub) '_cho_method_ecog_rest_v1.mat']); load([ 'ze' num2str(isub) '_brodmann.mat']); % ch_pk_freq_prob = []; start_time_ch = []; start_time_tp = []; ...
bf159ae04a9e31f7a7a85b7c377070d528645c2e0ff1ff8a865430a53d8dcf8e
MATLAB
2,624
116
clear; clc; close all; %% hist_data = []; n_subjects = 6; srate = 400; for isub = 1:6 load(['ze' num2str(isub) '_cho_method_ecog_rest_v1.mat']); load([ 'ze' num2str(isub) '_brodmann.mat']); % ch_pk_freq_prob = []; start_time_ch = []; start_time_tp = []; ...
f84b6b149d394c83b0dd9aa8298351184654ecbbae861f945c0bedd1eaeb8584
MATLAB
2,624
90
function tree = struct2xml(s,rootname) %STRUCT2XML Convert structure to an XML tree object and specify its root name % TREE = STRUCT2XML(S,ROOTNAME) converts the structure S into an XML % representation TREE (an XMLTree object) with ROOTNAME as the root tag, if % provided. Only conventional objects (char, double,...
cf53ad63027c0710a638925a14f20ef43c56690bcc2149984a3ebfb2787e0b4b
MATLAB
2,625
146
function mean_d = erp_lan(LAN,roi,bl,ifplot,hh,st) % % % erp_lan.m % plotea erp por electrodo o grupos de electrodos (roi) % roi = vector de electrodos % bl = tiempos de linea de base [s s] % % % v.0.0.3 % Pablo Billeke - Rodrigo Henriquez % 2009 % % 08.08.2010 % 16.04.2010 color =[{'blue'},{'red'},{'green'},{'yellow'...
216b8d82074a3bfcfa9e32eb072e5564ee6ff434270437dcdb28bddafd7b7ee4
MATLAB
2,626
80
classdef EgnorRecording < AudioRecording methods (Static) function canLoad = canLoadFromPath(filePath) % See if the file's extension is .ch1, .ch2, etc. [~, ~, fileExt] = fileparts(filePath); canLoad = ~isempty(regexp(fileExt, '^\.ch[0-9]$', 'once')); ...
3aeab83f41a1994e01d143cf9a340b54ad3fdc6ee44fcdc754d95739246bafca
MATLAB
2,626
73
function [microsaccades, msdx,msdy,stddev, maddev] = GetMicrosaccadesEK(EyeDeg, SAMPLING, VFAC, MINDUR, blink_data) %% INPUTS %EyeDeg is 2xN long matrix of gaze location data (in degrees, Left and %Right eye are input separately %SAMPLING is the hertz of the data. Ex: 1000 for 1000Hz %VFAC is the constant ...
92a65ea240b33faa0c03f115b6a8ba2d77ea59606a5325f297679c506f36f14b
MATLAB
2,626
67
function createLightTrigfromADC(p,rangeOFsubj) % % Version 1 Sonya Bells % 2016 November % Based on Mark L scripts % % INPUT FILES: % - raw .ds (MEG 'RAW') % % OUTPUT FILES: % - adjusts markerFile %%% OUTPUTS %%% % p.paths.fig_headmotion = @(id) [p.paths.output_dir(id),'headmotion.png']; % determine which subjects ...
a4185efaf5446965b3c957a7906155b2c3badec1df833fb3baf73833313a22d5
MATLAB
2,626
60
function output = SOFAconvertCoordinates(input,input_type,output_type,input_unit,output_unit) %SOFAconvertCoordinates % output = SOFAconvertCoordinates(input,input_type,output_type,input_unit, % output_unit), converts the specified coordinate variable to specified % output_type and returns the results. % SOFA AP...
b7dc71a32146d1d610980ae5c6de75d70720cf97dd185065b206e1919f3bcbeb
MATLAB
2,626
87
%% ANOVAS for GAMMA data DIRresults_anova = [DIRresults, '/anova']; mkdir(DIRresults_anova); % running multiple one-way ANOVAs on the words vs non vs noise data % should be used after REMAP and HILBERT are done for j = 1:length(good_chan) chan = good_chan(j) chan_words = squeeze(trials_aligned_word(:,:,ch...
5b60efedb4fbb1be7c84a0b53af049bac3e9fb13024fe7750d1fd1b5867232fa
MATLAB
2,627
76
function [functionList, classList] = dependsOn(mfile, dirRoot) % Find dependencies on a directory structure for a single file %% % This file is from pmtk3.googlecode.com dependencies = depfunTB(mfile); functionList = {}; classList = {}; for i=1:numel(dependencies) try fid = fopen(dependencies{i}); ...
805c01c871e5697b937f8d580af18f468728f76bb6fcc7818fd2b5c3f13494c7
MATLAB
2,627
83
function [tfr,t,f] = tfrmh(x,t,N,trace); %TFRMH Margenau-Hill time-frequency distribution. % [TFR,T,F]=TFRMH(X,T,N,TRACE) computes the Margenau-Hill % distribution of a discrete-time signal X, % or the cross Margenau-Hill representation between two signals. % % X : signal if auto-MH, or [X1,X2] if cross-MH. % T ...
a75b4961436a959158f0430cde8f6689279acec0fe16b7293ae18ec2438efb56
MATLAB
2,628
86
function [dat, ref] = ft_preproc_rereference(dat, refchan, method, handlenan) % FT_PREPROC_REREFERENCE computes the average reference over all EEG channels % or rereferences the data to the selected channels % % Use as % [dat] = ft_preproc_rereference(dat, refchan, method, handlenan) % where % dat data matr...
bcdda030cedf507ef0e78950ce1e77f61ae89cd961058c27366c0dcacc0de0f2
MATLAB
2,628
116
% 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,...
d0ae928b090529529c13780ee6077663201fcc409bda4e126b65697215b67f30
MATLAB
2,628
84
function lan_master_gui_spks_auto(ts, clu) figure maxlag = 300; choice = 1; bin = 3; uibg = uibuttongroup('units', 'norm', 'position', [.55 .0 .45 .08]); uicontrol('style', 'radiobutton', 'string', 'c1',... 'units', 'norm', 'position', [.1 .1 .2 .5], 'parent', uibg); uicontrol('style', 'radiobutton', 'string', 'c...
2ac20621cbbca68e71551815d5e04161de4b5586332fbcf14ef5ce63191a7905
MATLAB
2,631
66
function global_warpingTEMP(round_mov,keys_fixed,pos_fixed,FOVS,FOVS_per_fixed_fov_total,bigparams) % In this function we know all the moving fovs that are implicated per % fixed fov. So in this case, we calculate what the warp would be if they % were directly overlaid. This means we can do the math on local, not % gl...
395a989cca2a5c7e3aa4d0d45ffe124812e522952e0cde559832b62ad0f66771
MATLAB
2,631
86
function [stimulus, response, segment, timezero] = read_brainvision_vmrk(filename) % READ_BRAINVISION_VMRK reads the markers and latencies % it returns the stimulus/response code and latency in ms. % % Use as % [stim, resp, segment, timezero] = read_brainvision_vmrk(filename) % % This function needs to read the hea...