sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
de042fc8cb9262f8c5ee9f1645b5b6b7aeeb8e63afea2d5ae3f68252c402a1ec | MATLAB | 3,794 | 90 | function [intervals,indices] = SubtractIntervals(intervals1,intervals2,varargin)
%SubtractIntervals - Subtract intervals.
%
% Given two lists of intervals, subtract from each interval in the first
% list its intersection with each of the intervals in the second list.
%
% USAGE
%
% [intervals,indices] = SubtractInt... |
74e638b3f1c2fb21e724eccc22fead49307f9a28032a3f7c8e4bd9d250605dc3 | MATLAB | 3,797 | 134 | function [Cylinder, EndPlate1, EndPlate2] = ea_cylinder(X1,X2,r,n,cyl_color,closed,lines)
%
% This function constructs a cylinder connecting two center points
%
% Usage :
% [Cylinder EndPlate1 EndPlate2] = Cylinder(X1+20,X2,r,n,'r',closed,lines)
%
% Cylinder-------Handle of the cylinder
% EndPlate1------Handle o... |
484af4c0311430b8b78611ef3286ca24d28768f04ab771af59947c7c306ea1d1 | MATLAB | 3,798 | 116 | function muA_file = reconstruct_mu_a(beta_od_file, nirsmodel_file, mesh_mat, save_dir, tik_alpha)
%FNIRSPOWER.RECON.RECONSTRUCT_MU_A
% Reconstruct subject-level absorption-change maps at 760 and 850 nm.
%
% This function reconstructs voxelwise absorption changes from channel-level
% optical-density beta estimates ... |
57e24f45408446a8f05730de846f06e8e556d1cc29fd00bc3dd480dd681730e0 | MATLAB | 3,798 | 103 | function samples = Restrict(samples,intervals,varargin)
%Restrict - Keep only samples that fall in a given list of time intervals.
%
% Keep only samples (positions, spikes, LFP, etc.) that fall in a given list of
% time intervals.
%
% The remaining epochs can optionally be 'shifted' next to each other in time,
% remov... |
47c44149e57df2e9e0b9e7d9a4d3933c7ada18d07a0e9d9ff7ac9965600eba58 | MATLAB | 3,799 | 129 | % eeg_decodechan() - given an input EEG dataset structure, output a new EEG data structure
% retaining and/or excluding specified time/latency, data point, channel,
% and/or epoch range(s).
% Usage:
% >> [chaninds chanlist] = eeg_decodechan(chanlocs, chanlist);
%
% Inputs:
% chanlocs... |
b1777ce9182b6c12a6809cfbb35f682da2db8122c656ef46fe4b710a36bcf459 | MATLAB | 3,799 | 137 | function y=readPrairieLS(pname,rname,labelid,chid)
% Usage ... y=readPrairieLS(pname,rname,labelid,chid)
if nargin<4, chid=[]; end;
if nargin<3, labelid=[]; end;
if nargin<2, rname=[]; end;
if isempty(rname), rname=pname; end;
if isempty(labelid), labelid='CurrentSettings'; end;
if isempty(chid), chid=1; end;
% de... |
1f4003922a88d3eececd5846b8b5b2a230b72cfc95af940c417ea2e48c38c7df | MATLAB | 3,800 | 106 | function map = colormap(arg1,arg2)
%COLORMAP Color look-up table.
% COLORMAP(MAP) sets the current figure's colormap to MAP.
% COLORMAP('default') sets the current figure's colormap to
% the root's default, whose setting is PARULA.
% MAP = COLORMAP returns the three-column matrix of RGB triplets defining
... |
6d6d6af2b8dcc4a4fa2a0ce2674d0aec6c9d91a5ceb0231d147362239f16d667 | MATLAB | 3,800 | 127 | function [RP, RESULTS]=crqa(data,tau,dim,param,threshold,options)
arguments
data double {mustBeTwoColumns}
tau (1,1) {mustBeInteger, mustBePositive} = 1
dim (1,1) {mustBeInteger, mustBePositive} = 1
param (1,1) string {mustBeMember(param,["rad", "rec"])} = "rec"
threshold (1,1) double {mustBePositiv... |
2aa2542da29c24b72722807d545ddceebf13e6a9b36b55fbcbba8d1c55f58788 | MATLAB | 3,802 | 90 | function report_addpage(filename, fighandle, hangfraction, overlaytext)
%REPORT_ADDPAGE Builds up a PS report by appending Matlab figures.
% REPORT_ADDPAGE(FILENAME, FIGUREHANDLE) prints FIGUREHANDLE and appends
% it to the Postscript file FILENAME (or creates FILENAME if it does not
% already exist) -- note t... |
dc5cc21399955667b82b467fee5281cff7aa26db5da2187ce5fa6b9d794512e7 | MATLAB | 3,802 | 80 | function [tapers,pad,Fs,fpass,err,trialave,params]=getparams(params)
% Helper function to convert structure params to variables used by the
% various routines - also performs checks to ensure that parameters are
% defined; returns default values if they are not defined.
%
% Usage: [tapers,pad,Fs,fpass,err,trialave... |
841b700bf7d192b5b824c7d67b1a1964bc3451ebba24ee0d4a150eb53f26b4fc | MATLAB | 3,803 | 168 | function [val] = read_asa(filename, elem, format, number, token)
% READ_ASA reads a specified element from an ASA file
%
% val = read_asa(filename, element, type, number)
%
% where the element is a string such as
% NumberSlices
% NumberPositions
% Rows
% Columns
% etc.
%
% and format specifies the datatype a... |
79260645c1d374fece67f5c6c274fe3aa9f3bac4f410f6e7a58047d9fead6a8e | MATLAB | 3,807 | 115 | function [clu mergehistory] = mergeclu_slow(clu,res,fet,tR,tC,rogueSpk2Merge,samplingRate)
% updated 2017/02/24 by David Tingley
%Parameters
% Maximal fraction of rogue spike in a merged cluster
% rogueSpk2Merge = 0.1;
showtree = 0;
mergehistory=[];
sametree=1;
step=1;
% Worst programming ever
while step
%... |
a7e30cdc9679849a409f9b09b2636d32c483a948c012e17cdd0ec054fe26b1c2 | MATLAB | 3,807 | 111 | function this = gifti(varargin)
% GIfTI Geometry file format class
% Geometry format under the Neuroimaging Informatics Technology Initiative
% (NIfTI):
% http://www.nitrc.org/projects/gifti/
% http://nifti.nimh.nih.gov/
%_____________________________________________________________... |
d8f360478ce28e984d6736a18446963e110490a9ef9fbb8f94facdfbafdcbde4 | MATLAB | 3,809 | 126 | % 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:
%... |
0eb0ce99ef61d9f9efcd539d81f24233e387fb6c4de124be4345e38374500b51 | MATLAB | 3,810 | 78 | function [S,f,R,Serr]=mtspectrumpb(data,params,fscorr)
% Multi-taper spectrum - binned point process
%
% Usage:
%
% [S,f,R,Serr]=mtspectrumpb(data,params,fscorr)
% Input:
% data (in form samples x channels/trials or a single vector) -- required
% params: structure with fields tapers, pad, Fs, fpass... |
1887b936b165140389a904ebe930258e8b81600114317aaf280ec9a70e3ec2c7 | MATLAB | 3,810 | 105 | function CVpred = cvglmnetPredict(object, newx, s, varargin)
%--------------------------------------------------------------------------
% cvglmnetPredict makes predictions from a "cv.glmnet" object.
%--------------------------------------------------------------------------
%
% DESCRIPTION:
% This function makes p... |
42dba6ac75f0f1fe3dd945d10d2d962d23958fff0c03b106e57d57f1d4c09db5 | MATLAB | 3,813 | 124 | % rmbase() - subtract basevector channel means from multi-epoch data matrix
%
% Usage:
% >> [dataout] = rmbase(data); % remove whole-data channel means
% >> [dataout datamean] = rmbase(data,frames,basevector);
% % remove mean of basevector from each channel and epoch
% Inputs:
% data - da... |
96fd4fa1f6de02c5130f867b1be8b46a5bae7ddee66f08ceda0603cf5ea58db0 | MATLAB | 3,813 | 92 | function [keep_species,intervene_matrix_filtered,intervene_matrix_filtered_merge,data_counts_filtered,species_names_filtered] = filterData(intervene_matrix,data_counts,species_names,experimentBlocks,params)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers ... |
b8ebf83860080e72313ea9b2ff69aa14f4ad3cf6110dab24976bc6ebfcc1f205 | MATLAB | 3,813 | 127 | function [RP, RESULTS]=rqa(data,tau,dim,param,threshold,options)
arguments
data double {mustBeSingleColumn}
tau (1,1) {mustBeInteger, mustBePositive} = 1
dim (1,1) {mustBeInteger, mustBePositive} = 1
param (1,1) string {mustBeMember(param,["rad", "rec"])} = "rec"
threshold (1,1) double {mustBePositi... |
c4959b422b61df6ba6bcd7a75616446a7f44ddafc59f502f6cdd1894a472ab1d | MATLAB | 3,816 | 122 | % eegdraw() - subroutine used by eegplotold() to plot data.
%
% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 7/96
% Copyright (C) Colin Humphries, CNL, Salk Institute 7/96 from eegplot()
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public L... |
4b51117dfe9c832c845d4b8b8a898fd2b6292af2505ec747171d2f7128d3cba8 | MATLAB | 3,817 | 92 | function [mpmMinLft, lftimeMat, speckleLftTot]= retainMPMminLifetime(mpm,minLft)
%RETAINMPMMINLIFETIME calculate lifetime and replace speckle position of speckles whose lifetime is less than a given number with zeros in magic position matrix MPM
%
%SYNOPSIS mpmMinLft = retainMPMminLifetime(mpm,minLft)
%
%INPUT mpm... |
ac153c726a50044ae3ce87d962ca0c29d9bb3ad35c54197da98fc1612e5a6074 | MATLAB | 3,817 | 96 | function CB_colorshift(handle, events)
%CB_COLORSHIFT Callback for UIcolorshift.
% Fields for UserData structure:
% fighdl - parent figure hndl mouseroot - global coords initial click
% target - data axes hndl climsinit - initial clim
% cimage - colorbar image hndl limitSEL - 1 = bottom limit, 2 = ... |
5f476579abdddaa02d25fdf8a13fc72c81c46a5028242c63904b305b6ef239ff | MATLAB | 3,822 | 81 | clear
% function p_all = CBIG_MMLDA_characteristics_ADNI1_wrapper(out_dir)
% p_all = CBIG_MMLDA_characteristics_wrapper(out_dir)
%
% Wrapper function to perform GLM (and logistic regression fro binary variables)
% to compare AD subjects' characteristics (i.e., age, edu, sex, amyloid, apoe2)
% across factors.
%
% Input:... |
22d800bcb456794bb80cf8b5764cae06e62006e64691bc57dd50866c268328cf | MATLAB | 3,823 | 141 |
function res = fitDispersion(Dpara_in,Dpara_ex,Dorth,vf,vf_csf,snr,noisedeg, proto,Smeas,dirs256,disptypes)
b = proto.b;
buni = proto.buni;
dirs = proto.dirs;
ten = proto.ten;
%% recompute signal
lag = @(x) exp(x/2).*((1-x).*besseli(0,-x/2) - x.* be... |
7ec4fd201e44c3f42d9cdf1c36e54b51473b5557700246d012da5b2cb0e83fa0 | MATLAB | 3,824 | 107 | function PlotSync(synchronized,indices,varargin)
%PlotSync - Plot successive occurrences of a multidimensional variable.
%
% Plot resynchronized samples such as spike rasters or successive evoked
% potentials.
%
% USAGE
%
% PlotSync(synchronized,indices,<options>)
%
% synchronized synchronized samples (obtain... |
93f58d83dc70fc0424c08e41a5ca88fcaf32cdf357b788c046e6d587fa4c32c7 | MATLAB | 3,826 | 91 |
% -------------------------------------------------------------------------
% Brainnetome Atlas Region Coordinates and Distance Matrix
% Author: Yuan Zhang
% Date: 2025-07-25
%
% Description:
% This script:
% 1. Loads Brainnetome (BN) atlas subregion information (IDs and MNI coordinates).
% 2. Extracts an... |
0da95bf90b69c099d44b7ebe3b92975e10d98469cdf7563617c461165e540177 | MATLAB | 3,830 | 114 | % Maximize stopband attenuation of a lowpass FIR filter (magnitude design)
% "FIR Filter Design via Spectral Factorization and Convex Optimization"
% by S.-P. Wu, S. Boyd, and L. Vandenberghe
% (figures are generated)
%
% Designs an FIR lowpass filter using spectral factorization method where we:
% - minimize maximum s... |
61467c37c28c16784ef138bcfce7c33dbf973ee139020ca4319942879e1d5e9b | MATLAB | 3,831 | 109 | function varargout = AUTOTUNE(varargin)
% AUTOTUNE MATLAB code for AUTOTUNE.fig
% AUTOTUNE, by itself, creates a new AUTOTUNE or raises the existing
% singleton*.
%
% H = AUTOTUNE returns the handle to a new AUTOTUNE or the handle to
% the existing singleton*.
%
% AUTOTUNE('CALLBACK',hObject,ev... |
8557ac879aaac2a8bf18e0556e321567e18d4c4e13efe9ced5557fba7eee6e80 | MATLAB | 3,833 | 127 | function [RP, RESULTS]=mdrqa(data,tau,dim,param,threshold,options)
arguments
data double
tau (1,1) {mustBeInteger, mustBePositive} = 1
dim (1,1) {mustBeInteger, mustBePositive} = 1
param (1,1) string {mustBeMember(param,["rad", "rec"])} = "rec"
threshold (1,1) double {mustBePositive} = 2.5
optio... |
f704d9f2b70822d347860a8da2f170011785d1d160ccab3254f9730fe91d07b2 | MATLAB | 3,837 | 81 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
c5b8327860babb9afdc7bd2714e0ecb9b560186d2794249e8fcb97b71a9e90df | MATLAB | 3,839 | 113 | function PlotColorCurves(curves,range,varargin)
%PlotColorCurves - Plot a series of curves as an aggregated color map.
%
% Plot a series of curves as an aggregated color map. In addition, one or more
% reference x locations can be represented as vertical lines: examples include
% time zero for cross-correlograms, b... |
4dfa7b2cae66bd4a5f5188e4b60e4d4c4d60ef9522d01a0201648110bf6fecab | MATLAB | 3,843 | 143 | %%**********************************************************
%% SDPT3data_SEDUMIdata: convert SQLP data in SDPT3 format to
%% SeDuMi format
%%
%% [At,b,c,K] = SDPT3data_SEDUMIdata(blk,AAt,CC,bb);
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modifie... |
621191804e9409d76447dda84ef9066fbef60446527a22be8b922f9a8e9e7f40 | MATLAB | 3,843 | 136 | %% Setting
clear all;
mycomp_dir = '/Users/clinpsywoo/Documents/2011-2016yr/2015-2016_5th_GS';
basedir = fullfile(mycomp_dir, 'fMRI_TorWager/Wani_simulation');
%% 1. DEFINE SIMULATION SPACE --------------------------------------------
dat = fmri_data(which('brainmask.nii'));
% true activaiton: right IFG
task_t_act = ... |
a6f14f3e0cde21ce1c67f01a51f1075d3041a3b3e10b4e54e486af51f9a4538d | MATLAB | 3,845 | 106 | function CBIG_MSHBM_Epilepsy_wrapper(out_dir)
% ====================================
%% Help
% ====================================
%
% CBIG_MSHBM_Epilepsy_wrapper
%
% Generates an individual-specific 15-network cortical parcellation for a
% single epilepsy patient using the NIH 34-subject drug-resistant epilepsy
% MS... |
a64d699e232fd4cc9295d181237d43d1156219fb82e83b8917d335f1c010b8fe | MATLAB | 3,847 | 121 | clear;
close all;
clc;
addpath(genpath('../functions/'));
SUBINFO_FILE = '../../subInfo/rid_sex_mDoB_yDoB_mExam_yExam_ageExam_dx_icv_bl.csv';
GMICV_FILE = '../../vbm_810bl/gmVolAndICV/rid_gmVol_icv_bl.csv';
% !!!!!!
% '_memRegEF' -- regressing out each other
% '' -- not
tail = '';
%% MMSE baseline
cd('../... |
1689e2f57a285e74a1e6dd984d1391ddf0e8490fecd6be80a2746b9a479e5e3c | MATLAB | 3,853 | 122 | function [mesh_resource] = single_mesh_resource_str(faces, points, face_vertex_data, i)
%
% See also u3d_pre_patch.
%
% File: single_mesh_resource_str.m
% Author: Ioannis Filippidis, jfilippidis@gmail.com
% Date: 2012.06.10 - 2012.06.24
% Language: MATLAB R2012a
% Purpose: export single mesh to ... |
d8987d49ad6ce9d3659ef1842b32423a241a7d9e148896f2933485690f49f632 | MATLAB | 3,854 | 80 | % This version was derived from the original version by Pestilli and Caiafa.
% Copyright (2015), Franco Pestilli (Indiana Univ.) - Cesar F. Caiafa (CONICET)
% email: pestillifranco@gmail.com and ccaiafa@gmail.com
% https://github.com/francopestilli/life available under
% https://github.com/francopestilli/life/blob/mast... |
14a2c3803907f2e29ae97fdeaea3c76fbb6acda9d97354e5a31f40ea426fc918 | MATLAB | 3,856 | 133 | function SPLSM
% function CFAT
% clinic frequency analysis main function
% Version 1: fisrt build in 02 Dec. 2021
% Updata on 11 Mar. 2022
% Updata on 18 Oct. 2022
% Updata on 30 Dec. 2022: Add permutation&bootstrap for cluster correction.
% Which need updata later: Add permutation of cluster correction for
% Chisquare... |
e07f18f13e3ad132d8797f0aaa6b3efe85ccc204b32ad8f5000af11f2ea5295b | MATLAB | 3,856 | 143 | function a = circ_plot(alpha, format, formats, varargin)
%
% r = circ_plot(alpha, ...)
% Plotting routines for circular data.
%
% Input:
% alpha sample of angles in radians
% [format specifies style of plot
% pretty, histogram, density, []
% [formats standard matlab string for plot... |
3537c9a96fc55b5be1d83ddc9966cbe568c574cdfe65544c1c5c09586099b5fb | MATLAB | 3,857 | 94 | function varargout = ea_predict_module(varargin)
% EA_PREDICT_MODULE MATLAB code for ea_predict_module.fig
% EA_PREDICT_MODULE, by itself, creates a new EA_PREDICT_MODULE or raises the existing
% singleton*.
%
% H = EA_PREDICT_MODULE returns the handle to a new EA_PREDICT_MODULE or the handle to
% t... |
3f0b9ae502e88f749003c3f2abb171e1991c6113c2fe02fac0e7f10849596e58 | MATLAB | 3,857 | 77 | % Database and batch processing functions for FMAToolbox.
%
% These functions can be used to perform batch data processing and store data
% and figures into one or more databases.
%
% Batch Processing
%
% Batch processing is useful if you need to repeatedly perform a given analysis
% on different data sets. This can be... |
5b1de74ae2a043c744baf27b468bf6869f614101c9b59d91feb84c524d4e6eff | MATLAB | 3,857 | 115 | %% About this script
%
% This script is an example script only. You should modify it to fit your
% needs, which will depend on which types of behavioral/non-imaging data
% you have and what variables you want to store and analyze.
%
% This script is an alternate example version from
% prep_1b_prep_behavioral_data.m. ... |
7772ffc87da751050cca1b28645d2c587c45af629970428037531a8fa64e3791 | MATLAB | 3,857 | 110 | function [c,lags] = xcorrLindemann(L,R,fs,maxlag,dim)
%XCORRLINDEMANN Cross-correlation based on Lindemann's precedence model
%
% C = IOSR.AUDITORY.XCORRLINDEMANN(L,R,FS) calculates the
% cross-correlation of vectors L and R, sampled at FS Hz, using a maximum
% cross-correlation lag of 0.001*fs samples (1 ms). T... |
a66bcfaab7a81ec670d252ba518ab5dc412d43fd568b34515b5c027dcd11dd71 | MATLAB | 3,857 | 95 | function vargout=subplot_tight(m, n, p, margins, varargin)
%% subplot_tight
% A subplot function substitude with margins user tunabble parameter.
%
%% Syntax
% h=subplot_tight(m, n, p);
% h=subplot_tight(m, n, p, margins);
% h=subplot_tight(m, n, p, margins, subplotArgs...);
%
%% Description
% Our goal is to grant t... |
fb4cbff90b3863ee261d35279d4734cbb2a574cf9055eb0f9ee8e2e5bdec60ed | MATLAB | 3,858 | 143 | function a = circ_plot(alpha, format, formats, varargin)
%
% r = circ_plot(alpha, ...)
% Plotting routines for circular data.
%
% Input:
% alpha sample of angles in radians
% [format specifies style of plot
% pretty, histogram, density, []
% [formats standard matlab string for plot... |
48e0163aedd2f3022732b7602a3981ec563b9a9d3f800c175c4642e83efd159c | MATLAB | 3,860 | 70 | % CVX: Additional functions added by CVX.
%
% These functions have been provided to expand the variety of constraints
% and objectives that can be specified in CVX models. But in fact, they
% can be used with numeric arguments *outside* of CVX as well. The help
% text for each of these functions contains gene... |
974ece4ddada23af371abd6ef6a1eb31228f7074a44a87a6ead43dfe1f296175 | MATLAB | 3,862 | 125 | function [params dispParams] = GTdefaults
% regularizers
params.conpot_lambda = 0.3;
params.data_lambda = 500;
params.c_likli = 1; 0.5; % likeliniess that a connection occurs
params.p_chempot = 0.1; 0.3; % cost of a particle (L0-regularizer)
params.p_expnump = 1; % l... |
84a59f15a0eb87f58cd1906effa1131e6fcb21ac37750d999aef9902abbf0a0b | MATLAB | 3,864 | 127 | function [bins,binned] = Bin(x,a,b,c)
%Bin - Assign each input value a bin number between 1 and N.
%
% Assign each input value a bin number between 1 and N. Also return the
% corresponding bin values (lower bounds), e.g. assuming that the bins
% are [0,1] [1,2] [2,3] ... the value 2.3 falls in bin #3 and the bin
% ... |
204fec2f2df2f8aa494ca877863b31d90542711399af155c75e38626873d76a4 | MATLAB | 3,865 | 110 | function results = ...
BehResp_Ana(handles, tc_all, tc_T, featureflag, varsel, varlist,...
ftdur, condflag,triallabel, beh_t, trialsel_ID, ttlabel, figiniID, datatitle)
% tc_all, tc_T: calcium traces, calcium trace timing
% featureflag: can be delta function (eg. reward signal), continuous change (eg. speed),
... |
3a90dfd2fbb9fbacd98c7a5ef9376fc592ff9d37a9356512270c373a95f43645 | MATLAB | 3,865 | 106 | function niicspmsig=ea_smooth_significance(XYZV,PTb,Vol,niic,options)
% function that generates a receptive field from datapoints by smoothing
% them. Then calculates an SPM statistic to check for significance.
odir=[options.root,options.patientname,filesep,'isosignificance',filesep];
mkdir(odir);
sdir=[odir,'SPM'];
... |
3fca34c79a5f6688f62a5f668cec8bd9a57d65e7cd99879d2e2cd445b6a9443b | MATLAB | 3,866 | 141 | function plot_raster(self, cel, varargin)
% Peristimulus time histogram of spikes between times
%
% (1) root.plot_raster(cel);
% (2) root.plot_raster(cel, epochs_offsets);
% (3) root.plot_raster(cel, epochs_offsets, plot_pd)
%
% (1) Prints to current axes raster plot of spikes in cel ([tetrode index, cell
% index]), be... |
4ad2e700fbc795c1bd579771a1f6247d22e735b57e8f49bc95adb411d97916cc | MATLAB | 3,867 | 134 | function Q2 = quickCV_PLSR(X, Y, C, opts)
% quickCV_PLSR Fast tuned cross-validated Q2 for PLSR, used for resampling.
%
% Q2 = quickCV_PLSR(X, Y, C, opts)
%
% Single (non-repeated) K-fold cross-validation with train-only preprocessing
% and inner-CV selection of the number of latent variables. Used by the
% pe... |
b1371620776f59295624a9e2f8f16e451034a399e1a70a8ed5cacecee96ca8e3 | MATLAB | 3,869 | 114 | function issues = LaBGAScore_check_all_scripts(rootdir)
%
%
% *USAGE*
%
% Runs MATLAB's built-in Code Analyzer (checkcode) on every .m file found
% recursively under rootdir, and prints a report to the command window.
%
% Syntax errors (checkcode id SYNER) are reported separately and
% prominently. Tested against real ... |
78b14b0c1c0a5993dd492fb7c04b33f4a0ff7db80580ae52be2d322f2abbf8d5 | MATLAB | 3,870 | 79 | function [dS,f]=mtdspectrumpb(data,phi,params)
% Multi-taper spectral derivative - binned point process
%
% Usage:
%
% [dS,f]=mtdspectrumpb(data,phi,params)
% Input:
% Note that all times can be in arbitrary units. But the units have to be
% consistent. So, if E is in secs, win, t have to be in secs, and Fs has to... |
ceb922094cd9f743e4ee20a71b081bc707ee3e3d3d184c50a3e1f61be136b7a1 | MATLAB | 3,871 | 100 | function CBIG_Yeo2011_ProjectSplitLabels2MNI1mm
% CBIG_Yeo2011_ProjectSplitLabels2MNI1mm
% Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
cortex_mask = MRIread(fullfile(getenv('CBIG_CODE_DIR'), 'data', 'extras', 'surf2surf_gui_data', ...
'CorrespondenceFreeSurferV... |
6daa3b3543964418f3d44033fc7ea8cef541359f32ebeab88f545608490cea7d | MATLAB | 3,872 | 102 | function BatchCallFeatureDetection(handles, k)
handles = featuredetect_batch_init(handles, 0);
[imagefolder, imagefilename, fext] = fileparts(handles.Datalist{k});
handles.filepath = imagefolder;
handles.filename = [imagefilename, fext];
handles.fext = fext;
%% load registration parameters if exist
RegPara = [];
if ... |
770b177d2500573205cd93e9d0cf237946c1b90ffaa29fae2b855fb9f5c09a0a | MATLAB | 3,872 | 104 | function [settings,eleNum] = ea_get_oss_reco(options, settings)
% Get electrode reconstruction parameters in OSS-DBS format.
% By Butenko and Li, konstantinmgtu@gmail.com
arguments
options % Lead-DBS options for electrode reconstruction and stimulation
settings % parameters for OSS-DBS simulation
end
%... |
26051db176f936dccf81a8b33c696aa6d830d94324116e572e845359f9a3b0cd | MATLAB | 3,873 | 101 | function p_characteristics = CBIG_ASDf_compareCharacteristics_wrapper(factorLoading_dir, outputDir)
% p_characteristics = CBIG_ASDf_compareCharacteristics_wrapper(factorLoading_dir, outputDir)
%
% Wrapper function to perform GLM (and logistic regression for binary
% variables) to compare ASD subjects' characteristics ... |
ff9b2b18b8ae0bc477cd63b63eb31adc3b04814e4e4dabab67087a997f2e2a61 | MATLAB | 3,874 | 119 | % This script creates templates to extract cubes from a grey matter segmentation with dimension 91 x 109 x 91 voxels
% The cubes have size 3 x 3 x 3 voxels, and therefore the template can start at different off set points.
% This script provides separate templates for all off sets possible.
%
% Dependencies:
% - standa... |
784029969e94680e475348c21d53ba0c36140c116d5add90e7885f8c7176fc87 | MATLAB | 3,875 | 119 | % This script creates templates to extract cubes from a grey matter segmentation with dimension 91 x 109 x 91 voxels
% The cubes have size 3 x 3 x 3 voxels, and therefore the template can start at different off set points.
% This script provides separate templates for all off sets possible.
%
% Dependencies:
% - standa... |
64933536614786dbdbcbd54f7a85b3f0d3f35ab48cd857d873130273fe5fbad3 | MATLAB | 3,876 | 106 | function [raw, Fs, time, Y, link, wl_idx, t1_idx, t2_idx] = load_trim_snirf(snirf_path, buffers)
%LOAD_TRIM_SNIRF Load SNIRF, compute trim window from stimuli, and slice.
% [raw, Fs, time, Y, link, wl_idx, t1_idx, t2_idx] = ...
% nirsproc.load_trim_snirf(snirf_path, buffers)
%
% Inputs
% snirf_path : p... |
933856984b744c0705db7a34ed6189857b7ed8cf3edfd8e4871b68d1aca2c1ee | MATLAB | 3,876 | 119 | function pos = ApproxMedianFilter_RB_LED(file)
% This code tests an approximate median filter for separating out the red
% and blue leds mounted on top of the subjects head
% I was using the DataMax system, which was synced using a red LED. Hence,
% I am tracking the x,y position of the animal as well as when the... |
ba8ed711c2abb2b20afb71d1fb49a7960bfd7c42099b93d2d6cf9bf947a44773 | MATLAB | 3,876 | 144 | function a = circ_plot(alpha, format, formats, varargin)
%
% r = circ_plot(alpha, ...)
% Plotting routines for circular data.
%
% Input:
% alpha sample of angles in radians
% [format specifies style of plot
% pretty, histogram, density, []
% [formats standard matlab string for plot... |
44339f22db05369d6357fc923f47e5c0f0a4a14e1f96d2754aecd28ae55d645c | MATLAB | 3,878 | 100 | classdef HButtonBox < uix.ButtonBox
%uix.HButtonBox Horizontal button box
%
% b = uix.HButtonBox(p1,v1,p2,v2,...) constructs a horizontal button
% box and sets parameter p1 to value v1, etc.
%
% A horizontal button box lays out equally sized buttons from left to
% right.
%
% Se... |
aea70ea4c98e53ed2419db46e3a25c94bf3b43787d210c95e004f7606f950129 | MATLAB | 3,878 | 115 | function [SortedStruct, SortedIndeces] = sortNEV(STRUCT, field, TestValue, Report)
% This function extracts information out of a structure based on the field
% values. The outputs can be the sorted structure and the indeces of those
% extracted fields.
%
% Use [SortedStruct, SortedIndeces] = sortNEV(STRUCT, fie... |
cb73ac54b3b6b35f9b710b918a705bb8acf5da447ba933aabc79726f87af8aa8 | MATLAB | 3,878 | 80 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
d6bdd235d58ff7cd0e677c6cfa2435423577e9eb284e2a3f2bde3efd0c91e3fc | MATLAB | 3,879 | 148 | function [popBursts] = bz_FindPopBursts(varargin)
% USAGE
% [popBursts] = bz_FindPopBursts(spikes)
%
% INPUTS
%
% spikes
% threshold # of stds above mean
% durations window for event durations, durations(1)*2 is also ISI minimum
%
%
%
% OUTPUTS
%
%
%
%
%
% TODO
% -zscore option
% -param input pa... |
a6d07079ef217aa770ef89f04cb166f4f443edefee9f1c1a29b2fcfca06b9e21 | MATLAB | 3,881 | 103 | function plugin_plot_local_nps_region_vals(nps_region_extract, save_dir)
%% Helper function to visualize local NPS region values from nps region extract (can be created by extract_local_nps_region_vals.m).
%
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU... |
14a3e79fe621eafd651d3f4058507fdf9d324b32fc343360da55a9d63db6ee00 | MATLAB | 3,887 | 109 | % PRELP Loads and preprocesses LP from an MPS file.
%
% > [A,b,c,lenx,lbounds] = PRELP('problemname')
% The above command results in an LP in standard form,
% - Instead of specifying the problemname, you can also use PRELP([]), to
% get the problem from the file /tmp/default.mat.
% - Also, you may type PRE... |
072b21cb76b4798a704f0a776fadd443a0ca5aafb503ce76b555e7912bf3cb65 | MATLAB | 3,889 | 92 | %% Visualisation of the Mädler/Coenen VTA Approximation
% see Mädler, B., and V. A. Coenen. "Explaining clinical effects of deep brain stimulation
% through simplified target-specific modeling of the volume of activated tissue."
% American Journal of Neuroradiology 33.6 (2012): 1072-1080.
%
% Andreas Husch
% Centre H... |
969ec26ef82a756630b817f2e1dc0210463a37c25ab291524aff2098049c8c82 | MATLAB | 3,889 | 137 | function [handles, data2plot, colorOrder] = dan_apply_montage(handles, data2plot)
% This function takes care of selecting the write channels to plot, as well
% as applying re-referencing, filtering, and color schemes as specified
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
montage = handles.montage;
%% Rename... |
9f8e33bd2cd12a5eb2bde874bdc61b4e6b25401e0435c62ec8c7e95c07fa3437 | MATLAB | 3,889 | 93 | function smPropPerTimeIntInMask = retainSmPropInMask(smPropPerTimeIntAll, threshMet, numOutsideMaskFlag)
% RETAINSMPROPINMASK: takes the properties of SMI per FSM interval and the indexes of which SMI tracklet is within mask and discard those tracklets that are outside of the mask.
%
% SYNOPSIS: smPropPerTimeIntInMask ... |
3135393294396b38f106412f1997e3e1d2bc8581865a240553e1c61b0aaeee23 | MATLAB | 3,892 | 95 | ccc;
AREAs = {'AC', 'PFC'};
temp = dir("..\MAT Data\cwt result\PE\**\cwtres_*.mat");
SINGLEPATHs = unique({temp.folder})';
RAWDATAPATHs = cellfun(@(x) strrep(x, '\cwt result\PE\', '\pre (granger)\'), SINGLEPATHs, "UniformOutput", false);
%% Params
ncmb = 64;
%% granger causality computation
for sIndex = 1:length(SIN... |
5a9460b46d1fccfbc67a43ffea9216c57b87816ab994ffb84eef6ed37b947f27 | MATLAB | 3,892 | 91 | function handles = inputmap_refreshplot(handles, dataID)
f_wait = waitbar(0.5,'Data loading');
% load data
cla(handles.DisplayResult, 'reset')
set(handles.uit, 'Data', {})
% handles = loadtrace(handles, dataID);
axes(handles.DisplayResult), set(gca, 'Ydir', 'reverse')
%%%% display rois and ... |
daefcc6bdea9d0af3a8b8856d1eb8651680df4ffa523cb037250b5edf27ac22d | MATLAB | 3,893 | 93 | function [tf, dh_used] = tfce_volume(vol, H, E, conn, sidedness, tail, dh)
% tfce_volume Classic TFCE of a 3D statistic volume, with sign handling.
%
% [tf, dh_used] = tfce_volume(vol, H, E, conn, sidedness, tail, dh)
%
% Single entry point for threshold-free cluster enhancement (Smith & Nichols
% 2009) across t... |
2d031893dfe923da1118cd250a51e31fcaf83227c231526d0592e8a2e9160232 | MATLAB | 3,894 | 176 | % Imbed a file menu to any figure. If file menu exist, it will append
% to the existing file menu. This file menu includes: Copy to clipboard,
% print, save, close etc.
%
% Usage: rri_file_menu(fig);
%
% rri_file_menu(fig,0) means no 'Close' menu.
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%---------... |
318f809b1efdf57ce7d341a4a410d61d53cd0d6c5d921b3c71016ae603615f68 | MATLAB | 3,898 | 86 | % pop_dipparams() - Set plotting parameters for dipoles.
%
% Usage:
% >> STUDY = pop_dipparams(STUDY, 'key', 'val');
%
% Inputs:
% STUDY - EEGLAB STUDY set
%
% Optional inputs:
% 'axistight' - ['on'|'off'] Plot closest MRI slide. Default is 'off'.
% 'projimg' - ['on'|'off'] lot dipoles projectio... |
6ce8d8ea1fbd701ad7dcba335f8c17d903c93f90ac7a09cde1eaf25cca8419af | MATLAB | 3,898 | 137 | % plotfresp() - Plot FIR filter's impulse, step, frequency, magnitude,
% and phase response
%
% Usage:
% >> plotfresp(b, a, n, fs);
%
% Inputs:
% b - vector filter coefficients
%
% Optional inputs:
% a - currently unused, reserved for future compatibility with IIR
% filters {defaul... |
71a7a75df6518c190de82c3d0975b131c16655f38e5309d3abb72df0f70e6029 | MATLAB | 3,898 | 144 | function[H,P,M1,M2,N1,N2] = countsig(data1,data2,T1,T2,parametric,p,quiet)
% Give the program two spike data sets and one
% or two time intervals and it will decide if
% the counts are significantly different.
% this is either with a non-parametric method
% or with a sqrt transformation followed by a
% t-... |
2ffd3d480effbb3215b7c11fcdf129cfb67971ae73621d76c2991f8c35803c5c | MATLAB | 3,899 | 113 | function [dice, info] = dice_statistic_image(img1, img2, varargin)
% dice_statistic_image Dice overlap between two thresholded statistic images.
%
% [dice, info] = dice_statistic_image(img1, img2)
% [dice, info] = dice_statistic_image(img1, img2, 'p_threshold', 0.01)
% [dice, info] = dice_statistic_image(img1, i... |
31c1fc32b0557c850c4e554e7bdd9e2eccfbb4a29ef63e6651f20baccddba937 | MATLAB | 3,899 | 116 | function [value_mean, value_std, value_sem, glist_current] = ...
stampResp_v2(trace_stamp, framestamp, stampinfo,...
ttlabel, stampsel, varsel, glist_all, xvalue,...
handles, figiniID, datatitle)
N = size(trace_stamp, 2);
stampinfo_t = table2array(stampinfo(:,1));
stampinfolist = table2array(stampinfo(:,va... |
02142197a7081e1dc22a8bf13e871e5fec9c926d560755c87c4b6ada3133d907 | MATLAB | 3,901 | 107 | function [bm,env,delay] = gammatoneFast(x,cfs,fs,align)
%GAMMATONEFAST Produce an array of responses from gammatone filters via FFT
%
% BM = IOSR.AUDITORY.GAMMATONEFAST(X,CFS,FS) passes the vector X through
% a bank of fourth-order gammatone filters, with centre frequencies
% specified by CFS. The function r... |
8b09e618fce49fcf34adb89cbadda6995830f9d636c5ef6d5e021c37d17ac11b | MATLAB | 3,902 | 130 | function smoothed = AdaptiveSmooth(data,smooth)
%AdaptiveSmooth - Smooth using an adaptive kernel.
%
% USAGE
%
% smoothed = AdaptiveSmooth(data,smooth)
%
% data data to smooth
% smooth vertical and horizontal standard deviations [Sv Sh]
% for Gaussian kernel, measured in n... |
1d6bccef96eb0cded58f2f70f8705c7798c38dda8e45dddc1501b55618508a5d | MATLAB | 3,903 | 94 | function [Lden, Ld] = deninfac(symLden, L,dense,DAt, d, absd, qblkstart,pars)
% [Lden, Ld] = deninfac(symLden, L,dense,DAt, d, absd, qblkstart,pars)
%
% DENINFAC
% Uses pars.maxuden as max. allowable |L(i,k)|. Otherwise num. reordering.
%
% ******************** INTERNAL FUNCTION OF SEDUMI ********************
%
% See a... |
a70304ad8f59e7120f7605915b76378757b23ad18b8010279cff9813bec7817c | MATLAB | 3,904 | 106 | function [map,timeBins] = SyncMap(synchronized,indices,varargin)
%SyncMap - Create a map from successive event-synchronized data.
%
% Using N repetitions of similar data centered around synchronizing
% events (e.g. N evoked potentials), create a map v = f(t,i) where
% t is the time relative to the synchronizing events... |
e7bb8f56be3a23a26262902f6d1afc24234a53296bf84a78f9f5d65a8a23cc2b | MATLAB | 3,904 | 133 | function [xc,mode] = XCorr1(x,y,varargin)
%XCorr1 - Compute cross-correlograms and their modes for pairs of curves.
%
% USAGE
%
% [xc,mode] = XCorr1(x,y,<options>)
%
% x first set of curves (MxN matrix: M curves, N bins)
% y second set of curves
% <options> optional list of ... |
18a4423743beadf4966ab9facc11a05d7ab15fb0df89a14e48dcb4a36cd69008 | MATLAB | 3,909 | 122 | function ea_discfibers2nifti(discfiber, threshold, fiberset, outputName, reference)
% Convert discriminative fibers to nifti
%
% discfiber: discriminative fibers including fiber cell and T-scores
% threshold: threshold to filter the fibers
% fiberset: fiber set to be converted, can be 'postive', 'negative' ... |
482e10f8cc73715de30cd34e087f48c5fbb77355ce0237210ce8497d663d278e | MATLAB | 3,915 | 118 | function ea_applynormto_custom_file(uipatdir, untouchedanchor, fname, interp)
% interp = interpolation to choose (default = 1) - losely following spm nomenclature (0 = nearest neighbor, 1 = trilinear etc)
% untouchedanchor = 0 -> use anchor space, 1 -> use raw anchor space, 'filename.nii' -> use specific file
% fname ... |
868dd023edea488c5d1128eb9a103a4bc2ea1ce366b3c9b60151a36494d9c096 | MATLAB | 3,916 | 141 | % This demonstration is to show the different way this code can plot the
% ROI boundaries
load('surface_data.mat','lh_inflated_verts','lh_verts','lh_faces','lh_HCPMMP1','lh_aparc','lh_rand200')
load('example_data.mat','lh_sulc')
surface.vertices = lh_inflated_verts;
surface.faces = lh_faces;
figure('Positio... |
aa6490d9a1fe48271d6749cfb715ee4d38eef8899f69c96dcde3873a5b983ee2 | MATLAB | 3,917 | 152 | function hh = herrorbar(x, y, l, u, symbol)
%HERRORBAR Horizontal Error bar plot.
% HERRORBAR(X,Y,L,R) plots the graph of vector X vs. vector Y with
% horizontal error bars specified by the vectors L and R. L and R contain the
% left and right error ranges for each point in X. Each error bar
% is L(i) + R(... |
07f4ffe007cc37582ffdb14d3df0e05c03a3e1e2d0c51ec80f74513e18744059 | MATLAB | 3,918 | 111 | function this = gifti(varargin)
% GIfTI Geometry file format class
% Geometry format under the Neuroimaging Informatics Technology Initiative
% (NIfTI):
% http://www.nitrc.org/projects/gifti/
% http://nifti.nimh.nih.gov/
%_______________________________________________________... |
1542c59a4ac99c681bf4999e63fe69b66ae59c5de492d1382f13a5648f2475f3 | MATLAB | 3,919 | 124 | function [phi, max_cor, phi_v_cor] = AutoCorrRotation(ac1, ac2, varargin)
% Calculates angle phi for which ac1 and ac2 are maximally correlated.
% Useful for checking for rotation of grid field orientation between
% conditions
%
% ARGUMENTS
% ac1 matrix of autocorrelogram 1
% ac2 matric of autocorre... |
7cfc35b6ffaaf8131b878cf4fb6f89b444911e7dfba031ff1544bc6649e7eeeb | MATLAB | 3,920 | 71 | function [S,f,R,Serr]=mtspectrumtrigpb(data,E,win,params,fscorr)
% Multi-taper event triggered time-frequency spectrum - binned point process
%
% Usage:
%
% [S,f,R,Serr]=mtspectrumtrigpb(data,E,win,params,fscorr)
% Input:
% data (single channel data) -- required
% E (event times) - require... |
64fb424095900950a51c9c3c9a053d05cd1baee4e7ee2f834f8a048d2fbed04b | MATLAB | 3,922 | 115 | function [wt,freqlist,psi_array] = awt_freqlist(x,Fs,freqlist,type,xi)
% awt_freqlist analytical wavelet transform, where one can specify the list of desired frequencies
%
% [wt,freqlist,psi_array] = awt_freqlist(x,Fs,freqlist,type,xi)
%
% Inputs:
% x the signal to be analyzed
% Fs ... |
c07050bdc0872f3e896a54c76220012b160ea3681e86588516814ac96bdad816 | MATLAB | 3,922 | 91 | function all_XTr_pseudo = turn_training_simultaneous_data_into_pseudo_populations(all_XTr_simul, all_YTr, feature_to_siteID_mapping)
% A helper function takes simultaneously recorded training data and turns them into pseudo-populations.
% This is useful for assessing whether training on shuffled data leads to simil... |
04cb04ca7d7dd63e083629592cac14b9dd570dc7adbbdf9870387857d9b697f9 | MATLAB | 3,923 | 95 | function [Vertex_Force, Cell_Perim, Cell_Area] = get_VM_force_LE(V, C, KP, P0, KA, A0, strain)
% GET_VM_FORCE_LE Compute the net mechanical force on every vertex from
% the standard vertex-model energy (area + perimeter elasticity), under
% Lees-Edwards (sheared) periodic boundary conditions.
%
% [Vertex_Force, Cell... |
890a66a364412801b1646d660fdc3a34a0f831283e88274bc219b4ccf21ed53d | MATLAB | 3,923 | 153 | function m = AdjustColorMap(varargin)
%AdjustColorMap - Adjust colormap for current figure, i.e. change gamma.
%
% USAGE
%
% m = AdjustColorMap(<options>)
%
% <options> optional list of property-value pairs (see table below)
%
% =========================================================================
%... |
b844062d87c514e9d41f40469ec9d52ef651500d1184961ddd9f3e3d6d84cd4c | MATLAB | 3,923 | 151 | % ploterp() - plot a selected multichannel data epoch on a common timebase
%
% Usage: >> ploterp(data,frames,epoch,[limits],'title',[plotchans]);
%
% Inputs:
% data = EEG/ERP data epoch (chans,frames)
% frames = frames per epoch {default: data length}
% epoch = epoch to plot {default: 1}
% [limits] ... |
a92417e29349b472e5ddb109ec373e6d82c02e1bc5c379ba99489ff5a56c7043 | MATLAB | 3,924 | 118 | function [H] = rotate(D);
% ROTATE returns the homogenous coordinate transformation matrix
% corresponding to a rotation around the x, y and z-axis. The direction of
% the rotation is according to the right-hand rule.
%
% Use as
% [H] = rotate(R)
% where
% R [rx, ry, rz] in degrees
% H corresponding homogenous... |
b820b718d05f7456543328080a0f1af4923254b04247b08cbd45e680f618730d | MATLAB | 3,924 | 129 | %% Example 2 of applying topic models to images
% This example illustrates how to apply topic models to a set of handwritten
% digits and characters. The dataset is based on Sam Roweis's "binaryalphadigs.mat" at
% http://www.cs.toronto.edu/~roweis/data.html
% It contains binary 20x16 digits of "0" through "9" and... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.