sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ea1be191c51982716a4f5cbbc74231cbf398c279b554644c79198838d32919af | MATLAB | 1,403 | 36 | function sessions = ImportGUI()
%
% Will displace the location of the saved CMBHOME Objects, which can also be loaded easily as:
% load(sessions(1).mat).
%addpath C:\Users\Holger\Dropbox' (hasselmonians)'\hdannenb\InvivoImport\
%{
sessions = invivoImport('basePath', 'C:\Users\Holger\Dropbox (h... |
7c33fe235c46d02869f19876c2e84761ec30ed5018ffd07be4782dd1050920d8 | MATLAB | 1,404 | 38 | function ea_checkfiles(options)
% load files
if strcmp(options.prefs.patientdir,'Choose Patient Directory')
ea_error('Please choose patient directory first');
end
vfi={'tra','cor','sag'};
bb=spm_vol([ea_space(options),'bb.nii']);
for tracor=1:length(vfi)
cf=[options.root,options.prefs.patientdir,filesep,option... |
1981f22db8d650bbfa605feb1c4080c283190459987585f5b0c6d1f12050a7f9 | MATLAB | 1,405 | 46 | function kappa = CalcCurvature(v, vtheta, indx, dt)
%CALCCURVATURE
% Usage: kappa = CalcCurvature(v,theta,indx,dt)
%
% This function calculates the curvature of the path that the fly took
% while walking in the frames indexed by indx. The inputs are the speed v
% , the angle of the velocity vector vtheta,th... |
ce25cb7071f6fab45b170072793b781ba0ca8a36ae5334a8e6930df1f9165f38 | MATLAB | 1,405 | 49 | % eeg_hist() - history for EEGLAB dataset.
%
% Usage:
% >> EEGOUT = eeg_hist( EEGIN, command );
%
% Inputs:
% EEGIN - input dataset
% command - [string] eeglab command
%
% Global variables used:
% EEGOUT - output dataset with updated history field
%
% Author: Arnaud Delorme, SCCN/INC/UCSD, Dec 2003
%
% See a... |
211305793dde9e0af0a44f33ae81c6d108bb7459b6e98bbf8af88eea7929ace2 | MATLAB | 1,406 | 60 | function cell2csv(C,filename)
%CELL2CSV Output a cell array to a CSV file
%
% IOSR.GENERAL.CELL2CSV(C,FILENAME) writes the cell array C to a CSV file
% specified by filename.
% Copyright 2016 University of Surrey.
%% make sure filename has a .csv extension
[pathstr, name, ext] = fileparts(filename);
... |
66167c47ca39faab00ad19a0684adb77804c2a268e7be1e216b1d7c7247e3da8 | MATLAB | 1,406 | 56 | function [mu ul ll] = circ_mean(alpha, w, dim)
%
% mu = circ_mean(alpha, w)
% Computes the mean direction for circular data.
%
% Input:
% alpha sample of angles in radians
% [w weightings in case of binned angle data]
% [dim compute along this dimension, default is 1]
%
% If dim argument is specif... |
e7853fcd584c236bf4cb98adf86fd1b12414965c226b4b5a156581e96566279f | MATLAB | 1,406 | 36 | %% determineElectrodeType - get most likly electrode type be eucleadian distance between detected ans specified peaks
%
% Andreas Husch
% Centre Hospitalier de Luxembourg / Luxembourg Centre for Systems
% Biomedicine, University of Luxembourg
% 2016 - 2017
% mail@andreashusch.de
function [elecStruct, rms, d] = determ... |
12bea42d10df341b49bb06e56a0c74edbdc6b88594e4428abf5e883e88ae29f8 | MATLAB | 1,407 | 53 | function ea_seed2map_weighted(varargin)
space=varargin{3};
map=ea_load_nii(space);
cfile=varargin{1};
load(cfile,'fibers');
mapsz=size(map.img);
map.img(:)=0;
seedfiles=varargin{2};
tree=KDTreeSearcher(fibers(:,1:3));
for s=1:length(seedfiles)
Vseed=ea_load_nii(seedfiles{s});
if isempty(varargin{4}... |
e65987475da757939908c7cbab87a1b25d4c8b53b317d14dd0c34ad2ac22495e | MATLAB | 1,407 | 40 | function [x] = truncGaussianSample(mu,s,a,isUpper)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically relevant behaviors of the ecosystems.
% Copyright (C) 2015 Va... |
4ea3e13198547b003535f8b0db72e64e3e76d9f9aa2f54d02ea0342e2d1c7dd1 | MATLAB | 1,408 | 34 | function options = ea_get_OSS_DBS_options(patientPath, N_tracts, ConnectomeName, native)
% update options for OSS-DBS launch without GUI
% unupdated parameters are the same as during the last GUI settings session
options = ea_prefs('');
options = ea_getptopts(patientPath, options);
options.nat... |
504b0037659d051ec5a0829a63616cdbfcb3dfb921862bf2812973d48a40fcea | MATLAB | 1,408 | 62 | clear;clc
% Set default parameters
fs = 1000;
bin = 0.1;
pre = 4;
post = 5;
%% Analysis
% Find Event
load('AIF01.mat');
event_raw = find(diff(AIF01)>400);
event = event_raw(1);
for e = 1:length(event_raw)-1
if event_raw(e+1)-event_raw(e)>5*fs
event ... |
dde7fafcc18926d4131d7b8d7aaf18e93e43b3802aab26a6931c349ea8b70e60 | MATLAB | 1,408 | 39 | %
% KDRANGEQUERY Find all points within a local neighborhood.
%
% PTS = KDRANGEQUERY( ROOT, QUERYPT, DISTLIM ) finds all the
% points stored in the k-D tree ROOT that are within DISTLIM units
% from the QUERYPT. Proximity is quantified usng a D-dimensional
% Euclidean (2-norm) distance.
%
% Input :
% ROOT is a... |
60c557cdba196a0d0bc57e5fc0a5554e38ecc3311b492fc4ed82a85f09c77273 | MATLAB | 1,409 | 62 | function plotMetricCDFAreas(allROIs, metricField, areas, minmax, kdeBW)
% Creates KDE plots for metric value distributions separated by area
if nargin < 4
minmax = [];
end
if nargin < 5
kdeBW = [];
end
% Create figure
fig;
panelwidth = 2.25;
panelheight = 1.5;
leftoffset = 0.5;
bottomoffset = 0.5;
formatFigu... |
806ce548711438f9fe6d6e5997e55cf6fc329f9675942ff732e312e7b92e5561 | MATLAB | 1,409 | 53 | function [k k0] = circ_kurtosis(alpha, w, dim)
% [k k0] = circ_kurtosis(alpha,w,dim)
% Calculates a measure of angular kurtosis.
%
% Input:
% alpha sample of angles
% [w weightings in case of binned angle data]
% [dim statistic computed along this dimension, 1]
%
% If dim argument i... |
58557c36b96e27265d44241840f25eba62f4cdcd6e834b2805b3363541d7df2f | MATLAB | 1,410 | 30 | function [J,Msp,Nsp]=mtfftpb(data,tapers,nfft)
% Multi-taper fourier transform - binned point process data
%
% Usage:
%
% [J,Msp,Nsp]=mtfftpb(data,tapers,nfft) - all arguments required
% Input:
% data (in form samples x channels/trials or single vector)
% tapers (precalculated tapers from dpss)
% ... |
6f806c3a7650f22bb0a833511c1068e29f511d9216e41321be3c04b52f6ba80a | MATLAB | 1,410 | 43 | %% Applying Tone Mapping to CT Data Enabling Simultaneus Display of Bony and Soft-Tissue Structures
%
% Andreas Husch
% Centre Hospitalier de Luxembourg, Dep. of Neurosurgery /
% University of Luxembourg - Luxembourg Centre for Systems Biomedicine
% 2016 - 2017
% mail@andreashusch.de, husch.andreas@chl.lu
function CTCo... |
28d6e749909d094bc85f18c9abd014934d84e6aa9b475cfb9291b6a4a039c23d | MATLAB | 1,411 | 58 | % Checks if the input argument is a vector.
% truth = mn_isvector(inVc)
%
% Returns 1 if inVc is a vector, else 0.
% Single numbers (length(vec)==1) are understood as not beeing a vector.
% Function accepts both, row and column vectors.
%
% Examples:
% truth = mn_isvector([1;2;5]); -> truth=1
% truth ... |
3306301b7a32dbc59f89562acfcc4c390a96563b209b4cd04d4f6e830647c2fb | MATLAB | 1,411 | 34 | function [ad] = PL2Ad(filename, channel)
% PL2Ad(filename, channel): read all a/d data for the specified channel from a .pl2 file
% returns a/d values in millivolts
%
% examples:
%
% ad = PL2Ad(filename, channel)
% ad = PL2Ad(filename, 2)
% ad = PL2Ad(filename, 'FP02')
%
% INPUT:
% filename ... |
5277b0e0a08ba322d867c36f56195dc16835026babddd900070573a37f579cef | MATLAB | 1,411 | 64 | function [ y, symm ] = cvx_s_banded( m, n, symm, lower, upper )
%CVX_S_BANDED (U,L)-banded matrices.
if nargin < 4,
error( 'Bandwidth arguments missing.' );
end
if ~isnumeric( lower ) || length( lower ) ~= 1 || lower < 0 || lower ~= floor( lower ),
error( 'Bandwidth arguments must be nonnegative integers.' );... |
9ce09daae7d8a5cf86dd1d8b1d9eb97d68258d5d60b49537167439960d015381 | MATLAB | 1,412 | 48 | function WasOnTop = WinOnTop( FigureHandle, IsOnTop )
%WINONTOP allows to trigger figure's "Always On Top" state
% Written by Igor
% i3v@mail.ru
% Parse Inputs
if ~exist('FigureHandle','var');FigureHandle = gcf; end
assert(...
isscalar( FigureHandle ) && ishandle( FigureHandle ) && strcmp(get(FigureHand... |
ce8800a19f7e56774921305335c7f24c6a0e96386ad171ab4aa3b9b03a4dce57 | MATLAB | 1,413 | 43 | function tree = flush(tree,uid)
% XMLTREE/FLUSH Flush (Clear a subtree given its UID)
%
% tree - XMLTree object
% uid - array of UID's of subtrees to be cleared
% Default is root
%__________________________________________________________________________
%
% Clear a subtree given its UID (remove... |
ed3764bfe6d725c396f3e0987e67c47de9a76dafc4fbc4e402c7a5fb0b3011a5 | MATLAB | 1,413 | 46 | function [ y, symm ] = cvx_s_sparse( m, n, symm, i, j )
%CVX_S_SPARSE Matrices with a fixed sparsity pattern.
if nargin < 5,
error( 'Sparsity structure missing.' );
elseif ~isnumeric( i ) || ~isnumeric( j ),
error( 'Sparsity arguments must be vectors of nonnegative integers.' );
elseif any( i <= 0 ) || any( j... |
558ecc10e9c3f747eb8f8b1b81cb83eb2d7f04de5fec6f94083fbb9b49b34573 | MATLAB | 1,414 | 59 | function savedxf(node,face,elem,fname)
%
% savedxf(node,face,elem,fname)
%
% save a surface mesh to DXF format
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2010/04/25
%
% input:
% node: input, surface node list, dimension (nn,3)
% face: input, surface face element list, dimension (be,3)
% elem:... |
c9c35093b1617fa5afc5fe860875b69c8be330df1eb33b9088e1b36339dcd449 | MATLAB | 1,415 | 48 | function CBIG_pMFM_dwell_time_simulated()
% This function is used to compute the dwell time distirbution for
% simulated data
%
% Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
load('../../../part1_pMFM_main/output/step5_STDFCD_results/STD_FCD_simulated_... |
5ea05427105a7c0777019c2f5214839383ec9cd912e633b3364bba16e5534170 | MATLAB | 1,416 | 51 | function [scalingFactor_uV, channelMapImro, probeType] = readSpikeGLXMetaFile_new(param)
% JF
% read spikeGLX meta file and calculate scaling factor value to convert raw data to
% microvolts
% ------
% Inputs
% ------
% metaFile: string, full path to meta file (should be a structure.oebin file)
% ------
% Outputs
% ---... |
c4724e2aa2b97b320e7150bbc8269735ce4c0b79db3a771030e70eb78546f9b4 | MATLAB | 1,416 | 44 | % var() - variance of memory mapped underlying array
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% 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 Sof... |
c7204a9f231c3550b2f396149861700d7942d2e6fc548f3304546b47d17c0d41 | MATLAB | 1,416 | 44 | function [ci sizes] = components(A,varargin)
% COMPONENTS Compute the connected components of a graph.
%
% [ci sizes] = components(A) returns the component index vector (ci) and
% the size of each of the connected components (sizes). The number of
% connected components is max(components(A)). The algorithm used compu... |
98cefe895471134c452d3c286e96e26c2160763435b37481e3f336dd816d7c79 | MATLAB | 1,417 | 75 | %% POS conversion
posfile = dir('*pos');
pos = importdata(posfile.name);
% determine if timestamps are first or last column
[a b] = min(nanstd(diff(pos))); % find the column with smallest variability..
behav.timestamps = pos(:,b);
pos(:,b) = []; % remove timestamps from pos mat
if size(pos,2) > 5 % if optitrack
... |
d518ff6de72fb4f16dce31227b88d28bf335fb92bbb99231bd00b228dd0fe150 | MATLAB | 1,417 | 37 | function timeinds = datetime2ind(datelist, timelist)
%DATETIME2IND Converts date/time lists to serial time indices.
% TIMEINDS = DATETIME2IND(DATELIST, TIMELIST) takes two N x 1 cell
% arrays containing the dates and times (as strings) to be converted
% and returns an N x 1 vector of (double) time indices as... |
4bcfc9228e88f300fef3f049076f93ed18263e13107687296a93a91b1585c939 | MATLAB | 1,418 | 37 | function tree = xml_parser(xml)
% XML Parser
% FORMAT tree = xml_parser(xml)
% xml - XML-encoded string or filename of an XML document
% tree - struct array representation of the XML document
%__________________________________________________________________________
%
% This C-MEX file is a wrapper arou... |
b8a483276a1c01dbbf48ac7041c5fef27469176a8b6de493aee0bf7e4f477f5a | MATLAB | 1,418 | 63 | function SplitTitle(h,text,width)
%SplitTitle - Split figure title over multiple lines
%
% USAGE
%
% SplitTitle(text,width)
% SplitTitle(h,text,width)
%
% h optional handle (default = gca)
% text title text
% width optional line width (in chars, default = 10)
%
% Copyri... |
103c7d034d000f19efe3617d940cce95d947187aa8469d2a15c8eb5399cede2d | MATLAB | 1,420 | 35 | function Map_creation_3T(R2_file, R2star_file, R1_file, seg_file)
% Load R2 and multiply by 0.65, then save as R2_3T
R2_img = load_untouch_nii(R2_file);
R2_data = double(R2_img.img);
R2_data_3T = R2_data * 0.65;
R2_3T_img = make_nii(R2_data_3T, R2_img.hdr.dime.pixdim(2:4), [], 64);
save_ni... |
be0c0c7eb9595db37ef74a3f84f38bd30a4fc25fe1ba9f77d35621922c2acf62 | MATLAB | 1,420 | 48 | function varargout=ea_explorer_stats_2samplettest(varargin)
% Function to estimate a certain mass univariate test (see below) as used
% in explorer apps.
% - Expects valsin as V x N matrix where
% V is the number of
% voxels/streamlines/etc and
%... |
c50854368883937c08c2e4421a570b45d9e7df038ee1654120234a2bea211919 | MATLAB | 1,420 | 52 | function [elist,nextfront]=advancefront(edges,loop,elen)
%
% [elist,nextfront]=advancefront(edges,loop,elen)
%
% advance an edge-front on an oriented surface to the next separated by
% one-element width
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2012/02/09
%
% input:
% edges: edge list of an oriented s... |
5bf79e504ea9ced0abfcc614e97eb83fedbdd24c7ba55808bae7956cb2f40e66 | MATLAB | 1,421 | 31 | %% PaCER/EXAMPLE.m - Example file for using PaCER - Precise and Convenient Electrode Reconstruction
% to reconstruct precise curved electrode trajectories
% and contact locations from post operative CT imaging
% of DBS electrodes
%
% Andreas Husch
% Centre Hospit... |
7ffaff35c914d09c51c8b0afb1bdccd8d9db9f2707bc8f52022e6dc6f902f2df | MATLAB | 1,421 | 45 | %%********************************************************
%% qops: Fu = qops(pblk,w,f,options,u);
%%
%% options = 1, Fu(i) = <wi,fi>
%% = 2, Fu(i) = 2*wi(1)*fi(1)-<wi,fi>
%% = 3, Fui = w(i)*fi
%% = 4, Fui = w(i)*fi, Fui(1) = -Fui(1).
%% options = 5, Fu = w [ f'*u ; ub + fb*alp ], where
%% ... |
e33dd8b21624479138694c4ccd1f745f591ad1d5509df7ba9db9980a0b87dcfb | MATLAB | 1,421 | 46 | function computeIttiMaps(params)
% computeIttiMaps(params)
%
% ----------------------------------------------------------------------
% Matlab tools for "Predicting human gaze beyond pixels," Journal of Vision, 2014
% Juan Xu, Ming Jiang, Shuo Wang, Mohan Kankanhalli, Qi Zhao
%
% Copyright (c) 2014 NUS VIP - Visual Inf... |
e636cd56f5af9b169e960dc30f499d0520ebf6452a4e9540f9b0a3e0229d0b37 | MATLAB | 1,421 | 49 | function outpoints = icbm_fsl2tal(inpoints)
%
% This function converts coordinates from MNI space (normalized
% using the FSL software package) to Talairach space using the
% icbm2tal transform developed and validated by Jack Lancaster
% at the Research Imaging Center in San Antonio, Texas.
%
% http://www3.interscie... |
a596174d1e34d3405bf53ed6d6da862bc50c520af513b1192ee7224e2d39836a | MATLAB | 1,422 | 46 | function [ states,filename ] = bz_LoadStates(basePath,statesName)
%[ states ] = bz_LoadStates(basePath,statesName) function for
%loading states.mat files. states.mat files are saved as...
% datasetPath/baseName/baseName.statesName.states.mat
%
%statesName can be the name of a states.mat file, or can be 'all' to load
%a... |
caf4a2c3849e8eab5f1f8e755a9b34b18b16bba67ccedb6c0033b8786ca9b05e | MATLAB | 1,422 | 41 | function tf = CBIG_IndCBM_check_example_results(output_dir)
% CBIG_IndCBM_check_example_results(output_dir)
%
% This function checks if the generated example results are identical with
% the reference files.
%
% Input:
% - output_dir: The output directory with generated example results.
%
% Written by XUE Aihuiping ... |
daca35a35f9bbda93ab7de0b7ec236b1527ea6b7041a27d6922e0e8da03b0f3d | MATLAB | 1,423 | 67 | function varargout = plot(varargin)
% plot method for GIfTI objects
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
% $Id: plot.m 5888 2014-02-19 19:54:12Z guillaume $
% if ishandle(varargin{1})
% h = figur... |
ee5ada8c59bc5646739716f1c744816aa329751a813cd7396a5e256fc4a9d918 | MATLAB | 1,423 | 41 | function sleepstagesOUT = bids2danalyzer(sleepstagesIN, values)
stageIdx = ismember(sleepstagesIN.trial_type, values);
sleepstagesIN = sleepstagesIN(stageIdx, :);
sleepstagesOUT.stages = zeros(height(sleepstagesIN), 1);
for i = 1:height(sleepstagesIN)
if strcmpi(sleepstagesIN.trial_type(i), values{1})
... |
39f5b2e9bfec95fa3aea0d98339a1722ff08ce43fef32b3120c6ac67003e739d | MATLAB | 1,424 | 40 | function coordAxes(ax, origin, scale, fontSize, flips, letters)
% x0 = 10;
% y0 = 90;
% z0 = -10;
if nargin < 6
letters = {'X', 'Y', 'Z'};
end
x0 = origin(1);
y0 = origin(2);
z0 = origin(3);
% Make coord axes
Tmat = [[1, 0, 0, x0];[ 0, 1, 0, y0]; [0, 0 ,1, z0]; [0,0,0,1]];
xbar = [[0,0,0,1];[flips(1)*scale,0,0,... |
424efdf64f121bc99ee5421952f3c717830cdbd6b819554f712b7db942777e46 | MATLAB | 1,424 | 52 | function [b b0] = circ_skewness(alpha, w, dim)
% [b b0] = circ_skewness(alpha,w,dim)
% Calculates a measure of angular skewness.
%
% Input:
% alpha sample of angles
% [w weightings in case of binned angle data]
% [dim statistic computed along this dimension, 1]
%
% If dim ... |
80d6534fc72ef2d4f888738a26942f14cf3c2a0663b324bc58a4fd676d6a6a5f | MATLAB | 1,425 | 51 | function output = ea_appendVolNum(niifpath, volnum)
% Append volume number to nifti file path for the use in SPM
%
% Example:
% ea_appendVolNum('A.nii') -> 'A.nii,1'
% ea_appendVolNum('A.nii', 1) -> 'A.nii,1'
% ea_appendVolNum('A.nii', [1,2]) -> {'A.nii,1'; 'A.nii,2'}
% ea_appendVolNum({'A.nii'}) -> {'A... |
912464a32ac576e77ff44bd7ec0d4c57612c3c951535ded0c32f34bac6026c8a | MATLAB | 1,425 | 49 | function outpoints = icbm_spm2tal(inpoints)
%
% This function converts coordinates from MNI space (normalized
% using the SPM software package) to Talairach space using the
% icbm2tal transform developed and validated by Jack Lancaster
% at the Research Imaging Center in San Antonio, Texas.
%
% http://www3.interscie... |
45743842a04b8930d0d1d82714e764f7946d09582b4f10728e6379d193e51406 | MATLAB | 1,426 | 52 | function varargout= make_biconnected_planar(A,varargin)
% MAKE_BICONNECTED_PLANAR Add edges to construct a biconnected planar graph
%
% M = make_biconnected_planar(A) generates a new graph M with additional edges
% to make M biconnected. A biconnected planar graph stays connected even
% if any edge is removed.
%
% [ei... |
49d368d44e94ecd20b388d5ab49107e62351ddba9909e4c25a2adb4f6179123d | MATLAB | 1,426 | 31 | %% Replay candidate generation
% This section generates synthetic synchronous events (replay candidates)
% by randomly sampling spikes from a single trial.
n_ne_sync_e = 10; % number of neurons in each synchronous event
n_sync_e = 1; % number of replay candidates
c_dt_sync_e = 200; % durati... |
af809a6c52b939dbf58006d92b3be58645228625f184ca658480cc18adfeab90 | MATLAB | 1,426 | 45 | function perm=topological_order(A,varargin)
% TOPOLOGICAL_ORDER Returns the topological ordering of vertices in a dag
%
% perm=topological_order(A) generates a permutation of the vertices that
% indices a topological order. A topological order satisfies the property
% that edge (i,j) in A implies i comes before j in t... |
d818f3f2d0ec4dd2eaa3f8892b5da0cba444f995218604a0987c395421209a6f | MATLAB | 1,426 | 38 | function [funcMatrix_ctx, funcLabels_ctx, funcMatrix_sctx, funcLabels_sctx] = load_fc(parcellation)
%
% Usage:
% [funcMatrix_ctx, funcLabels_ctx, funcMatrix_sctx, funcLabels_sctx] = load_fc(parcellation)
%
% Description:
% Load functional connectivity data (author: @saratheriver)
%
% Inputs:
% parcellation (stri... |
805afbf2a49f429e99a6d905da0d9e3cf4f56811761fed8d087595cfb96ac2fb | MATLAB | 1,427 | 45 | function sout = cvx_profile( flag )
% CVX_PROFILE CVX-specific profiler control.
% This is a function used for internal CVX development to help determine
% performance limits within the CVX code itself, by turning off the profiler
% when the solver is being called. End users will likely not find this
%... |
8734882a63177179effe9df6f22c35dfb554d0637e2513f5218183d93c763e7e | MATLAB | 1,427 | 46 | %%*********************************************************************
%% chebymat: compute the Chebyshev polynomial of
%% deg m of a matrix B.
%%
%% [blk,Avec,C,b,X0,y0,Z0,objval,p] = chebymat(B,m,feas,solve);
%%
%% B = a square matrix.
%% m = degree of polynomial.
%% feas = 1 if want feasible s... |
df6033e3f711037c7aa1da587380fb4e1f815f0389b73e8e42e2fbfa11bd39c9 | MATLAB | 1,427 | 51 | function [k k0] = circ_kurtosis(alpha, w, dim)
% [k k0] = circ_kurtosis(alpha,w,dim)
% Calculates a measure of angular kurtosis.
%
% Input:
% alpha sample of angles
% [w weightings in case of binned angle data]
% [dim statistic computed along this dimension, 1]
%
% If dim ... |
815098c3eb0201b7809d144e7d49c901e061408c7ef7eb179d9395169f956b9f | MATLAB | 1,428 | 42 | function ea_explorer_cleanfigure(obj)
%% remove existing streamlines
if isempty(obj.drawnstreamlines) % check if prior object has been stored
if isprop(obj.resultfig,['dt_',obj.ID])
obj.drawnstreamlines=getappdata(obj.resultfig,['dt_',obj.ID]); % store handle of tract to figure.
end
end
for i=1:nume... |
edcc2dc3beab638162269c8fa8acb064db9b68303dae2e48fb1c2d29c0ac8640 | MATLAB | 1,428 | 54 | function out = bz_ReadAmplipexMetafileAspects(fname,desired)
if ~strcmp(fname(end-4:end),'.meta')
fname = [fname, '.meta'];
end
switch lower(desired)
case 'amplituderangemax'
searchstring = 'Amplitude range max';
startextractchar = 22;
case 'amplituderangemin'
searchstring = 'Ampli... |
063587c9bdde7ee5bc7c51e2cd1324f62b9d94c052eecc2ece159eded345eb10 | MATLAB | 1,430 | 46 | function varargout = xml2mat(xmlfile, matfile)
%XML2MAT Convert an XML-file into a MAT-file
% XML2MAT(XMLFILE, MATFILE) converts an XML file or an XML string
% (as saved by MAT2XML) into a MAT-file MATFILE.
% S = XML2MAT(XMLFILE) returns the content of XMLFILE in variable S.
% S is a struct containing fields m... |
4177d65a3dfe5a030e9d96d642ba3396d567fb59c52855ec08e860598dffe511 | MATLAB | 1,431 | 56 | function [mu ul ll] = circ_mean(alpha, w, dim)
%
% mu = circ_mean(alpha, w)
% Computes the mean direction for circular data.
%
% Input:
% alpha sample of angles in radians
% [w weightings in case of binned angle data]
% [dim compute along this dimension, default is 1]
%
% If dim argument... |
a1096404aec2f7a730738577841c48de75830d366c25b1150653cd5f8f6f3af4 | MATLAB | 1,432 | 20 | % Circuit design
% <a href="http://stanford.edu/~boyd/papers/rc.html">Optimizing Dominant Time Constant in RC Circuits</a>
% <a href="http://stanford.edu/~boyd/papers/rc_iccad.html">Optimal Wire and Transistor Sizing for Circuits with Non-Tree Topology</a>
% <a href="http://stanford.edu/~boyd/papers/date05.html">Geomet... |
ff672a6c387efbadbceb2d982239318db599c551449a722df9a71dec1820990d | MATLAB | 1,432 | 37 | function Smooth_cost = CBIG_hMRF_initialize_homotopic_smoothcost_mat(num_cluster_per_hemi, d)
% Smooth_cost = CBIG_hMRF_initialize_homotopic_smoothcost_mat(num_cluster_per_hemi, d)
%
% This function initializes smoothcost matrix with 0 entries for the main diagonal
% and sub-diagonals between hemispheres.
% For exampl... |
08446f644376c33e0eb4dcd10310543cf985c61aff7d64c56607322a9138615b | MATLAB | 1,433 | 41 | function icn_color=ea_get_icn(varargin)
% This simple function reads in the image files for the Icons of the
% UItoolbar of eAuto-DBS.
% __________________________________________________________________________________
% Copyright (C) 2014 Charite University Medicine Berlin, Movement Disorders Unit
% Andreas Horn
swit... |
41410409d19cd04ca2a4110ff9af3eee1225a5432f886882bb00df2ab46d4054 | MATLAB | 1,433 | 48 | function V = LinearVelocity(X,smooth)
%LinearVelocity - Compute instantaneous linear velocity.
%
% Compute linear velocity for a time-varying vector X.
%
% USAGE
%
% V = LinearVelocity(X,smooth)
%
% X the time-varying vector given as a list of triplets [t x y]
% smooth optiona... |
f081749c0e65718f4c24b621c7ef482864bcdd3cc430d4a1bffce98a3318f41e | MATLAB | 1,433 | 36 | function cvx_optpnt = hermitian_semidefinite( n )
%HERMITIAN_SEMIDEFINITE Complex Hermitian positive semidefinite matrices.
% HERMITIAN_SEMIDEFINITE(N), where N is an integer, creates a complex
% Hermitian matrix variable of size [N,N] and constrains it to be
% positive semidefinite. Therefore, given the ... |
19e6149b3a2d10561b8bbac2236041d55b1357440ca25c15f3016df23432dc4a | MATLAB | 1,434 | 56 | function [mu ul ll] = circ_mean(alpha, w, dim)
%
% mu = circ_mean(alpha, w)
% Computes the mean direction for circular data.
%
% Input:
% alpha sample of angles in radians
% [w weightings in case of binned angle data]
% [dim compute along this dimension, default is 1]
%
% If dim argument... |
60f52d0b565b8000cee6737e2828955a056edaafec10c3c8c17f15bf3126a511 | MATLAB | 1,434 | 36 | function saveash5(data, path_to_file, options)
% save the variable stored in data in a h5 file named path_to_file (includes the
% path to the directory). The file is saved with the same class as data.
% options.groupname: the name of the group (default: /mov)
% options.append: append to existing file if it exists (def... |
c41616d4f1c805376c5d2fca5c4cbe586b05b09927e547ea0d5ae58245e9243c | MATLAB | 1,434 | 54 | function [ behavior,filename ] = bz_LoadBehavior( basePath,behaviorName )
%[ behavior,filename ] = bz_LoadBehavior( basePath,behaviorName ) function for
%loading behavior.mat files.
%
%
%DLevenstein 2017
%%
if ~exist('basePath','var')
basePath = pwd;
end
baseName = bz_BasenameFromBasepath(basePath);
if ~exist('be... |
4d64b982c0ff09e4e2995b47c5a2d272377994c5c82cec2d756083688338d4d1 | MATLAB | 1,435 | 70 | function [node,elem]=readoff(fname)
%
% [node,elem]=readoff(fname)
%
% read Geomview Object File Format (OFF)
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2008/03/28
%
% input:
% fname: name of the OFF data file
%
% output:
% node: node coordinates of the mesh
% elem: list of elements of the mesh ... |
c3f91f4800a0af1926b76ccde51d35aa4e1822f3bf86bd310f6f013d9c77fe9d | MATLAB | 1,435 | 36 | function soSummary = sosum(so, srate, samples)
% Summarize slow oscillation features. Calculates slow oscillation density
% (so/min) and gets average value of slow oscillation features on each channel
%
% Required inputs:
%
% so: A structure containing slow oscillation data (output of
% fun_slow_oscillationss)
%
% srat... |
23c2166da0521686848927288633ee768d69adedbebf5bbb5b995eee7ee6d7d7 | MATLAB | 1,436 | 50 | function [o]=sumsq(x,DIM)
% SUMSQ calculates the sum of squares.
%
% [y] = sumsq(x [, DIM])
%
% DIM dimension
% N STD of N-th dimension
% default or []: first DIMENSION, with more than 1 element
%
% y estimated standard deviation
%
% features:
% - can deal with NaN's (missing values)
% - dimension argument also i... |
7b7aecbe26a2ea9db7f76f7436c65230f0c9ee66042aa6ce1bca175cf5631296 | MATLAB | 1,436 | 46 | function templateDuration_us = computeTemplateWaveformDuration(thisWaveform,...
ephys_sample_rate)
% minProminence = 0.2 * max(abs(squeeze(thisWaveform)));
%
% [PKS, LOCS] = findpeaks(squeeze(thisWaveform), 'MinPeakProminence', minProminence);
% [TRS, LOCST] = findpeaks(squeeze(thisWaveform)*-1, '... |
a9bea1bd6c0d11c24a4fe520492bda1c2e1fa1b7ccea0e5963580b776faa0151 | MATLAB | 1,436 | 54 | function [urlConnection,errorid,errormsg] = urlreadwrite(fcn,urlChar)
%URLREADWRITE A helper function for URLREAD and URLWRITE.
% Matthew J. Simoneau, June 2005
% Copyright 1984-2011 The MathWorks, Inc.
% $Revision: 1.1.6.7 $ $Date: 2011/10/22 22:05:21 $
% Default output arguments.
urlConnection = [];
errorid =... |
6b30112ee8c5702d7509807878c281b430742050ca76dffeb88d63233ab4f207 | MATLAB | 1,437 | 33 | function [mu_cond,sigma_cond] = condMVN(mu,sigma,x2,cond_idx)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically relevant behaviors of the ecosystems.
% Copyright (C... |
7a085957c94a9d350fd17788b469917edaa072a37a01ffb89fa23ec873119a34 | MATLAB | 1,437 | 42 | %% Entropy Demo 1
% This demo goes through calculating the entropy for time locked trials
% from a single continuous time series.
% Data Type: Continuous
% Number of Variables: 1
% Information Analysis: Entropy
% Trial Based or Single Trial: Trial Based
% Significance Testing: N/A
% Delays: N/A
% Generate the data
n... |
19c47f28a5638d6e23e34198cca86e9cba3b98325eab2e109b8d21e5d010c223 | MATLAB | 1,439 | 55 | function formatPDFAreas(minVal, maxVal, metricField)
% Format PDFs of metric values
% Get xLabel
switch metricField
case 'duration'
xLabel = 'FWHM (ms)';
case 'sharpness'
xLabel = 'tuning sharpness (a.u.)';
case 'linearity'
xLabel = 'target tuning linearity (r^{2})';
case 'persi... |
4e91bfe124e2204812447313052d253184b463605c6813f17d1ee25ba40fb592 | MATLAB | 1,439 | 41 | function [HBO, HBD] = od_to_hb(dOD_hp, nCh, DPF760, DPF850, dist_ch, coeffs)
%NIRSPROC.OD_TO_HB Convert ΔOD (two wavelengths) to HbO/HbR time series.
% [HBO, HBD] = NIRSPROC.OD_TO_HB(dOD_hp, nCh, DPF760, DPF850, dist_ch, coeffs)
%
% Inputs
% dOD_hp : T×(2*nCh) matrix, high-passed ΔOD (760 then 850 columns)
... |
4682c22e255f70be885cd1fe16d651c3249ea1dfc44aa47b49aaaaac7ca48565 | MATLAB | 1,440 | 30 | function [J,Msp,Nsp]=mtfftpb(data,tapers,nfft)
% Multi-taper fourier transform - binned point process data
%
% Usage:
%
% [J,Msp,Nsp]=mtfftpb(data,tapers,nfft) - all arguments required
% Input:
% data (in form samples x channels/trials or single vector)
% tapers (precalculated tapers from dpss) ... |
aecedd7f6b9436dd7e178a75ae793269f0b164246611f95c7031a5443c34ba31 | MATLAB | 1,441 | 41 | function V = position_mod_LE(V, box_size, strain)
% POSITION_MOD_LE Wrap vertex positions back into the primary simulation
% box under Lees-Edwards (sheared) periodic boundary conditions.
%
% V = POSITION_MOD_LE(V, box_size, strain) wraps y-coordinates into
% [0, box_size) normally, and wraps x-coordinates into [0... |
bd83518f2e21eae34df4fb16c08b235ea1e0e21d6fc57fa6ee665f7728d58852 | MATLAB | 1,441 | 37 | function CBIG_IndCBM_check_replication_results(output_dir)
% CBIG_IndCBM_check_replication_results(output_dir)
%
% This function checks if the replication results are identical with the
% reference files.
%
% Input:
% - output_dir: The output directory with generated replication results.
%
% Written by XUE Aihuipi... |
35a1f25fab26c4b5b08ef0d4dcc19b498ca8e901ee24d6ce4fb41efc5f8d9b74 | MATLAB | 1,442 | 48 | %%********************************************************************
%% igmres: compute ideal GMRES polynomial of deg m
%% of a matrix B.
%%
%% min || p(B) ||_2
%% where p is a polynomial of degree <= m and p(0) = 1.
%%
%% B = a general square matrix.
%%---------------------------------------------... |
390ccf75a7c79d1813b76ea089336de16573375221f1d47e8a015dd6dcf687cc | MATLAB | 1,442 | 54 | % Finding a point that satisfies many linear inequalities
% Section 11.4.1, Boyd & Vandenberghe "Convex Optimization"
% Written for CVX by Almir Mutapcic - 02/18/06
%
% We consider a set of linear inequalities A*x <= b which are
% infeasible. Here A is a matrix in R^(m-by-n) and b belongs
% to R^m. We apply a heuristic... |
71d54f23ca1105292c69a6f3a12739fca66889c03eddbc4f97182b2793b3d823 | MATLAB | 1,442 | 53 | % Separating ellipsoids in 2D
% Joelle Skaf - 11/06/05
% (a figure is generated)
%
% Finds a separating hyperplane between 2 ellipsoids {x| ||Ax+b||^2<=1} and
% {y | ||Cy + d||^2 <=1} by solving the following problem and using its
% dual variables:
% minimize ||w||
% s.t. ||Ax + b|... |
cca678b8824cd601758a51bf54f0638f3b4ae09ee71382cdd5ea5f33c05737b6 | MATLAB | 1,442 | 55 | function stageOUT = danalyzer2bids(stageIN)
% Convert a danalyzer sleep scores file to a format compatible for BIDS
onset = stageIN.hdr.stageTime;
if isempty(onset)
onset = 0:stageIN.hdr.win:stageIN.hdr.win*length(stageIN.stages)-1;
end
onset = onset';
duration = repmat(stageIN.hdr.win, length(onset), 1);
sampl... |
36c5508e775ac0822678448af03a73233cfa523bfd347cba685537d9b3fff7c2 | MATLAB | 1,443 | 47 | function cvx_setspath
%CVX_SETSPATH Sets the cvx solver path.
% CVX_SETSPATH adds the internal cvx solver directories to Matlab's path
% so that the CVX system can find the functions that they contain. There
% is no reason to call this function during normal use of CVX; it is done
% automatically as needed.... |
19a096cdace2e3176fbc0e827f335819575d25d4bed00bce4fc70d4b7b339a96 | MATLAB | 1,444 | 59 | function [s s0] = circ_std(alpha, w, d, dim)
% s = circ_std(alpha, w, d, dim)
% Computes circular standard deviation for circular data
% (equ. 26.20, Zar).
%
% Input:
% alpha sample of angles in radians
% [w weightings in case of binned angle data]
% [d spacing of bin centers for binned data, ... |
13d094bd1c7ed4678c4cf61219bdfc47aed2df2c73a25ddf759d5247e20884ae | MATLAB | 1,445 | 50 | function outpoints = icbm_other2tal(inpoints)
%
% This function converts coordinates from MNI space (normalized
% using templates other than those contained in SPM and FSL) to
% Talairach space using the icbm2tal transform developed and
% validated by Jack Lancaster at the Research Imaging Center in
% San Antonio, ... |
717885e8da14360c4d13bc7808f7e6e6a79a0e601ee5509f9cdb75f14f33265b | MATLAB | 1,445 | 27 | %WhiskerP.mat
%% whisker pericyte means for trace
mean_rr1a_micronsWsm=mean(all_rr1a_micronsW,2);
mean_rr1aSEM_micronsWs=mean(all_rr1nSEM_micronsW,2);
mean_rr1a_percentW=mean(all_rr1a_percentW,2);
mean_rr1aSEM_percentW=mean(all_rr1nSEM_percentW,2);
mean_rr2a_micronsW=mean(all_rr2a_micronsW,2);
mean_rr2aSEM_micronsW=m... |
7d905a3f995342cf9cc80dbb119ca7a48732d8f54327ff5a58844827b11e543a | MATLAB | 1,447 | 54 | function plotmany(x,y_vec,nmax,newaxis)
% Usage ... plotmany(x,y_vec,nmax,axis)
if nargin==1, y_vec=x; x=[1:size(y_vec,1)]'; end;
if nargin==2, if length(y_vec)==4, newaxis=y_vec; y_vec=x; x=[1:size(y_vec,1)]'; end; end;
if ~exist('nmax'), nmax=[]; end;
if ~exist('newaxis'), newaxis=[]; end;
ydim=size(y_vec);
if is... |
d6a0e3d88d4f7f44f7b3187399aaffca4d9b0e55733f34e13155270e75f73f47 | MATLAB | 1,447 | 34 | function SANDIinput = AnalyseAllDatasets_forGUI(SANDIinput, fig_axes)
StudyMainFolder = fullfile(SANDIinput.StudyMainFolder,'derivatives','SANDI_analysis');
PreprocMainFolder = fullfile(SANDIinput.StudyMainFolder,'derivatives','preprocessed');
SubList = dir(fullfile(StudyMainFolder,'sub-*'));
SANDIinput.DatasetList =... |
53dff223e82ef002a8a1e2d2f155d8e4a0e244eaab88e6a4624facdf5a22d9b0 | MATLAB | 1,448 | 39 | %% © 2021 Dan Denis, PhD
%
% This function is part of the danalyzer toolbox. danalyzer 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 3 of the License or any later version.
%
% danalyzer is d... |
5f7debb8700219ed8c434acb44f6559f6bf82915c23e0c0cd57ebdcefc0c7547 | MATLAB | 1,448 | 71 | function [yy,msk,yrp,dd]=getRectImGrid(im1,rw,dx,ctr,ang)
% Usage ... [y,msk]=getRectImGrid(im,rw,dx,ctr,ang)
if isstruct(rw),
rmsk=rw;
clear rw
rw=rmsk.rw;
dx=rmsk.dxy;
ctr=rmsk.aloc;
ang=rmsk.ang;
end;
skip_flag=1;
check_flag=0;
if nargout>2, check_flag=1; end;
if length(dx)==1, dx(2)=dx(1); end;
dim=... |
6e433c7a050bd953f77a52a779b0750b4e8afe307e4b0fbef2f20a836a217093 | MATLAB | 1,448 | 27 | function a = gt( x, y )
%Disciplined convex programming information for GT (>):
% The right-hand side of a less-than constraint must be convex. The
% left-hand side must be concave. Of course, real constant and affine
% expressions are both convex and concave and can be used on either
% side as well.
%
%Discip... |
d5521bbf3fa5a014d55f87588c7989e988a6ea47c81af7253c089a2519809515 | MATLAB | 1,448 | 32 | accuracyData = num_lengthAccuracy;
weights = 10:10:100;
plot(weights,accuracyData(1,:)*100,'LineWidth',1.5,'Color','k','LineStyle','-','Marker','s','Color',[0 0.4470 0.7410])
hold on
plot(weights,accuracyData(2,:)*100,'LineWidth',1.5,'Color','k','LineStyle','-.','Marker','o','Color',[0.9290 0.6940 0.1250])
hold on
plo... |
9d9bd9dba1cf6a44e25c6220260a55666330755859cbf59839f10dd6ba074de6 | MATLAB | 1,449 | 33 | function [handles, RegPara] = callregistration(handles)
for k = 1:length(handles.Datalist)
clear RegPara
para_default = defaultparameter;
RegPara = para_default.RegPara;
RegPara.savepath = handles.savepath;
RegPara.useGPU = handles.useGPU; % if you can use a GPU in mat... |
e2baaea2fdbc8c8234dd8ccecf7795fd71fbb232b2f6c3579193ef2d15766fb4 | MATLAB | 1,449 | 55 | function formatPDFSubpops(minVal, maxVal, metricField)
% Format PDFs of metric values
% Get xLabel
switch metricField
case 'duration'
xLabel = 'response duration (ms)';
case 'sharpness'
xLabel = 'tuning sharpness (a.u.)';
case 'linearity'
xLabel = 'target tuning linearity (r^{2})';
... |
fb06ac951f0fbb9fb32ac4b71cdb23b2042344122a3d8f50a2f3d02d0129c7da | MATLAB | 1,449 | 45 | % reshape() - reshape of memory mapped underlying array
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% 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 ... |
e7b392cc59f7cf938460dec2914a1c529dc03be5d2ee6446b00cfa667c1c4b34 | MATLAB | 1,450 | 51 | function y = ExtendArray(x,s,fill)
%ExtendArray - Extend existing array to a given (larger) size.
%
% USAGE
%
% y = ExtendArray(x,s)
%
% x input array
% s output size, must have the same number of dimensions as x
% fill optional value for new elements (default: nan)
%
... |
9ca065980fc01250cb0e18e8ebb29036f97a846ed5b48686e14b3d5d2db655a3 | MATLAB | 1,451 | 55 | function formatPDFComponents(minVal, maxVal, metricField)
% Format PDFs of metric values
% Get xLabel
switch metricField
case 'duration'
xLabel = 'response duration (ms)';
case 'sharpness'
xLabel = 'tuning sharpness (a.u.)';
case 'linearity'
xLabel = 'target tuning linearity (r^{2})... |
1f7ebbfe22bc0eccf9419cd655a5337b091d242110e1266ccd0de10a10adfcd0 | MATLAB | 1,452 | 68 | function [h px py] = IcsiStat(rgx,rgy,icsi,tR,tC,tMax)
% USAGE:
% [h px py] = IcsiStat(rgx,rgy,icsi,tR,tC,tMax)
%
% IcsiStat computes some statistics on the common inter-spike interval
% (based on Fee et al., 1996)
% INPUTs:
% rgx: 1st spike train
% rgy: 2nd spike train
% icsi: common isi comted with... |
4827ed84e9a50592f4f4ddc6e51d2289a1e73f1ab15e7bd4ff186efc201bc770 | MATLAB | 1,453 | 45 | function cleanx = CleanData(x, rnge, choice, epsilon);
%CLEANDATA
% Usage:
% cleanx = CleanData(x, rnge, choice, epsilon);
%
% This function will take in a data set x, a specific portion of that data,
% rnge, and look for any points below (choice = 'below') or above (
% (choice = 'above') the threshold epsilon. ... |
5af39bd14a84f0bbfe8dc2809de81c1478d0264fd966893a5d357c8185bdb2ab | MATLAB | 1,453 | 29 | function rid_prob_reorder = CBIG_MMLDA_get_factor_loadings(rid_file, inf_gamma_file, order)
% rid_prob_reorder = CBIG_MMLDA_get_factor_loadings(rid_file, inf_gamma_file, order)
%
% Get reordered factor loadings based on rid file, inferred gamma file and the order of factors.
%
% Input:
% - rid_file : rid file na... |
916515118a9d68cc131604c6fabe4b41f75d56406e774d1d439c3f5a62010b77 | MATLAB | 1,453 | 44 | function [AE] = ent_ap( data, dim, r )
%ent_ap
% data : time-series data
% dim : embedded dimension
% r : tolerance (typically 0.2)
%
% Changes in version 1
% Ver 0 had a minor error in the final step of calculating ApEn
% because it took logarithm after summation of phi's.
% In Ver 1, I resto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.