sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
35dd3722d8c173c5209ef8e15f9c2f1aaa197650628c2ca90a22895dc08231f9 | MATLAB | 8,673 | 214 | function [positionDecodingGLM] = bz_positionDecodingGLM(varargin)
% USAGE
% [] = bz_positionDecodingGLM()
%
% INPUTS
%
% spikes
%
% behavior
%
% lfp
%
% smoothingRange
%
% plotting - cell UID to plot
%
% saveMat
%
% OUTPUTS
%
% positionDecodingGLM cellinfo struct with the following fields
%... |
9beebd2c6ee558de95e803f7de67df7c2fe8271e36ffb8e22b1a4203de5ef14e | MATLAB | 8,682 | 219 | % pop_crossf() - Return estimates and plots of event-related spectral coherence
%
% Usage:
% >> pop_crossf(EEG, typeproc, num1, num2, tlimits,cycles,
% 'key1',value1,'key2',value2, ... );
% Inputs:
% INEEG - Input EEG dataset
% typeproc - Type of processing: ... |
1036bc7f565e024760617d68ed5db24daa07c4a159dcbb8efe321929218da25e | MATLAB | 8,686 | 294 | function z = times( x, y, oper )
% Disciplined convex programming information for TIMES:
% In general, disciplined convex programs must obey the "no-product
% rule" which states that two non-constant expressions cannot be
% multiplied together. Under this rule, the following combinations
% are a... |
fa4e6de7b514486eefa101282f35210c17341731c88d5d635deeac0aec874cb9 | MATLAB | 8,687 | 196 | % pop_envtopo() - Plot envelope of an averaged EEG epoch, plus scalp maps
% of specified or largest contributing components referenced
% to their time point of maximum variance in the epoch or specified
% sub-epoch. Calls envtopo(). When nargin < 3, a query window
% ... |
bb62d78483207e14877908bd916b2971902a0bd2b1468ebd151548c158960ceb | MATLAB | 8,688 | 201 | function varargout=ami_stergiou(varargin)
% [tau,ami]=ami_stergiou(data,L)
% inputs - data, single column array
% - L, maximal lag to which AMI will be calculated
% - bins, number of bins to use in the calculation, if empty an
% addaptive formula will be used
% outputs - tau, first ... |
b635272fbe8c2846a6a6eef899f24cdb1f417c838f5aa266b22d8903205c3d3f | MATLAB | 8,690 | 272 | % ########## This function is deprecated. Use eegmovie instead. ##########
%
% headmovie() - Record a Matlab movie of scalp data.
% Use seemovie() to display the movie.
%
% Usage: >> [Movie,Colormap] = headmovie(data,elec_loc,spline_file);
% >> [Movie,Colormap,minc,maxc] = headmovie(data,elec_lo... |
5a4b42313305b7e0e1afd8b8151283283a021cbfb8b65b1d66aace2d8d28dba1 | MATLAB | 8,695 | 189 | function [inputBatchName, pSigIndCellArr, outlierIndxArr, sigRes, mvrgCoefStructArr] = multiCompareIndCellsMVRG(spekLabelBase, smLabelBase, displSpacing, varargin)
%MULTICOMPAREINDCELLSMVRG: takes different testResult containing coefficients of multivariate regression of individual cells from different population (i.e.... |
32acb92fc1d3b5d2d33347edff0fbf0182c1bdf19b0aa071c771f214d2bbafc2 | MATLAB | 8,701 | 261 | % ====================================
%% Help
% ====================================
%
% CBIG_supp_fig3_dice
%
% This script replicates Supplementary Figure 3: the inter-subject DICE
% coefficient map for the NIH cohort. For each of the 15 networks, pairwise
% DICE coefficients are computed across all NIH subjects tha... |
f905e379ede46c4b4c1fbe594cbf51dbc24a854e0bea6005ff478c9772776b5f | MATLAB | 8,701 | 271 | function CBIG_pMFM_step1_generate_TC_schaefer()
% This function is the wrapper to generate parcellated time serises and FCD
% for Schaefer 100 parcellation
%
% There is no input for this function as it can automatically get the
% output file from previous step.
% There is no output for this function as it will generat... |
45da42af63eb600277cab16400995d53f5f4395b0d553e6987fe5d9da2caaf23 | MATLAB | 8,709 | 214 | function fibers=FT(FA,VectorF,Roi,parameters)
% This function will perform straight forward fiber tracking from the
% whole brain using linear interpolation
%
% fibers=FT(FA,VectorF,Roi,parameters);
%
% FA: A 3D matrix with the fractional anistropy (FA) of a DTI dataset
% VectorF: A 3D matrix with the main fiber... |
9d49a7765d5733b4a7cf0e804f3200b91cbc9730375821a52a19d504faac5d1f | MATLAB | 8,710 | 206 | function RegPara = reg_WithCrossStack(RegPara, handles, imageinfo, figuretitlename, fext, k, w, f_wait)
[userview, systemview] = memory;
% fprintf('Available memory')
disp(systemview.PhysicalMemory.Available)
Mem_max = systemview.PhysicalMemory.Available;
if handles.useGPU
Mem_max = min(systemview.PhysicalMemory.Av... |
eabaec2cfd365e415fe380260ae1718ce155aa5e69ada764c6787df2de0f9dec | MATLAB | 8,713 | 204 | function PhantomCreationFunction(params)
load(params.ChiModulation_file,'label')
R12chipos = zeros(1, length(label));
R2star2chipos = zeros(1, length(label));
R12chineg = zeros(1, length(label));
R2star2chineg = zeros(1, length(label));
for k=1:length(label)
R12chipos(k)=label(k).R12chipos;
R2star2chipos(k)=la... |
ca84e02ff333b81c991ed9f6b2dc5703b51a75e62a58bfc28cb6ac48eeb59ec3 | MATLAB | 8,723 | 242 |
function [pulses] = bz_getAnalogPulses(varargin)
% [pul, val, dur] = bz_getAnalogPulses(varargin)
%
% Find square pulses. If not argument it provide, it tries to find pulses
% in intan analog-in file.
%
% <OPTIONALS>
% analogCh List of analog channels with pulses to be detected (it support Intan Buzsaki Edition).... |
f50ffbb8e550e39f1e6b0b42f5f11fa43924cede1db18ddb2da1db01b571282b | MATLAB | 8,725 | 218 | function index=singleflyeventdetection(headpath,fileexpnum,version,saveex,picknew,savefigs)
%This is for doing every trial, plotting the colour, and the sum of
%detected events
%make another version that does the mean
if ~picknew
load('paperexample')
end
if version==2
cd('extracted2')
if picknew
s... |
4c65d93c980b1c2a7b6f93860bd14d2beebd82a8a3d915cb9e8698d124168f75 | MATLAB | 8,729 | 305 | function gmtc=ea_extract_timecourses_vat(options,handles,usevat,dimensionality)
directory=[options.root,options.patientname,filesep];
stims=get(handles.vatseed,'String');
stim=stims{get(handles.vatseed,'Value')};
%% create voxelmask
% build voxelmask
voxelmask.locsvx=[];
voxelmask.vals=[];
voxelmask.locsmm=[];
for... |
49ea0027a2165ece0ea3f125228f618bac06e07f92c8404aa25652e73f8787e8 | MATLAB | 8,744 | 226 | % pop_importerplab() - import ERPLAB event list file and bin file into
% EEGLAB event structure for use in STUDY processing
%
% Usage:
% >> OUTEEG = pop_sample( INEEG, file1, file2);
%
% Inputs:
% INEEG - input EEG dataset
% file1 - ERPLAB event list text file
% file2 - ERPLAB bin fi... |
2d151612b33f407a1302477bd4b47d77ab5dec84149845bb2a272d23d9aa14df | MATLAB | 8,747 | 181 | % Help for file Nlx2MatEV
% Version 4.1.1
%
% Purpsose
% The purpose of this program is to extract Neuralynx data from a file and load it into the matlab environment with any combination of fields
% from the file within a time or record range or using a time or record list.
%
% Composition
% This program is a matlab ... |
8fc84c07e94fe6e3e42411004a12384c0060e189b5c57423e2bdcfad033d18f5 | MATLAB | 8,748 | 231 | function [H, pValue, W] = swtest(x, alpha)
%SWTEST Shapiro-Wilk parametric hypothesis test of composite normality.
% [H, pValue, SWstatistic] = SWTEST(X, ALPHA) performs the
% Shapiro-Wilk test to determine if the null hypothesis of
% composite normality is a reasonable assumption regarding the
% population dis... |
e645845cb85acd578d38d3e537b870e0e46a16cc6701516040acd0d5ca42d357 | MATLAB | 8,752 | 218 | % pop_readlocs() - load a EGI-format EEG file (pop up an interactive window if no arguments).
%
% Usage:
% >> EEG = pop_readlocs; % a window pops up
% >> EEG = pop_readlocs( filename, 'key', val, ...); % no window
%
% Inputs:
% filename - Electrode location file name
% 'key',va... |
498229b8ee02ef0ac7006a22e66a6e615c028011c38a7223d0725d556b759866 | MATLAB | 8,766 | 211 | %% QUICKTE - quick transfer entropy calculation
% Calculates the transfer entropy between two variables. The data can be
% continuous or discrete. If the data is single trial, the transfer
% entropy is calculated through time. If the data is trial based, the
% transfer entropy is calculated at each time point in the tr... |
99da00725cacb556416dc8a3a867ffc09765c287fd6cfd31470b27019cff9b3b | MATLAB | 8,767 | 211 | function ea_get_E_field_along_fibers(pt_folder,stim_space,e_field_file, MNI_connectome_file, side_suffix, threshold)
% get E-field metrics along fibers (computed in native space)
% By J.Roediger and K.Butenko
arguments
pt_folder % full path to the patient folder in the Lead-DBS dataset
stim_space... |
7bc361cd58b6cc5d70e7e6dbddb50bd3cd8d8bfef87f3d677e03627e302ac839 | MATLAB | 8,768 | 249 | function batch = StartBatch(mfile,bfile,varargin)
%StartBatch - Start a new batch job.
%
% Batch processing is useful if you need to repeatedly perform a given analysis
% on different data sets. Using batch processing is easier and more reliable
% than writing a simple 'for' loop:
%
% * You must only supply the code ... |
f21ea67662f07e4f8b25840159160d0a9cd2f30ebd7ee50a87f5e1d86ad152dd | MATLAB | 8,770 | 255 | function varargout = SplitVec(v, fun, varargin)
% Purpose: Partition an input vector V into smaller series of subvectors
% of consecutive elements based on split points
%
% EXAMPLE:
% > s = SplitVec([1 1 1 2 2 3])
% > s returned is: {[1 1 1] [2 2] [3]}
%
% INPUT:
% V: main argument, array of the ... |
4d1ee2bba1a0b5ea1575591a9fe8275e81fa014b625343389c43bf3ad0492378 | MATLAB | 8,775 | 205 | function [] = plotTRFmap(TRFoutput,varargin)
% plotTRFmap: plot TRF map output (average across cells) from TRFmap for an animal.
% [] = plotTRFmap(TRFoutput,varargin)
%
% INPUT:
% TRFoutput, --> structure with TRFmap, BF, etc for a given animal
%
% varargin, --> ... |
2a9cbe7383e2ee2e5b05fdb8be32929b1fabd7a30ca4711d76aba472d1fbf8bd | MATLAB | 8,776 | 201 | % -------------------------------------------------------------------------
% Script: T1D_Estimation.m
% Authors: Zijian Gao,Weitian Chen
% Email: zijian.gao@link.cuhk.edu.hk
% Date: 2025-12-20
% Version: 1.0
%
% Copyright (c) 2025 Zijian Gao, Qianxue Shan, Weitian Chen. All right... |
fc28bae8de11bf3729ff325cfe88afc69d755622c9ee70884d2755b3ae885b37 | MATLAB | 8,781 | 256 | % testica() - Test the runica() function's ability to separate synthetic sources.
% Use the input variables to estimate the (best) decomposition accuracy
% for a given data set size.
% Usage:
% >> testica(channels,frames); % No return variable -> plot results
% >> [testresult] = ... |
f426dc19566e820626b8a959f5e2f3b9b8f13cea1e313c830bb34d1b92ab8f5c | MATLAB | 8,785 | 189 | % std_filecheck() - Check if ERSP or SPEC file contain specific parameters.
% This file must contain a Matlab structure with a field
% named 'parameter'. The content of this field will be
% compared to the 'params' input. If they are identical
% the o... |
cd1674536f62fe4431e3be9336dea10f3d01f432126ffe1e7d0e5fc39ee85d21 | MATLAB | 8,786 | 236 | function varargout = SpineTrace_batch(varargin)
% Last Modified by GUIDE v2.5 20-Apr-2022 14:52:58
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @SpineTrace_bat... |
2fc7ac9eacd44ae86bd762e5c85c89e567a2369ef01c37c2cce377aeae1d82d8 | MATLAB | 8,788 | 201 | function [trl_dirs_corr, FOV] = NDK_Motion_Correction5D(fileexpnum, trialcat, zsplit,shiftmax,bgsub)
% clear all
% zsplit = 0;
% trialcat = 1;
% fileexpnum = '62617-g7_Mar2322_f3e23'; %thor expt #
%set headpath (and reset if in "extracted" output folder)
tic
if bgsub
background = [3,12,4,53];%[2,3,10,50];
else
... |
1b3451811d37e5fda2d4ad4e980ba11efdc1b53c4533c669b8d12cdb1af064c4 | MATLAB | 8,802 | 243 | function varargout = subsref(opt,subs)
% Subscript referencing
%
% Fields are:
% dat - a file-array representing the image data
% mat0 - a 9-parameter affine transform (from qform0)
% Note that the mapping is from voxels (where the first
% is considered to be at [1,1,1], to m... |
871a09b665f41f38ec91a0d4b3772f7e484fbcca42761ab980270bc12ee37529 | MATLAB | 8,805 | 275 | function G = run_group_glm(subject_ids, snirf_paths, mesh_path, nirsmodel_path, layout_path, opts)
%RUN_GROUP_GLM Run subject-level GLM and source reconstruction across multiple SNIRF recordings.
%
% G = fnirspower.pipeline.run_group_glm( ...
% subject_ids, paths, mesh_path, nirsmodel_path, layout_path, ...)
... |
c6c841e27d842c4b5eea364d0973411c293e24a3b16b67b2c04db40ee1a69c64 | MATLAB | 8,809 | 272 | function [] = run_model_fitting_with_dot(SANDIinput)
% Main script to fit the SANDI model using Random
% Forest (RF) and/or multi-layers perceptron (MLP)
%
% Author:
% Dr. Marco Palombo
% Cardiff University Brain Research Imaging Centre (CUBRIC)
% Cardiff University, UK
% 8th December 2021
% Email: palombom@cardiff.ac... |
89b0ccf1ef00c648c9f62cf08bbb9fdf5c58818be77bb1effe63c72404d3edb7 | MATLAB | 8,823 | 237 | function num_amplifier_samples = Intan_sampleNum(varargin)
% Transformed "read_Intan_RHD2000_file" function by Intan Technologies, in
% order to get the sample number.
%
% Version 2.01, 11 October 2017
%
% Reads Intan Technologies RHD2000 data file generated by evaluation board
% GUI or Intan Recording Controller. Dat... |
b55a7fabff1f5be5c72a332f6186d500722c36dd2694e2204ce307d07e9d926c | MATLAB | 8,823 | 297 | clc
clear all
close all
set(0,'defaultfigurecolor',[1 1 1]);% set figure background color
if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')
addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab'));
end
%% ======================= cbf map... |
380ee23a66d78cf2e738b41e2691f60514d3e718aaaa6746344a36edd774b097 | MATLAB | 8,831 | 220 | classdef ( Hidden, Sealed ) ChildObserver < handle
%uix.ChildObserver Child observer
%
% co = uix.ChildObserver(o) creates a child observer for the graphics
% object o. A child observer raises events when objects are added to
% and removed from the property Children of o.
%
% See also:... |
25ae8690d4b95c100e3ac5b7c9ade4b2a09f1868268052923c6082b29f9dccb0 | MATLAB | 8,836 | 265 | function [cutoffIndex, cutoffValue, sp, axesH,maxBinValue] = cutFirstHistMode(varargin)
%CUTFIRSTHISTMODE finds the end of the first mode of a histogram using unimodal thresholding (Rosin).
%
% cutFirstHistMode is an implementation of the algorithm presented in "uni-
% modal thresholding" by P.L. Rosin, Pattern Rec... |
579ea953ce2c5ca2e171c920382c41778e86ec53506ac1032f149dcb2a377299 | MATLAB | 8,836 | 311 | function ML=cv_build_graph_fig(resultfig,directory,selectedparc,handles,options)
% read in atlas structures:
aID = fopen([ea_space(options,'labeling'),selectedparc,'.txt']);
atlas_lgnd=textscan(aID,'%d %s');
D=length(atlas_lgnd{2});
parc=ea_load_nii([ea_space(options,'labeling'),selectedparc,'.nii']);
% build cent... |
39b380279273ca1543f88bc4c58e58be129558253197b23840cd723942864400 | MATLAB | 8,841 | 253 | load('bmrk3_temp_model.mat')
bmrkdata
% About this dataset
% -------------------------------------------------------------------------
%
% This dataset includes 33 participants, with brain responses to six levels
% of heat (non-painful and painful).
%
% Aspects of this data appear in these papers:
% Wager, T.D., At... |
2f16be09bf2a6a5c091a4a29e85abdc29db659de1bea36e745189b2d720a1ba5 | MATLAB | 8,842 | 228 | function [comodulogram] = bz_CFCPhaseAmp(lfp,phaserange,amprange,varargin)
% [comodulogram] = bz_CFCPhaseAmp(lfp,phaserange,amprange,flagPlot)
%
%
%This function calculates the modulation index of phase-amplitude between
%phase range (lower frequencies) to amplitude range (higher frequencies).
%It can really take a lon... |
910e554bc9375920901ebe9587ca68b7a70621c21f34c3f9e8797600e3cd272b | MATLAB | 8,844 | 212 | function figHandles = upSetPlot_wrapper(qMetric, param, unitType, save_path)
% More info on UpSet plots in the original publication:
% Alexander Lex, Nils Gehlenborg, Hendrik Strobelt, Romain Vuillemot,
% Hanspeter Pfister. UpSet: Visualization of Intersecting Sets
% IEEE Transactions on Visualization and Computer Grap... |
b10a88a85134fb02cb71f99345e8d2d9c396ee4be38d98d3afd71ad99c0be783 | MATLAB | 8,844 | 258 | function [Pset,idx] = palm_permtree(Ptree,nP,cmc,idxout,maxP)
% Return a set of permutations from a permutation tree.
%
% Usage:
% Pset = palm_permtree(Ptree,nP,cmc,idxout,maxP)
%
% Inputs:
% - Ptree : Tree with the dependence structure between
% observations, as generated by 'palm_tree'.
% - nP : Num... |
cfe87f2ee345eb1d97d0b4fb70fa78b1e90dff0af36f62b98e20d409f8ca019c | MATLAB | 8,847 | 222 | function myPLS_plot_results(res,save_opts)
% This function creates and saves the output plots of the PLS analysis
%
% Inputs:
% - res: Struct containing results from PLS - required fields for plots:
% - .X0, .Y0 : unnormalized input matrices
% - .X, .Y : normalized input matrices
% - .d... |
0f3048773d10f2ffaa01d9151dec2b31ae273ec277d9b93d7d5bce4fcb0b2ac4 | MATLAB | 8,864 | 256 | function reliability = fun_scorer_reliability(sleepstages, varargin)
% Calculate inter-rater reliability between two scorers. Automaticially
% generate Cohen's kappa and percent agreement for two score files.
%
% Required inputs:
%
% sleepstages: a 1xn struct containing a sleepstages file for each score
% file to compa... |
7323685368e7bae8aa88c46fa153d087842d42e4aa019c413d328554a79312dd | MATLAB | 8,866 | 268 | function PlotPhasePrecession(data,stats,varargin)
%PlotPhasePrecession - Plot phase precession plots and maps.
%
% USAGE
%
% PlotPhasePrecession(data,stats,<options>)
%
% data phase precession data obtained using <a href="matlab:help PhasePrecession">PhasePrecession</a>
% stats optional ph... |
9941eab4e23410f8cf8f92ca1a95b91af5e9a090a22dd09fc42a31716c648ea4 | MATLAB | 8,866 | 256 | function [rate_map, xdim, ydim, occupancy, no_occupancy] = SpatialMap(self,variableName,root,varargin)
% [rate_map, xs, ys] = root.plot_rate_map(cel, varargin)
%
% Plots spatial rate map for cell cel = [ tetrode, cell ]
%
% Returns matrix rate_map with x and y dimensions in vectors xs and ys.
%
% ARGUMENTS
% cel ... |
36b0ff26c85b8881f4e191ad90098f0b46c027aeadf2fc6d5e53626bbf65f8ea | MATLAB | 8,868 | 204 | function [positionTracking] = pos2behav(pos,varargin)
% [positionTracking] = pos2behav(pos,trackingType,varargin)
%pos2behav - convert old .pos files/variables to buzcode 'behavior' struct.
%
% USAGE
% [behav] = pos2beahv(varargin)
%
% INPUTS
% pos Nx5 position data (columns 2 and 4 are X, 3 and 5 are... |
8be11c6c59f32aca8fe2777bb333d32f17a6ce4a41520297d80306dd337ab8b7 | MATLAB | 8,879 | 282 | function [boot_order, new_num_boot] ...
= rri_boot_order(num_subj_lst, num_cond, num_boot, bscan, incl_seq, boot_type, from_nonstrat)
% - from PLS toolbox
%
% USAGE: [boot_order, new_num_boot] = rri_boot_order(num_subj_lst, num_cond, num_boot [, bscan, incl_seq])
%
% Generate bootstrap sample order for a... |
895e6abc2f59df70a76e50abc36c25b1858593f26a189d3c75f8bf2554af9e02 | MATLAB | 8,889 | 232 | function hdr = read_yokogawa_header_new(filename)
% READ_YOKOGAWA_HEADER_NEW reads the header information from continuous,
% epoched or averaged MEG data that has been generated by the Yokogawa
% MEG system and software and allows that data to be used in combination
% with FieldTrip.
%
% Use as
% [hdr] = read_yokoga... |
21bc1e8c56a01e2f1c7cd4395a04b7d321a4f50d1d3ee95f2cb75e51e17a43e7 | MATLAB | 8,900 | 202 | % written by Yiyuan Han, Essex BCI-NE Lab, 05/02/2020
% getFeatureLabel: Get the channel labels of the selected features and
% determining the relationship between selected channel pairs and
% conditions
% Input:
% -folderpath: The folder path which stores the data of all classifiers in
% obtained with specific t... |
c982b787e560cfd68b7f1dc3c52d9081a2d9aa7b007c01216a134e84711ea9ca | MATLAB | 8,906 | 273 | function [flags,keyvals,varargout] = SOFAarghelper(posdepnames,definput,arglist,callfun)
%SOFAARGHELPER Parse arguments for SOFA
% Usage: [flags,varargout] = SOFAarghelper(posdepnames,definput,arglist,callfun);
%
% Input parameters:
% posdepnames : Names of the position dependant parameters.
% de... |
b2cc3a0b084d938f2db80c5de9b75b2df6157d41932d679c2f896df288daecdc | MATLAB | 8,910 | 189 | function CBIG_ArealMSHBM_generate_gradient(mesh,out_dir,sub,num_sess)
% CBIG_ArealMSHBM_generate_gradient(mesh,out_dir,sub,num_sess)
% This function will generate diffusion embedding matrices of
% gradients for a specific subject with <num_sess> session.
%
% Input:
% - mesh:
%
% The surface space of fMRI data,... |
a8ffe3a746b09b13bdc50af4ba494b5ee20ed75ec17a62d5300d056fae3822fb | MATLAB | 8,913 | 184 | % Help for file Nlx2MatCSC
% Version 4.1.1
%
% Purpsose
% The purpose of this program is to extract Neuralynx data from a file and load it into the matlab environment with any combination of fields
% from the file within a time or record range or using a time or record list.
%
% Composition
% This program is a matlab... |
a7195f0fbf461e7d3abb9f2229f1f1e72eb31ea4d926949a2ff973239e3f9076 | MATLAB | 8,915 | 283 | function result = G_PowChange_Clust( mat, g, t, freq, varargin)
% cluster-based correction for event-realted power CHANGE difference between different
% groups of trials (unpaired)
%
% Syntax
% result = G_PermutClust2d_PowChange( mat, g, t, freq, varargin)
%
% Input
% mat, trial x frequency x time x event, make s... |
e075521199ac6fd0d46bc393d046facb98c50d53edd9e2a6afde17066f8fc3ca | MATLAB | 8,925 | 277 | function [h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof,alpha)
% [h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof,alpha)
%LRATIOTEST Likelihood ratio test of model specification
%
% Syntax:
%
% [h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof)
% [h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof,alpha)
%
% Description... |
80dc93d9f8e9c33bf817c7eab70a620a84c0f17f1c3b7923bedaddf3d217820a | MATLAB | 8,926 | 154 | function [ pl2 ] = PL2ReadFileIndex( filename )
% PL2ReadFileIndex( filename ): reads pl2 file index.
% Displays error if the file does not exist.
% This function is not called directly by PL2* functions.
% Use PL2GetFileIndex(filename) instead.
% PL2GetFileIndex caches file indexes so it wo... |
64d7146e4dc8e31d5ceec44a0bd52a7228cba17b7e13a5089d6a67dd3ce96ce7 | MATLAB | 8,929 | 242 | function varargout=sigstar(groups,stats,nosort)
% sigstar - Add significance stars to bar charts, boxplots, line charts, etc,
%
% H = sigstar(groups,stats,nsort)
%
% Purpose
% Add stars and lines highlighting significant differences between pairs of groups.
% The user specifies the groups a... |
58db46cedb711711986a0a584e9ccecf786445d2cddc4b82da56ce4dd4971696 | MATLAB | 8,934 | 186 | % Help for file Nlx2MatVT
% Version 4.1.1
%
% Purpsose
% The purpose of this program is to extract Neuralynx data from a file and load it into the matlab environment with any combination of fields
% from the file within a time or record range or using a time or record list.
%
% Composition
% This program is a matlab ... |
f2683a652d60ca6cdfc28ccb9a3bb3caf4d74ae3cd9d678ddca925d9eb845aa9 | MATLAB | 8,940 | 234 | function [q,N] = quantile(X,p,dim,method,weights)
%QUANTILE Quantiles of a sample via various methods.
%
% Q = IOSR.STATISTICS.QUANTILE(X,P) returns quantiles of the values in X.
% P is a scalar or a vector of cumulative probability values. When X is
% a vector, Q is the same size as P, and Q(i) contains the P(... |
b2a4aa7ce23bbdd4a7b4bd82e20e821aa5e1e67c8672d7f492832efeedd21b97 | MATLAB | 8,941 | 264 | function [ISILFPMap] = bz_ISILFPMap(basePath,varargin)
% Under Development: DLevenstein 2020
%% Parse the inputs
defaultstates.ALL = [-Inf Inf];
p = inputParser;
addParameter(p,'ints',defaultstates)
addParameter(p,'savechaninfo',false,@islogical)
addParameter(p,'cellclass','AllCells');
addParameter(p,'regions','sessio... |
0bc5c7c071628b6bd2ae382da60ab1084b41d4ca1f75235166072a543f72fab6 | MATLAB | 8,952 | 307 | %ARDEM Demonstrates modules of the ARfit package.
% Revised: 30-Dec-99 Tapio Schneider
format short
format compact
echo on
clc
% ARfit is a collection of Matlab modules for the modeling of
% multivariate time series with autoregressive (AR) models. ARfit
% contains modules for estimating parameters of AR mode... |
d0653ef9c2e3550cefe93de90bb678b5b86df7f70e190ed98ae4a88126bde8cc | MATLAB | 8,956 | 255 | function varargout=ea_assignbackdrop(bdstring,options,subpat,native)
if ~exist('subpat','var')
subpat='Patient';
end
if ~exist('native','var')
if isfield(options,'native')
native = options.native;
else
native = 0; % default
end
end
BDlist=getbdlist;
if strcmp(bdstring, 'list')
... |
d4a3e592b2de33e58d2e59cd3204f0d0214daaf651b804c6afdd591dbb08c474 | MATLAB | 8,962 | 278 | function [ixes,R,p]=ea_leoo_significance(XYZV)
% clear NAN vars:
XYZV(isnan(XYZV(:,4)),:)=[];
% setup randomization:
maxiter=1001;
csize=nan(maxiter,size(XYZV,1));
dimen=length(XYZV);
for iter=1:maxiter
dat=XYZV;
if iter>1
dat(:,4)=dat(randperm(length(dat)),4);
end
% generate predicted co... |
1c7d4921608f6a7471e8a2a5a80933c5139d5dbe8fd890aab08ab560e570ec36 | MATLAB | 8,963 | 243 | function z_batch_publish_analyses(varargin)
% Runs batch analyses and publishes HTML report with figures and stats to
% results/published_output in local study-specific analysis directory.
%
% Run this from the main base directory (basedir)
%
% Enter string for which analyses to run, in any order
%
% 'contrasts... |
907377d6c823ca704b7e492da22969395828e5a2e2a4024d3569f8fb6c450966 | MATLAB | 8,964 | 223 | % pop_timef() - Returns estimates and plots of event-related (log) spectral
% perturbation (ERSP) and inter-trial coherence (ITC) changes
% timelocked to a set of input events in one data channel.
%
% Usage:
% >> pop_timef(EEG, typeplot); % pop_up window
% >> pop_timef(EEG, typeplot, lastcom);... |
60195cfbec39efbb438bf738df205f009928fbd83b070da4361929c8d9311256 | MATLAB | 8,967 | 142 | %% Step 2 Tiny Dancers: Epoching and artefact rejection
clear all
clc
addpath C:\Users\tnguyen\OneDrive - Fondazione Istituto Italiano Tecnologia\Documenti\MATLAB\toolboxes\fieldtrip-20220929
ft_defaults;
addpath(genpath('C:/Users/tnguyen/OneDrive - Fondazione Istituto Italiano Tecnologia/Documenti/MATLAB/toolboxe... |
de482ef2329ddc9eafae4bb442c42ce472d3289ac4923badc7f4967b486c767d | MATLAB | 8,968 | 215 | function img_list = prairieView_ImageMonitor(xyz_loc, out_path, varargin)
% SYNTAX: img_list = prairieView_ImageMonitor(xyz_loc, out_path, varargin)
%
% METHOD: Given a list of locations (xyz_loc), acquires a zstack of at each
% with the configuration specified (config_name) that is saved as a file on
% the hard d... |
3d75c9179d95f1bac5f70ab566fc838937d76cd2b94e31d9c6ba42466259169c | MATLAB | 8,970 | 240 | function [no,el,regions,holes]=vol2surf(img,ix,iy,iz,opt,dofix,method,isovalues)
%
% [no,el,regions,holes]=vol2surf(img,ix,iy,iz,opt,dofix,method,isovalues)
%
% converting a 3D volumetric image to surfaces
%
% author: Qianqian Fang (fangq <at> nmr.mgh.harvard.edu)
%
% input:
% img: a volumetric binary image; if img is... |
c9471d68faad3b4631dbbc74eb6b9c4d3ef99d7e6488f93dc9b0b1582aba5942 | MATLAB | 8,977 | 228 | function varargout = ea_normsettings_fsl(varargin)
% EA_NORMSETTINGS_FSL MATLAB code for ea_normsettings_fsl.fig
% EA_NORMSETTINGS_FSL, by itself, creates a new EA_NORMSETTINGS_FSL or raises the existing
% singleton*.
%
% H = EA_NORMSETTINGS_FSL returns the handle to a new EA_NORMSETTINGS_FSL or the hand... |
ed4b24bab50b45729777a2da8f982349ee6e3159965cf042b43ba42b5d6efa1a | MATLAB | 8,991 | 306 | function [T, perm] = dendrogram_struct(Z,varargin)
%DENDROGRAM Generate dendrogram plot.
% DENDROGRAM(Z) generates a dendrogram plot of the hierarchical binary
% cluster tree represented by Z. Z is an (M-1)-by-3 matrix, generated by
% the LINKAGE function, where M is the number of objects in the original
% dat... |
7ead4c44aa2974b9df0d9899f444866c87c9c0d2b67949f0ad87f21d3494f3ae | MATLAB | 8,995 | 156 | % pop_erspparams() - Set plotting and statistics parameters for
% computing and plotting STUDY mean (and optionally
% single-trial) ERSP and ITC measures and measure
% statistics. Settings are stored within the STUDY
% structure (STUDY.etc.... |
391b5d1cc91225dc54cc380d5fa75fc6c0544b7363a68f8af701204a4e07340a | MATLAB | 9,009 | 255 | function [Y, Z] = FilterM(b, a, X, Z, Dim, Reverse)
% FilterM - Fast C-Mex filter
% [Y, Z] = FilterM(b, a, X, Z, Dim, Reverse)
% INPUT:
% b, a: Filter parameters as DOUBLE vectors. If the vectors have different
% lengths, the shorter one is padded with zeros.
% X: Signal as DOUBLE or SINGLE vector or array.
% ... |
1b4b4f90f2964cccfae3b561d4b2177b2dec3c0b2728727fe831efcbf8ea84b7 | MATLAB | 9,010 | 233 | function [M, mss] = nii_coreg(niiT, niiM, varargin)
% Affine registration of images with the same modality.
%
% Examples:
% M = nii_coreg(niiT, niiM)
% M = nii_coreg('mni_T1', niiM)
% M = nii_coreg(sub1_ses1, sub1_ses2, 'FWHM', [6 6], 'DoF', 6, 'disp', 2)
%
% Input (first two are required):
% niiT: template ... |
95b48d76c53f97a6b483def8765171a3d8ebd52d5c16f3b075abbc0b0c03336e | MATLAB | 9,010 | 279 | % RGB Rgb triple for given CSS color name
%
% RGB = RGB('COLORNAME') returns the red-green-blue triple corresponding
% to the color named COLORNAME by the CSS3 proposed standard [1], which
% contains 139 different colors (an rgb triple is a 1x3 vector of
% numbers between 0 and 1). COLORNAME is case inse... |
1be76696947915575d21ab61853ed1a347451505c17c10df3e58aaf1feff54b1 | MATLAB | 9,013 | 217 | function [TRFoutput,PTfreq,PTdBampl] = TRFmap(FsourceString,tifFileList,sigSDthresh,...
outlierSDthresh,nFramesPostPulse,plotMeanMap,plotEachCell,varargin)
% TRFmap: output TRF map for an animal.
% [TRFoutput,PTfreq,PTdBampl] = TRFmap(
% FsourceString, --> fluorescence variable eg 'FISSAscaledResult... |
4a92a7e7384077a62e7e9af82f53838c5d04a6caaa7ffbecd20136f3a3dd6465 | MATLAB | 9,015 | 319 | % PARSEVALUE parse the corresponding MATLAB object out of a TOML value
%
% PARSEVALUE('') returns an empty string.
% PARSEVALUE('0b10') returns 2.
% PARSEVALUE('0o10') returns 8.
% PARSEVALUE('0x10') returns 16.
% PARSEVALUE('10') returns 10.
% PARSEVALUE('"foo"') returns 'foo'.
% PARSEVALUE('true') retur... |
9b8312587e1645a0bdf9d7356c36f489ed87df93280d719a5a032129439e2445 | MATLAB | 9,020 | 218 | function [spikes] = bz_LoadPhy(varargin)
% Load kilosort/phy clusters
%
% USAGE
%
% [spikes] = bz_loadPhy(varargin)
%
% INPUTS
%
% basepath -path to recording (where .dat are)
% kilosort_path -path to kilosort* folder after phy curing (by default
% .\kilosort_\)
% getWaveforms ... |
3dde2e0b43bd8a87257bbe727a395f4641fea9affe67ecd83d65a62ecb520541 | MATLAB | 9,028 | 120 | function opts = palm_defaults
% Set up PALM defaults.
%
% _____________________________________
% Anderson M. Winkler
% FMRIB / University of Oxford
% Oct/2014
% http://brainder.org
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% PALM -- Permutation Analysis of Linear Models
% Copyright (C... |
e06fa2e5dda67063a2c6d7869b77de5585773d8b6f8279f0ea67fc4c29361ac7 | MATLAB | 9,030 | 263 | function varargout = filetype_check_uri(filename, ftyp)
% FILETYPE_CHECK_URI
%
% Use as
% status = filetype_check_uri(filename, type)
%
% Supported URIs are
% buffer://<host>:<port>
% fifo://<filename>
% global://<varname>
% mysql://<user>:<password>@<host>:<port>
% rfb://<password>@<host>:<port>
% seri... |
29d80ee069ef03b0e5f4f9d393df0ffa2302ff94034c7599ed748ae2dbf8a292 | MATLAB | 9,034 | 214 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% demo_connectome_eigenmode_calculation.m
%%%
%%% MATLAB script to demonstrate how to calculate various high-resolution
%%% connectome-based eigenmodes. In particular, the script demonstrates
%%% how to
%%% (1) calculate connectome eigenmod... |
ccaff807bae2916e19751ff4923a181cc657123135e95009747560f452ab95b4 | MATLAB | 9,042 | 187 | % Help for file Nlx2MatSpike
% Version 4.1.1
%
% Purpsose
% The purpose of this program is to extract Neuralynx data from a file and load it into the matlab environment with any combination of fields
% from the file within a time or record range or using a time or record list.
%
% Composition
% This program is a matl... |
0422c80cfd683b898763ecbfcd91818f061d66a497523890eab2117df4c70508 | MATLAB | 9,049 | 256 | function factor = ft_scalingfactor(old, new)
% FT_SCALINGFACTOR determines the scaling factor from old to new units, i.e. it
% returns a number with which the data in the old units needs to be multiplied
% to get it expressed in the new units.
%
% Use as
% factor = ft_scalingfactor(old, new)
% where old and new are... |
295fb74b40dc19fc5ce2722585cc573ca570404c6e76f0239c03392d4e87878a | MATLAB | 9,054 | 239 | function index=alltrialstimecourse(headpath,fileexpnum,version,saveex,picknew,savefigs)
%use this one when the data has been analyzed before and saved.
%return the index of the example to be saved with the filename for the
%paper
% need a way to save two examples for vt062617 -running it twice should
% actually save 2 ... |
b695198b7139896d8f723b7cf653d81b504a10832dbe2a296d2ae0b54e454084 | MATLAB | 9,056 | 245 | function R = lye_benchmark(opts)
%LYE_BENCHMARK Evaluate LyE_R and LyE_W over Sprott (2003) Appendix A.
%
% R = nonantest.lye_benchmark()
% R = nonantest.lye_benchmark(N=4000, Verbose=true)
%
% Runs both estimators over every usable system in the catalogue and
% returns a table with, per system and per estimato... |
24d580ab7638903ae2372830a8d5bfc690cb8cbbfcbe6c13810e586d2c63813a | MATLAB | 9,065 | 229 | function varargout = ea_vatsettings_fastfield(varargin)
% EA_VATSETTINGS_FASTFIELD MATLAB code for ea_vatsettings_fastfield.fig
% EA_VATSETTINGS_FASTFIELD, by itself, creates a new EA_VATSETTINGS_FASTFIELD or raises the existing
% singleton*.
%
% H = EA_VATSETTINGS_FASTFIELD returns the handle to a new E... |
be244b05b3c9431e9e23587134ba90abcad2158fa3ec14c73f21f50236e8f032 | MATLAB | 9,066 | 263 | function handlesOut = dan_import_data(handlesIn)
% Take input strings and load data into file
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
dataString = get(handlesIn.data_file_string, 'String');
stageString = get(handlesIn.stage_file_string, 'String');
eventsString = get(handlesIn.events_file_string, 'Strin... |
7b9c3d385891eb2badd14ef4ed499bebc4e0736ad1bcb07c5c32b25ba4c6df89 | MATLAB | 9,082 | 255 | function [newnode,newelem,newface]=meshrefine(node,elem,varargin)
%
% [newnode,newelem,newface]=meshrefine(node,elem,face,opt)
%
% refine a tetrahedral mesh by adding new nodes or constraints
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input parameters:
% node: existing tetrahedral mesh node list
% ele... |
68039d81eb583deb9af4ff22c4a2c41e505743c908f83386c0f149b71505c2c0 | MATLAB | 9,088 | 222 | %% NiftiyModSPM - Base class for all Nifti Objects. Wrapping the SPM Toolbox.
%
% Andreas Husch, Florian Bernard
% Centre Hospitalier de Luxembourg, Dep. of Neurosurgery /
% University of Luxembourg - Luxembourg Centre for Systems Biomedicne
% 2016 - 2017
% mail@andreashusch.de, fbernardpi@gmail.com
%
% Andreas Horn
% ... |
ddd792cf4d5f3ef306ea7aac6e14c6ac90668ac22227cc72a473ad84eb10d13f | MATLAB | 9,088 | 210 | %% Installing CANlab Core Tools
%% About the CANlab Core Tools repository and CANlab toolboxes
%
% The CANlab Core Tools repository is on https://github.com/canlab/CanlabCore
% It contains core tools for MRI/fMRI/PET analysis from the Cognitive and
% Affective Neuorscience Lab (Tor Wager, PI) and our collaborators. M... |
03f76cedd1a61ed81cfe1cc613bbcd00139065eef0d6e97353d7572383e42451 | MATLAB | 9,090 | 235 | classdef (CaseInsensitiveProperties) dndcontrol < handle
%DNDCONTROL Class for Drag & Drop functionality.
% obj = DNDCONTROL(javaobj) creates a dndcontrol object for the specified
% Java object, such as 'javax.swing.JTextArea' or 'javax.swing.JList'. Two
% callback functions are available: obj.DropFileFcn and... |
aa44f1f5d513108d9d1c3a9000469c09b0139a10d6304894e288738e28383b00 | MATLAB | 9,096 | 292 | % Examples from the CVX Users' guide
has_quadprog = exist( 'quadprog' );
has_quadprog = has_quadprog == 2 | has_quadprog == 3;
has_linprog = exist( 'linprog' );
has_linprog = has_linprog == 2 | has_linprog == 3;
rnstate = randn( 'state' ); randn( 'state', 1 );
s_quiet = cvx_quiet(true);
s_pause = cvx_pause(false);
c... |
830c03e671e29f25a9ec3170318d67c1e7e68a79981bd53ddd7e0f46ea44915d | MATLAB | 9,097 | 223 | % F03_C.m
% Manuscript Fig 3c: functional correspondence by ROI.
% Input tables are read from manuscript_figure_source_data/data/main_text_source_data.xlsx.
clear all
ROI={"Dorsal", "Lateral","Ventral"}
%% read dataTables
Fig3c=read_main_text_source_table("fig3c_points");
Fig3c_noiseCeiling=read_main_text_source_table... |
a190285303bd2a0da4b9cf274629b05a9c208eabb6be37b5a60ef2ff0c1a6673 | MATLAB | 9,099 | 279 | function [h,pValue,stat,cValue] = CBIG_lratiotest(uLL,rLL,dof,alpha)
% [h,pValue,stat,cValue] = CBIG_lratiotest(uLL,rLL,dof,alpha)
%LRATIOTEST Likelihood ratio test of model specification
%
% Syntax:
%
% [h,pValue,stat,cValue] = CBIG_lratiotest(uLL,rLL,dof)
% [h,pValue,stat,cValue] = CBIG_lratiotest(uLL,rLL,dof,al... |
e5b51cdc1e66867934a3bef84db40aa8d9203d0189dcf0ba68bbcda72371edde | MATLAB | 9,104 | 282 | ccc;
AREAs = {'AC', 'PFC'};
temp = dir("..\MAT Data\cwt result\PE\single\**\*Active\**\cwtres_*.mat");
SINGLEPATHs = unique({temp.folder})';
RAWDATAPATHs = cellfun(@(x) strrep(x, '\cwt result\PE\', '\pre (granger)\'), ...
SINGLEPATHs, "UniformOutput", false);
%% Params
ncmb = 64;
stdRatio = ... |
f349699a8a87007be003d5070feca8c36750d26f329723dcf6f0a89425064832 | MATLAB | 9,109 | 256 | function data = LoadBinary_Down_ss(filename,varargin)
% LoadBinary - Load data from a multiplexed binary file.
%
% Reading a subset of the data can be done in two different manners: either
% by specifying start time and duration (more intuitive), or by indicating
% the position and size of the subset in terms of nu... |
53c4f3c3baefda394e059b03d0836196b14135cc4ee4e7c99ce1f1fe4dd2b84f | MATLAB | 9,114 | 220 | clear;
load("data_folder/Egestive_priming_data.mat");
load("data_folder/btype.mat")
% Skip experiments 5, 6, 9
% Remove channel 141 for experiment 4
ch{4, 1}(141) = [];
ch{4, 2}(141) = [];
% Data processing code
animal = 1;
sigma = 0.05;
downsample_factor = 150; % 10 ms
spike_threshold = 0; % no threshold
protractio... |
1135065541d7f893cfae255dc4b55013e169cfd7655e09068d2f33a49fe7d572 | MATLAB | 9,115 | 249 | function movieData = condColocPt2Pt2PtWrapper(movieData, paramsIn)
%CONDCOLOCPT2PT2PtWRAPPER run conditional colocalization method described in condColocPt2Pt2Pt
%
% movieData = condColocPt2Pt2PtWrapper(movieData, paramsIn)
%
% Applies conditional colocalization described in condColocPt2Pt2Pt to 3 channel
% images. It ... |
2420b28111fc52e03a0017cb75db18f98434a2b1b7bd07dcae8cd3bbca526dab | MATLAB | 9,119 | 234 | function [lambda, extra] = lyapunov(x, fs, opts)
%LYAPUNOV Largest Lyapunov exponent of a time series or phase space.
% LAMBDA = LYAPUNOV(X,FS) estimates the largest Lyapunov exponent of X
% sampled at FS, in NATS per unit time.
%
% X may be either a column vector, in which case a phase space is
% reconstructed... |
503d59fb1cf8aecc12006a9a86619e94e70f3b7dde27fbfcb4f56e2c7186390c | MATLAB | 9,121 | 269 | function [distance, similarity, corr_coeffient] = pdfsDistanceSimilarity(P, Q, method, p)
%%***********************************************************************%
%* PDF Distances and similarities *%
%* Probability density functions distances and similarities for various *%
%* fa... |
716b8af640b8b954c12d64bf2d4b4579e21000dd2e347fc3420a8dc86851223f | MATLAB | 9,132 | 287 | % compmap() - Plot multiple topoplot() maps of ICA component topographies
% Click on an individual map to view separately.
% Usage:
% >> compmap (winv,'eloc_file',compnos,'title',rowscols,labels,printflag)
%
% Inputs:
% winv - Inverse weight matrix = EEG scalp maps. Each column is a
% ... |
572dfa41704a5cd4dfff77b6446dfc1b146848ec296f23288b95fb71150973cd | MATLAB | 9,133 | 251 | % finputcheck() - check Matlab function {'key','value'} input argument pairs
%
% Usage: >> result = finputcheck( varargin, fieldlist );
% >> [result varargin] = finputcheck( varargin, fieldlist, ...
% callingfunc, mode, verbose );
% Input:
% varargin - Cell array ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.