sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
eda4c25c780cf82ce5fd333d51140587f5ddb216d96334d7ed8e76f065f32b40 | MATLAB | 2,643 | 64 | mainfolderlist = {'1_1s';'2_2s5';'3_5s';'4_10s'};
mainfolder = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Probability Score/1_Results/0_Final Results/Results_';
resultfolder = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Pro... |
2ee927889bb6f37ba515bfb9c4da7cba27702bb10e6bd370ae6b2f7e7af8cb38 | MATLAB | 2,644 | 85 | %%*******************************************************************
%% HSDHKMpred: Compute (dX,dy,dZ) for the H..K..M direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******************************************************************
f... |
fc60caefe62e06ca095248983934fc1989c5b292a2692b1eb9e2fa46f8bd284c | MATLAB | 2,644 | 129 | %%%%%%%%%%%%%%%%%%%
%% Zicheng Yang @CCMU
%% Version1:Yzc 2023-07-28 plot hit, fal, correct rate
%%
%%%%%%%%%%%%%%%%%%%
clear all;
close all;
% load files-
actfile = '/.xlsx';
% parameters
Fs = 100;
Ts = 1/Fs;
correctCue = 2;
pre_time = 3;
trial_time = 15;
ntrialpersess = 20;
isoneodorcase = ... |
1f2d05d31d28946ca227229ef6d428f3e99539a78686da316dbaa305d2ca4202 | MATLAB | 2,646 | 62 | function apref = ea_antspreset_effective_midvar(cmd)
if ischar(cmd) % 'query' mode, return the name of the preset
apref = 'Effective: Mid Variance';
return
end
normsettings = cmd; % cmd is the 'normsettings' struct
switch normsettings.ants_metric
case 'Mutual Information'
apref.metric='MI';
... |
404028cda6a11b3344d72d7e4984b8ab174e65f0dda09cb370d523bc0621977a | MATLAB | 2,646 | 70 | function cleaned = RemoveArtefacts(lfp,times,varargin)
%RemoveArtefacts - Remove artefacts from local field potentials.
%
% Remove large deflections such as stimulation artefacts from local field
% potentials, i.e. flatten the data around the times of artefacts.
%
% USAGE
%
% cleaned = RemoveArtefacts(lfp,times,<o... |
cdb386ba08229cc19fabede29f38ea27aac6f7f548a5e5cb1b641808ed4f6371 | MATLAB | 2,647 | 95 | function [y,ys]=selectMask(im,pos_flag)
% Usage ... [y,ys]=selectMask(im,pos_flag)
if nargin==1, pos_flag=1; end;
if pos_flag<=0, pos_flag=0; end;
y=ones(size(im));
mask=ones(size(im));
im1=im;
smw=[];
thr=[];
hcf=[];
tmpok=0;
while(~tmpok),
clf,
subplot(121), show(im1),
subplot(122), show(y... |
cd72ffea1c5a9ccd258a20156497b0d5f0bb26264c8c134898ac36ebe64e2062 | MATLAB | 2,648 | 75 | function pvals = stat_surrogate_pvals(distribution,observed,tail)
% compute empirical p-vals under the null hypothesis that observed samples
% come from a given surrogate distribution. P-values for Type I error in
% rejecting the null hypothesis are obtained by finding the proportion of
% samples in the distribution th... |
9fde22a9d285020b9e2eb62307019f9afa238fe0fbfd5e714d9ff2eb070f14b6 | MATLAB | 2,650 | 79 | function CBIG_pMFM_STDFCD_lowGS()
% This function is used to generate the SWSTD FCD correlation with 50 runs
% with lowest gloable signal
%
% There is no output for this function as it will generate the output files
% which will be used as input for next step
%
% Args:
% emp_tc_dir: Directory contains empirical fMR... |
b7a623f3fb700a8f3cdbc9caa5898d03bd089c36a7fa5a34bd2e9dd5841a9ceb | MATLAB | 2,650 | 126 | function [res ftr] = ftr2FDmaps(ftr,M)
if isstr(ftr),
ftr = load(ftr);
end;
if not(exist('M')),
M = 1;
end;
sz = size(ftr.user.S2(:,:,:,1));
idx = 1:length(ftr.curveSegCell);
idx = idx(cellfun(@length,ftr.curveSegCell(idx))>1);
if isempty(idx)
res = [];
return;
end;
vox = ftr.vox;
t = 3;
nc = cel... |
dd807b6d0365eda1b4ef43b1b03338f22b38187ffc23867f82b983e214299b11 | MATLAB | 2,650 | 92 | function plotGMMDistances(dists, subpopGMMs, distMax)
% Plots a distance matrix from the area-specific GMM clustering, with the
% blocks outlined
if nargin < 3
distMax = 2;
end
% Create figure
fig;
axis image;
axis off;
set(gca, 'YDir', 'reverse')
set(gca, 'Box', 'off')
set(gca, 'FontSize', 6);
set(gca, 'TickLeng... |
e03eb1111fda31897eb8522e4e403e5059b2ec05abea647100fadc601f2dc602 | MATLAB | 2,651 | 29 | function [p] = make_Ascii(p, subnr, setupmode)
% [p,s] = make_Ascii(p,s)
% converts freesurfer surface info files into ascii using Freesurfer's mris_convert
%
% p = structure with path/file information as defined in "run_PRF.m"
% subnr = index of current subject analysed
%
% Created : "2015-03-16 14:42:38 TDek... |
6e2597129b9192cb8a3e49599be0bcd4e3bf8ffbaa04338b429f04841871de5a | MATLAB | 2,654 | 85 | function data = AFOFdata_struct(inputdata, filenames)
% USE THIS FOR EXP1 (CEM)
% how it works:
% fly = AFOFdata_struct(data,filenames) where data and filenames are
% outputs from rotoball_importer()
for e = 1:length(inputdata)
for t = 1:length(inputdata{e}{1})
trial.filename = filenames{e};
%... |
268b68cb5153ededdb32d6e70609d48b46092c1156cf8b7f463b3399f706adf1 | MATLAB | 2,655 | 80 | % DECODE convert TOML to native MATLAB datatypes
%
% DECODE(toml_str) returns the MATLAB representation of the
% TOML-formatted data in `toml_str`. If it is invalid TOML, an
% appropriate exception will be raised.
%
% See also TOML.READ
function obj_out = decode(toml_str)
%% pre-emptive checking
% split on n... |
36c6747cafed2ec54de26df775a0f3817358e077c2f28abe03c1bbe1ec4f7aa5 | MATLAB | 2,659 | 118 | %MRSTRUCT_READ read mrStruct from file.
% mrStruct = mrstruct_read(fileStr)
%
% If nargin=0 or the file does not exists, a gui will prompt for user input.
% 'mrStruct': MR-Structure, which will be [] in case of error.
%
% Examples:
% mrStruct = mrstruct_read('c:\test\myMrStruct');
%
% Harald Fischer
% ... |
a8becde504f0dcd554e4659306785249788aa7adf42c4ad86e7e78f5f343a5c6 | MATLAB | 2,661 | 72 | %% RUN_FORWARD_MODEL_STEP (combined + cleaned)
% - Loads head mesh + NIRx montage (Standard_probeInfo.mat)
% - Runs NIRFASTer forward model + saves outputs
% - Uses fnirspower.paths() for consistent project paths
import fnirspower.*
P = fnirspower.setup_paths();
%% ---------------------- User inputs -----... |
65366588cce1a86793a3ac70915be7f7e5482d997e7bb3b9b0a8d691ddaa278d | MATLAB | 2,662 | 85 | function varargout = palm_configrw(varargin)
% Read and write PALM configuration files.
%
% Usage:
% cfg = palm_configrw(fname)
% palm_configrw(cfg,fname)
%
% cfg : Configurations (cell array).
% fname : Text-file with the configurations.
%
% _____________________________________
% Anderson M. Winkler
% FMRIB / Un... |
7a499a02be89c97bfa616c6400107ae1c7f93e25291f11bff64e1152ff64056d | MATLAB | 2,662 | 71 | function d=edit_distance_weighted_keylist(s,t,weight_delete,weight_insert,weight_replace)
% Calculate a weighted edit distance for cell arrays of (string)
% keys,, e.g.
% edit_distance_levenshtein_keylist({'the','quick','brown','fox'},{'the','lazy','dog'})
%
% @author B. Schauerte <schauerte@ieee.org>
% ... |
fa0749bcba4c5ee14389ffbf7aaff0e3bd4f739ad33f5d15d3c238e70cbb1582 | MATLAB | 2,662 | 56 | function DataSimulation_GUI
% Fetch the B0 field strength, TR, TE, Flip Angle, and anisotropy values from the base workspace
B0 = evalin('base', 'B0');
anisotropy = evalin('base', 'anisotropy');
TR = evalin('base', 'TR')/1000; % Fetch TR from the GUI
% Dynamically fetch all TEs based on the nu... |
a0627a5968e54ed7335d1cad037012bda7fbccf204a4427a2b582d79f688e556 | MATLAB | 2,664 | 92 | function PlotPhaseDistribution(dist,angles,stats)
%PlotPhaseDistribution - Plot phase distribution.
%
% Plot one or more phase distributions as histograms and polar plots
% showing circular mean and resultant length. Dotted vectors indicate
% that the data is not significantly clustered around a single peak
% (Ray... |
28806d111c07d21107311eec7416477fbc40be0958030bfaba5dd382655a591f | MATLAB | 2,665 | 106 | %% B_SpikeVectorStrength_Statistic.m
% Need to run "A_SpikeVectorStrength_plot.m" first
%%%%%% Version history %%%%%%
% v1 : 12/20/2022
% - first released
% - extract vector strength by frequency range
clear all; close all;
%% Parameters
path2raw = pwd;
rw1 = 7; % first reward condition to compare
rw2 =... |
628055314a25e884d02bc80b3ed64c94c6caec07d4f7a3d8136efac80b75e51a | MATLAB | 2,665 | 63 | function apref = ea_antspreset_effective_highvar(cmd)
if ischar(cmd) % 'query' mode, return the name of the preset
apref = 'Effective: High Variance';
return
end
normsettings = cmd; % cmd is the 'normsettings' struct
switch normsettings.ants_metric
case 'Mutual Information'
apref.metric='MI';
... |
19bd2f0814b334514fa76ed8488c124e0f010409afdbf380c6d14f3407218ae4 | MATLAB | 2,666 | 79 | %%*******************************************************************
%% HSDHKMrhsfun: compute the right-hand side vector of the
%% Schur complement equation for the HKM direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****... |
42f99cc23351e2b500d90ef0213f28c9b91506704b05d1814cb3051f4da71a3c | MATLAB | 2,666 | 62 | % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
addpath(spm_dir)
% read id list
fid=fopen(id_list);
rid=textscan(fid,'%s');
fclose(fid);
rid=rid{1,1};
num_img=length(rid);
% create inputs
inputs = cell(1, 2);
for i = 1:num_img
gm_file=[output_dir '... |
e3fc9127ffa6b1202bf7b272794a81c0da1dc8483c4674b11ef2605c97bea5e1 | MATLAB | 2,666 | 67 | % 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... |
2654cce1414a1c8579bcc5335279f6562ba774eb1bc8ee7c16d05ec989c7e82e | MATLAB | 2,667 | 56 | % 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... |
56aac27f2624e98dd23cf7e21576091dfd8265d51b2f75763689a415f9840baf | MATLAB | 2,667 | 64 | % eegplugin_firfilt() - EEGLAB plugin for filtering data using linear-
% phase FIR filters
%
% Usage:
% >> eegplugin_firfilt(fig, trystrs, catchstrs);
%
% Inputs:
% fig - [integer] EEGLAB figure
% trystrs - [struct] "try" strings for menu callbacks.
% catchstrs - [struct] "catc... |
b12326c2dda1a22873a33653b5db1d7d445989b9556fece0c05642fd97a6553b | MATLAB | 2,667 | 75 | % uigetfile2() - same as uigetfile but remember folder location.
%
% Usage: >> uigetfile2(...)
%
% Inputs: Same as uigetfile
%
% Author: Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004
% Thanks to input from Bas Kortmann
%
% Copyright (C) Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004... |
e97d494cb2e5182f44c1e7ad9cd9e85eb917a01cb0d3f09ee01ff62918a075f9 | MATLAB | 2,668 | 75 | function cx = connectMatrix( dims , lx , inter_type , intra_type , cyclic_type )
% inter_type :
% 1 => only neighbor
% 2 => everywhere inter-scale on consecutive scales
% intra_type :
% 1 => only neighbor
% 2 => connect to everynode on same scale
% cyclic_type
% 1 => cyclic boundary rules
% 2 => ... |
898e9a2ee9fe12cf26aacb75055b6861c75e1ef8523d81370c80f1b1b6d11828 | MATLAB | 2,669 | 57 | % 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... |
a9b233a0f344615e68279b059c4b5959af0c4ae4aa5362bc80c655b26a4a2669 | MATLAB | 2,669 | 101 | function [RES]= sim_computeGeneralizedLV_Derivatives_ImplicitForm(t,F,Fp,struct)
% 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.... |
8cab8faa0e9002587f9338e3537816bf5799c4b45378e5b98c16e2f3831cc560 | MATLAB | 2,670 | 76 | function [p_perm, null_dist] = perm_sphere_p(x, y, perm_id, corr_type)
%
% Usage:
% [p_perm, null_dist] = perm_sphere_p(x, y, perm_id, corr_type)
%
% Description:
% Generate a p-value for the spatial correlation between two parcellated
% cortical surface maps (authors: @frantisekvasa, @saratheriver)
%
% Input... |
e933de3e945bef8e78ebf684569d87b3844b6028e51831beccf7a90443de1804 | MATLAB | 2,670 | 85 | function [uniqueBases, sharedBasis,clusterBases,ev_cumsum] = extractUniqueBases(X, labels, varargin)
% INPUT:
% - X: D x N data matrix
% - labels: N x 1 cluster labels
% - Optional: 'Rank' or 'EnergyThreshold' to control basis selection per cluster
% OUTPUT:
% - uniqueBases: 1 x K cell array of unique basis mat... |
8d21c19be14b2f0c2f557e26b4ddcf7ff95cc9d3ce17216380f883d3fd0505cd | MATLAB | 2,671 | 64 | function cifti = cifti_struct_dense_replace_volume_structure_data(cifti, data, structure, cropped, dimension)
%function cifti = cifti_struct_dense_replace_volume_structure_data(cifti, newdata, structure, cropped, dimension)
% Replace the data in a single cifti volume structures, taking a 4D array as input.
... |
e07e4c0f177caa9b5f92802ba687ce946f2aaf31f21584c1151aab3d2f0eb883 | MATLAB | 2,671 | 85 | %%**********************************************************
%% chebyinf.
%%
%% minimize || p(d) ||_infty
%% p = monic polynomial of degree m.
%%
%% Here d = n-vector of complex numbers
%%---------------------------------------------------------
%% [blk,Avec,C,b,X0,y0,Z0,objval,p] = chebyinf(d,m,solve);
%%
... |
f030f8f70213a5a0bb88d4b836fe34c9f3be96d4a60a8a0858575553e38c4b90 | MATLAB | 2,672 | 76 | function [buzsakilab_database] = bz_loadDB(varargin)
% USAGE
% [buzsakilab_database] = bz_loadDB(varargin)
%
% INPUTS
%
% DBName - string, name of database to load
% [default=buzsakid_metadata]
%
% forceReload - logical [default=true] When downloading the database the first time,
% ... |
2a70cb5da0a43c848779645ee1d0fbc6a22e39b2bf39ff2dad1df6d3b3d50436 | MATLAB | 2,674 | 78 | % uiputfile2() - same as uigputfile but remember folder location.
%
% Usage: >> uiputfile2(...)
%
% Inputs: Same as uiputfile
%
% Author: Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004
% Thanks to input from Bas Kortmann
%
% Copyright (C) Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 200... |
c823ded21c3b73fd9187ce9ad46a7d565e3e9857265074ae3a86fdd8fddf1279 | MATLAB | 2,676 | 63 | function apref = ea_antspreset_effective_ultrahighvar(cmd)
if ischar(cmd) % 'query' mode, return the name of the preset
apref = 'Effective: Ultra High Variance';
return
end
normsettings = cmd; % cmd is the 'normsettings' struct
switch normsettings.ants_metric
case 'Mutual Information'
apref.metric... |
ad1c43710d6633d01e7755b24dfafa41746c802f5142bfa349b23ec199fa383e | MATLAB | 2,677 | 110 | function [spec, headerinfo] = read_caret_spec(specfile)
% READ_CARET_SPEC reads in a caret .spec file.
%
% Use as
% [spec, headerinfo] = read_caret_spec(specfile)
%
% Output arguments:
% spec = structure containing per file type the files listed
% headerinfo = structure containing the specfile header
%
% T... |
96eac99e9c82a3369ee18e07e95c183e04cb468b95d59a4f24c2b650786a29b6 | MATLAB | 2,678 | 101 | %% Batch script to run blind ICA on SBM (or PET)
% Enter the values for the variables required for the ICA analysis.
% Variables are on the left and the values are on the right.
% Characters must be enterd in single quotes
%
% After entering the parameters, use icatb_batch_file_run(inputFile);
% Or include as a config... |
b73480ae444e98f7cefe6cb0159f74482efc97a48f8ed29e987a147903dacccb | MATLAB | 2,678 | 127 | function [ node_x, element_node ] = gmsh_data_read ( gmsh_filename, ...
node_dim, node_num, element_order, element_num )
%*****************************************************************************80
%
%% GMSH_DATA_READ reads data from a GMSH file.
%
% Licensing:
%
% This code is distributed under the GNU LGPL... |
7cef5ad30b6d9a58d4ae8891921571d2ce8920c9b80bd7c8848499e71b500ef6 | MATLAB | 2,679 | 65 | function res = permute(obj, dims);
if length(dims) > 3
error('Max 3 dimensions for permutation');
elseif length(dims) == 2
error('Permutation with 2 dimensions: use transpose instead');
end;
newFileName = mmo.getnewfilename;
copyfile(obj.dataFile, newFileName);
res = obj;
res.dimensions = obj.dimensions(dims... |
343f766e92e7297a058423d69b8d859135aaaac70cbecc80f30e36d7bde4c9e3 | MATLAB | 2,680 | 65 | function sleepstagesOUT = twin2danalyzer(sleepstagesIN)
% Convert a TWin score file to a danalyzer score file.
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
for countRow=1:height(sleepstagesIN)
% In the cell with the time (col 1) and sleep stage (column 2) info, find text that indicates the current sleep stage... |
769d1aa9c26aafe3b1cb7448d25c5ca34352337289ddde55a3609d1252ab769b | MATLAB | 2,680 | 54 | % 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... |
85fadf39db1ee073fd25e5e0d17515657c544b37762581942e1f443630649fad | MATLAB | 2,680 | 109 | function [varSpeed speedDim] = speedModulation(self,variableName,root,varargin)
% [varSpeed speedDim] = root.myvar2.speedModulation(root,'x','ifplot',1)
%
% Calculates the mean of the variable within a certain speed range
%
% Outputs:
% varSpeed -- The mean within each epoch (vector / cell)
% speedDim -- The edges ... |
a26933c28ff70a9740eb82e8dbf0bdf5b517a2b9a10c4514ce7a6e688ccded4e | MATLAB | 2,680 | 70 | % rspdfsolv() - sub-function used by rsfit() to searc for optimal
% parameter for Ramberg-Schmeiser distribution
%
% Usage: res = rspdfsolv(l, l3, l4)
%
% Input:
% l - [lambda3 lamda4] parameters to optimize
% skew - expected skewness
% kurt - expected kurtosis
%
% Output:
% res - residual
%
%... |
dd5992acf1c929f4b78d4ccc9f8effe4142db658666e6e286beb9d80b224200e | MATLAB | 2,680 | 74 | function CBIG_ASDf_plotCorrWithBest(inputDir, k, r_final, corr, outputDir)
% CBIG_ASDf_plotCorrWithBest(inputDir, k, r_final, corr, outputDir)
%
% This function plots the correlation between final estimate and other
% solutions, sorted from highest to lowest likelihood.
%
% Input:
% - inputDir:
% Absolute... |
f74c509a49ebd18b394a222ccd1a5c412acd2bf6392c43aba8ada60ed3261232 | MATLAB | 2,680 | 83 | function [returnVar,msg] = ReRefFilFile(fname,nbChan,refChan,rerefChan)
% USAGE:
% ReRefFilFile(fbasename, nbChan, refChan, rerefChan)
% This function substracts one channel or the median of a series of
% channels (the 'reference' channel) from other channels.
%
% Note: this uses 1-based indexing, not... |
42173998cde8c4fdafea0ecd509bd69469257e42a77764de3aeb3fb4fb3bb524 | MATLAB | 2,681 | 95 | % plot layer specific changes in power and phase deviations
function plotlayers(animal, probetype, filtertypes)
exp_dir=get_exp(animal);
if strcmp(probetype,'ECHIP512')==1
numchans=512;
numshanks=8;
load('F:\Ephys Analysis\VLSE neuro 4-4 - HPC2\probe_data\ECHIP512.mat');
elseif strc... |
ea120f08f33f79ad7028363e50977e2bb9a23f51b75973d85558bfdfc8125a40 | MATLAB | 2,682 | 85 | % Vf = fuseVolW(Vx, Vy, Vz, wl, N)
%
% This function implements a wavelet-based 3D image fusion. It takes as
% input three volumes (of the same size) Vx, Vy, and Vz, which have low
% resolution in the first, second, and third dimensions, respectively, and
% high resolution in the two other dimensions. wl is the wa... |
b14ba033648095462414b0200ba472aee44c0f97f3eccc2c2b9ac9ed540e3989 | MATLAB | 2,683 | 67 | %% Last update: 2020/6/19
% -
%
%%
function [fname, data, index] = F_loadPhotometryData(filename, sheet)
[~,fname,ext] = fileparts(filename);
if ismember(lower(ext), {'.xls', '.xlsx'})
if nargin == 1
sheet = 1;
end
[data, index, ~] = FPloadXLS(filename, sheet);
else
[data, index] =... |
b42e865868ec6bc9c5a06ff8fbaf3066eac3ffbb2995b9614b48c0ed173ee5d8 | MATLAB | 2,684 | 81 | function [BMD_raw, counts_data, intervene_matrix, perturbations, species_names, T, experimentBlocks] = wrapper_ParseData(metadata_file, counts_raw, biomass_raw, counts_dataFormat)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from... |
fe5f6b478fd9e42fb9e76876065e2e2ee5500fcbf6003eff9f8acfee028bf8e9 | MATLAB | 2,684 | 63 | function apref = ea_antspreset_effective_lowvar_highsmooth(cmd)
if ischar(cmd) % 'query' mode, return the name of the preset
apref = 'Effective: Low Variance, High Smoothing';
return
end
normsettings = cmd; % cmd is the 'normsettings' struct
switch normsettings.ants_metric
case 'Mutual Information'
... |
6b76b0c36ff46a6cc5d4021dc5e3d98f99b6075e202010e2e6051f13a8a5b6ee | MATLAB | 2,685 | 60 | function output = SOFAconvertCoordinates(input,input_type,output_type,input_unit,output_unit)
%SOFAconvertCoordinates
% output = SOFAconvertCoordinates(input,input_type,output_type,input_unit,
% output_unit), converts the specified coordinate variable to specified
% output_type and returns the results.
% S... |
ad7ebbabe01f5fd13b0d65ec6e7e61cd11b7309271baeee082c88068318cfb93 | MATLAB | 2,686 | 74 | % dftfilt() - discrete Fourier filter
%
% Usage:
% >> b = dftfilt(n,W,c,k,q)
%
% Inputs:
% n - number of input samples
% W - maximum angular freq. relative to n, 0 < W <= .5
% c - cycles
% k - oversampling
% q - [0;1] 0->fft, 1->c cycles
%
% Authors: Sigurd Enghoff, Arnaud Delorme & Scott Makeig,
% ... |
00197b7f1d15e94dd0f3b6fb836c18226bf2be2e8e9562454e289b66195b6d91 | MATLAB | 2,687 | 116 | function [a, b] = isintent(this,intent)
% Correspondance between fieldnames and NIfTI intent codes
% FORMAT ind = isintent(this,intent)
% this - GIfTI object
% intent - fieldnames
% a - indices of found intent(s)
% b - indices of dataarrays of found intent(s)
%_______________________________________... |
239a9650f735c4b41ce2141a002a274ceb3a819405fdab5b1bf735b12e185a61 | MATLAB | 2,687 | 67 | function CBIG_MMLDA_scatter_plot_k3(prob_x, prob_y, colors, title_name, xlabel_name, ylabel_name, out_name)
% CBIG_MMLDA_scatter_plot_k3(prob_x, prob_y, colors, title_name, xlabel_name, ylabel_name, out_name)
%
% Scatter plot (1x3 subplots) for factor stability. This will generate Figure 6 in the paper.
%
% Input:
% ... |
19e0f854ca99dd37814265a60e6586b0503b14bb00c4123fc6db9e347c791ce9 | MATLAB | 2,690 | 63 | function apref = ea_antspreset_effective_lowvar_vhighsmooth(cmd)
if ischar(cmd) % 'query' mode, return the name of the preset
apref = 'Effective: Low Variance, very high Smoothing';
return
end
normsettings = cmd; % cmd is the 'normsettings' struct
switch normsettings.ants_metric
case 'Mutual Information'
... |
0870a326ff2e7662942dbc7c28a6225cc8bd2dd68ca500d25705ad39b2e3fb29 | MATLAB | 2,691 | 112 | %% figure 3
load('figure3_data')
addpath(genpath('~\functions')) %%%%%
%% iTWC
an_col = [30 58 205]/255;
aw_col = [229 32 21]/255;
set(0, 'DefaultAxesFontName', 'Arial');
set(0, 'DefaultTextFontName', 'Arial');
x = -150:450;
figure('Position', [100, 100, 800, 500])
% Plot data with shad... |
7c3bbf2c4e06dd80f0bf06208e4fa953bd46fafe588f9830a1d44957ef76412e | MATLAB | 2,691 | 102 | function [fallback,dodge_x,dodge_color,dodge_lightness,dodge_ind,dodge_n]=dodge_comp(x,color,lightness,uni_color,uni_lightness)
if iscell(x)
%If x is given as cell, we don't do the advanced dodging
fallback=true;
uni_x=1;
else
fallback=false;
uni_x=unique(x);
%Here we need to implement a loose... |
3174e155178070eec36fe0e885006f0b8b1a68ed762c016d6a5ab965ee73d7b4 | MATLAB | 2,692 | 84 | function get_sEEG_field_from_csv(field_in_csv, file2save, phi_field, reslice2segmask, segmaskFile,zipIt)
% Get nifti of OSS electric fields
% By Butenko, konstantinmgtu@gmail.com
arguments
field_in_csv % where the csv file with field components is stored
file2save % path for niftis to save
phi_f... |
20ae57a3041b745b72529871d55ba3f9f1eea3f0e4b490f3d65ce75535e2b955 | MATLAB | 2,693 | 108 | function saveabaqus(node,face,elem,fname,heading)
%
% saveabaqus(node,fname)
% saveabaqus(node,face,fname)
% saveabaqus(node,face,elem,fname)
%
% save a tetrahedral and/or surface mesh as an ABAQUS input file
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2012/07/05
%
% input:
% node: input, surface node l... |
f8fd5807299e3d78340c2f66b13f1c691d93659f8d2200ccd5bd012f2f667cbd | MATLAB | 2,693 | 69 | function [y,t] = asmDxq(d, x, K, ddotx)
% y = asmDxq(d, x, K [, ddotx])
%
% ASMDXQ Assemble y = D(d)x for x in Lorentz part of K.
% [y,t] = AasmDxq(d, x, K [, ddotx]) then y[k]+t(k)*d[k] = D(dk)xk.
%
% ********** INTERNAL FUNCTION OF SEDUMI **********
%
% See also sedumi
% This file is part of SeDuMi 1.1 by Imre Pol... |
3aed72413c4d97b42130ea264251cbf8eab5aecb60e820bc3a27f7febd5c4099 | MATLAB | 2,694 | 65 | function [endpos, maxlevel] = fast_match_bracket(key,pos,startpos,brackets)
%
% [endpos, maxlevel] = fast_match_bracket(key,pos,startpos,brackets)
%
% A fast function to find the position of a closing bracket token in a string
%
% authors:Qianqian Fang (q.fang <at> neu.edu)
%
% input:
% key: a preprocessed string ... |
2238c9f16a5bed611b140ea7323779e53b7833136da99d37e8317ba3b96bdccc | MATLAB | 2,697 | 82 | function varargout = expression( nm, varargin )
%EXPRESSION Declares a single CVX object for storing subexpressions.
% EXPRESSION x
% where x is a valid MATLAB variable nm, declares a scalar expression
% holder for the current cvx model. Like a variable, an expression holder
% can be used in constraints and o... |
768fd721b0c94f91d543b86cf39e57bc61e786af853d39e5532301f5ae150a47 | MATLAB | 2,698 | 60 | % 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... |
b001fc9b3d2c38891e65802a1499b13962f2689c14243afdd6845bef7c829af0 | MATLAB | 2,698 | 56 | function Obj=SOFAconvertTUBerlin2SOFA(irs)
% OBJ=SOFAconvertTUBerlin2SOFA(irs) converts the HRTFs described in irs
% (see TU-Berlin HRTF format) to a SOFA object.
%
% SOFA API - demo script
% Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences
% Licensed under the EUPL, Version 1... |
cf6ed3235795f9cd3babc45afa96bba04b09ee199a3b9eb3763aae0e4b258437 | MATLAB | 2,698 | 83 | function [value_mean, value_std, value_sem, glist] = ...
stampResp(trace_stamp, framestamp, stampinfo,...
ttlabel, stampsel, xvalue, handles, figiniID, datatitle)
N = size(trace_stamp, 2);
t0 = [1; find(diff(framestamp)~=0)+1];
t1 = [find(diff(framestamp)~=0);length(framestamp)];
g = framestamp(t0);
value_g = ... |
5de798625bc0e5ff9c20b72c9216f756251dc82e597112755e62f9bfdcfef09a | MATLAB | 2,699 | 64 | function [vatfv,vatvolume] = ea_postprocess_multisource(options,settings,side,source_efields,source_vtas,outputPaths)
% Merge multisource VATs.
% By Butenko and Li, konstantinmgtu@gmail.com
arguments
options % Lead-DBS options for electrode reconstruction and stimulation
settings % param... |
7042077d3cc6b1bf808b416de8004201d7be84c06ce1f0339284fd0b8d8e30e2 | MATLAB | 2,700 | 72 | function [params, paramsFilePath] = getMapAnalysisParams(loadParam,varargin)
% getMapAnalysisParams loads parameters for compiling 2P mapping data across animals
%
% INPUT:
% loadParam --> whether (1) or not (0) to load existing params
% varargin --> takes full file path to p... |
4fc56f1ce68b6a154a4b0f100291f1e7bf16f1916526e94356ca699d7bf9cfda | MATLAB | 2,701 | 65 | function ea_fastsurfer_seg(input, subjID, outputFolder, updateScript)
% Wrapper to run FastSurfer seg_only pipeline
if ~exist('updateScript', 'var')
updateScript = false; % Update FastSurfer script or not
end
input = GetFullPath(input);
if isfolder(input) % Input is subj folder in LeadDBS BIDS dataset
[~, su... |
2cb98a09fe287b91dab426ee92782ef65257a538b60e6d765133448d1f44f5f5 | MATLAB | 2,702 | 102 | % runpca() - perform principal component analysis (PCA) using singular value
% decomposition (SVD) using Matlab svd() or svds()
% >> inv(eigvec)*data = pc;
% Usage:
% >> [pc,eigvec,sv] = runpca(data);
% >> [pc,eigvec,sv] = runpca(data,num,norm)
%
% Inputs:
% data - input d... |
7668b1306203891a8b58412cf9f65e0e57c4a854d865af611ff7cfcd229f2957 | MATLAB | 2,702 | 82 | % LabChart.Mat.load - Loads a dot-mat file exported from LabChart.
%
% [time, data, units, comments, names] = LabChart.Mat.load(filename)
%
% Most data are organized in 2D cells where row indices select channels
% and column indices select blocks:
% time{channel, block}
% data{channel, block}... |
a98a3567dc20efd1bce02d4c3835298f6f63a01b93b3cf0571291069c777a7d6 | MATLAB | 2,702 | 84 | function [ts_bold] = run_bold_absorbing(topology, homparam, hetparam, stim, tol)
% Compute the BOLD response, which is approximated as the zero frequency component of the underlying stimulus evoked response
% ts_bold(r) = sum_n=0^\infty phi(r, t = ndt).
% Absorbing boundary conditions - by adding absorbing layer over... |
ae5c93b4281a9eae656006edf3fe1ea6ea0f5e9e22d6e26ab8c7596249f3a86c | MATLAB | 2,704 | 85 | function [dataFilename, dataFolder] = getFile(filterSpec, title)
% getFile
%
% Similar to uigetfile, it opens a dialogue to get a file, but it also
% remembers the last folder location, so the user will not need to navigate
% to the same folder multiple times.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
f609081a8cd2edfb51a321433e15b0578606c5ba8f6ce8651d1ce01e62a2ae56 | MATLAB | 2,704 | 82 | function ea_trk_write(header,tracks,savePath)
%TRK_WRITE - Write TrackVis .trk files
%
% Syntax: trk_write(header,tracks,savePath)
%
% Inputs:
% header - Header information for .trk file [struc]
% tracks - Track data struc array [1 x nTracks]
% nPoints - # of points in each track
% matrix - XYZ c... |
fc0e382a03c76c3e551b0e1a2465bb0d2ab2d75676bb186a62dfa01c76e6d43e | MATLAB | 2,704 | 98 | function p=smoothsurf(node,mask,conn,iter,useralpha,usermethod,userbeta)
%
% p=smoothsurf(node,mask,conn,iter,useralpha,usermethod,userbeta)
%
% smoothing a surface mesh
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2007/11/21
%
% input:
% node: node coordinates of a surface mesh
% mask: flag whether a... |
96962eeeb4c270e34094817915867c72a019d4311bf17701e7d51fe43c44c7c4 | MATLAB | 2,705 | 93 | function tseries_align(img_full_path, ref)
DataType = 'uint16';
%% Make path *nix compatible, extract name of image
img_full_path = regexprep(img_full_path, '\', '/');
[~, img_name] = fileparts(img_full_path);
%% Read in metadata from xml file
text = fileread([img_full_path '/' img_name '.xml']);
% number of imag... |
553a923a255e8818d6cb23eb1badcfb9f7a712309e6aa616d9455722944ecb69 | MATLAB | 2,706 | 110 | function resComb = mu_combine_granger_pt_days(resDays, opts)
%MU_COMBINE_GRANGER_PT_DAYS Combine day-level permutation GC results.
%
% resDays{i}.dGC_obs : chancmb x fwin x twin
% resDays{i}.dGC_perm : chancmb x fwin x twin x nPerm
%
% opts.weights:
% [] or "equal" : equal weight for each day
% numeric vector... |
21eb06d8820e71cfc3a325ae131c8da3fe13d651b96471ecd4d02904e55f91f4 | MATLAB | 2,707 | 81 | function palm(varargin)
% Type 'palm' without arguments for help.
% _____________________________________
% Anderson M. Winkler
% FMRIB / Univ. of Oxford
% Mar/2014
% http://brainder.org
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% PALM -- Permutation Analysis of Linear Models
% Copyrigh... |
6427a43ccff65324c12a4c591b4d718bba2e314a5d14e56e7254df1beba65906 | MATLAB | 2,707 | 64 | %% Frequency analyses for Tiny dancers study
clear all
clc
%% access the continous data
group={'3m','6m','12m','adults'};
for g=1:length(group)
cd(['D:\MUSICOM_EEG\PROC\Step2_continuousdata\' group{g}])
FileNames = {dir(['*_CONTIN' '.mat']).name} ;
for k=1:1:length(FileNames)
%% get bab... |
832b4669ef153ac70dca01c730316ea09d34d3a3cf92844c95ea08ab70534c3b | MATLAB | 2,707 | 90 | % blockave() - make block average of concatenated data sets of same size
% Each data set is assumed to be of size (chans,frames).
% Usage:
% >> aveout = blockave(data,frames)
% >> aveout = blockave(data,frames,epochs,weights)
% Inputs:
% data = data matrix of size (chans,fra... |
010a4b062f467c16121ef3f4aa1a3c9b442258a3a331cf1d6b71200c56c0f34b | MATLAB | 2,708 | 70 | function ripple_events = RippleEvents(self, ind)
% Detects onset, center, and offset of ripple events that occur in LFP
% signal. Returns indices in root.b_lfp(ind).signal
%
% Filters to ripple band (80-250Hz), finds ripple envelope signal (defined
% by smoothed magnitude of hilbert transform) and detects threshold
% ... |
4e116e71a9fb3598915f7cac7a88bbdb3ec0a982f94a81c81092346fc2c1828a | MATLAB | 2,708 | 113 | function [f,qm,im,info1,info2,info3,ind]=readraw(pfilename,frm,fastrecflag)
% Usage ... [f,qm,im,info1,info2,info3]=fidread(pfilename,frame#,fastrecflag)
%
% P file is organized as follows:
% coil 1:
% slice 1: baseline interleaves time1, interleaves time 2, etc...
% slice 2: baseline interleaves time1, inte... |
d431b518664a2e485ef19be4840d0ec8e258ab621a54592a697467f00bd41962 | MATLAB | 2,709 | 100 | function nii=ea_exportgenemap(geneidx,smoothkernel,intensnorm,outputfolder,mirror,resolution,db)
% Function to export nifti image for a particular gene expression from the
% Allen institute database.
% (c) Andreas Horn 2021
prefs=ea_prefs;
if exist('db','var') && ~isempty(db)
load(db);
else
load([prefs.genet... |
6617659ebb279cd41f03b1d17e82fb7fdef8317c3e48824e26c09bf67e739fe0 | MATLAB | 2,711 | 82 | % subsref() - index eegdata class
%
% 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 Software Foundation; e... |
3d1138588e07e28747c4a4466b183671faef9bbaf80ef8a3a9dfa3d24bb4f2c6 | MATLAB | 2,712 | 94 | % Plays a predefined sound. Possible options are:
%
% failure
% abort
% gocue
% alert
% warning
% error
% done
% list - will list names for all the available sounds
%
% Example: playSound('alert')
%
% Kian Torab
% kian.torab@utah.edu
% Department of Bioengineering
% Universit... |
7db821039f10958cf9f8124719a96906fd61961a0a8752cec5e340f9833e8bd6 | MATLAB | 2,712 | 90 | %% Example 2 of running HMM-LDA topic model
%
% This example shows how to collect multiple samples from the HMM-LDA Gibbs sampler
% from the same chain and different chains
%%
% Choose the dataset
dataset = 1; % 1 = psych review; 2 = nips papers
if (dataset == 1)
% Load the psych review word stream
... |
b51246f1bc3ace28560e69fea2d6fdfd104ec561827ee04689fc886cc9427ba0 | MATLAB | 2,712 | 97 | % Conduct a binary search
%
% binSearch: Conducts a binary search and continues until the score is
% close enough to the target. An upper limit should be set on the number of
% iterations
%
% [SearchPoint, Step, ReLoop] = iosr.auditory.binSearch(Score, ...
% TargetScore, ...
% CloseEnough, ...
... |
5697b02b903065f740a151c9128683eaf053332527927655e6e9b0ebe0f03fea | MATLAB | 2,714 | 90 | function tree = struct2xml(s,rootname)
%STRUCT2XML Convert structure to an XML tree object and specify its root name
% TREE = STRUCT2XML(S,ROOTNAME) converts the structure S into an XML
% representation TREE (an XMLTree object) with ROOTNAME as the root tag, if
% provided. Only conventional objects (char, dou... |
642c8e2b4b509da5c16965b2bacbcfc0063fd9164b5ef316e42428a8f867a6c7 | MATLAB | 2,714 | 110 | function[N,B,E] = isi(data,T,err,Nbins,plt)
% Calculate the inter-spike-interval histogram
% Usage: [N,B,E] = isi(data,T,err,Nbins,plt)
%
% Input:
% Note that all times have to be consistent.
%
% data - structure array of spike times (re... |
6bf89e1a2ee9799dd4cc1d50b5be47e02b961f739033755652dc7511ee2d7ce4 | MATLAB | 2,715 | 75 | function ea_patch_spm
% Patch SPM def, norm and shoot cfg file to make deformation file whose name does
% not start with 'y_*' or 'iy_*' also recognizable.
% unzip(fullfile(ea_getearoot, 'ext_libs', 'spm', 'cfg_patch.zip'), fileparts(which('spm')));
patchedFile = {};
spmDir = fileparts(which('spm'));
defCfgFile = fu... |
a760f3886dda0328f4f8c418d35dce57859abc6746bd470cbb7e5a695af755cc | MATLAB | 2,716 | 70 | function ea_firstrun(handles,options)
% check if a newer version is available..
local=ea_getvsn('local',1);
web=ea_getvsn('web',1);
vcheck=0;
if strcmp(local,'Unknown')
vcheck=1;
elseif ~strcmp(web,'Unknown')
vcheck=(local<web);
end
try
if vcheck
set(handles.updatebutn,'Visible','on');
set... |
1a93cf5711eec62121ba5a69d83d1c3af1b8cf4626d0615faf1f524886c9bd82 | MATLAB | 2,718 | 68 | function CBIG_hMRF_check_replication_results(output_dir)
% CBIG_hMRF_check_replication_results(output_dir)
%
% This is the wrapper function to set up and run the clustering algorithm based on the input arguments.
%
% Input
% - output_dir: (string)
% ABSOLUTE path to the directory to which the output results wil... |
bcdf7d11248faf8412810b6f9c3f5f594da18c914a43ae53f49470c14f23267d | MATLAB | 2,718 | 104 | function r=ksr(x,y,h,N)
% KSR Kernel smoothing regression
%
% r=ksr(x,y) returns the Gaussian kernel regression in structure r such that
% r.f(r.x) = y(x) + e
% The bandwidth and number of samples are also stored in r.h and r.n
% respectively.
%
% r=ksr(x,y,h) performs the regression using the specified ban... |
6675c599cb4222e4cbf30b24bacda5d599428f085ffc323b9e46eacc8c35a354 | MATLAB | 2,719 | 70 | function out = AF_OF_fileimporter(filename, startRow, endRow)
%IMPORTFILE Import numeric data from a text file as a matrix.
% E9CLDATA20201002162310 = IMPORTFILE(FILENAME) Reads data from text file
% FILENAME for the default selection.
%
% E9CLDATA20201002162310 = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads... |
4d19842ec517bcfdda50e11f20ade0e500dcd6f2158f43200dfe2beb8ed2b52b | MATLAB | 2,720 | 73 | function [theta_v, edge_L] = get_theta_vertex(topo, V, theta, strain)
% GET_THETA_VERTEX Map cell-level polarity angles onto vertex-level unit
% polarity vectors, using an edge-length-weighted average of the
% surrounding cells' polarities (Lees-Edwards sheared PBC version).
%
% [theta_v, edge_L] = GET_THETA_VERTEX(... |
639a123a4c09c64692d610a0944f94c4dc4afa7fffd13979a4df53d09e8845a4 | MATLAB | 2,720 | 64 | function [pamlist,FilesExist] = ea_unifiedmapping_getpams(obj)
% Return list of PAM results
% always initialize with entries for mirrorred stims
% mirror flag will be checked in ea_discfibers_calcvals_pam
numPatient = length(obj.allpatients);
pamlist = cell(numPatient*2,2);
FilesExist = zeros(numPatient,2); % no sens... |
83a233178f0aaeac3d4b5e36174a3a367daf0b6ae37637f8b9abd82f81fbfa7c | MATLAB | 2,725 | 69 | % compvar() - project selected components and compute the variance of
% the original data they account for.
%
% Usage:
% >> [proj, variance] = compvar( data, wts_or_act, winv, components);
%
% Required Inputs:
% data - 2-D (channels, points) or 3-D (channels, frames, trials)
% dat... |
b2dc9811d546b9a47bdd6e48b4b9457c8e8a7b750960adb8766bfe23855654c0 | MATLAB | 2,727 | 64 | function COREmex(source, options)
%COREMEX Compile CORE_ functions.
% COREMEX(SOURCE), where SOURCE is the name of a CORE_ source
% file, checks if the .mexw32 or .dll file of the same name is older
% than any of the following source files: {SOURCE, CORE_library.c,
% CORE_mextools.c}. If any of the... |
c2a1f9eda4bb2a2178c40d7e8dffe542b8fe553f99b9da6ac9522e21b67048bc | MATLAB | 2,728 | 108 | function [sigHR] = GRESimulation(SequenceParam, TissueParam, SimParams)
%% Reading sequence parameters
if isfield(SequenceParam, 'TR')
TR = SequenceParam.TR;
else
TR = 1;
end
if isfield(SequenceParam, 'TE')
TE = SequenceParam.TE;
else
TE = 30e-3;
end
if ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.