sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
474efd77e95f7341c16a5caec94b48fc79a2ae44877a2c705be7f4d9935deece | MATLAB | 10,748 | 358 | function SwarmCI_FromCSV(csvfile, yVar, varargin)
% SwarmCI_FromCSV
% Swarm dots + 95% CI (2.5–97.5th percentile) rectangle + mean (red) line.
% Reads a CSV table and plots yVar grouped by Construct, organized by AP.
%
% Minimal repo-friendly version: assumes the CSV already contains only the
% data you want plotte... |
a346b9e9e7e5f7462b28fa896862892a4784c6fd712eeb7ccc943d2d7e289221 | MATLAB | 10,752 | 335 | clc;
clear all;
close all;
cd
%%
%loading asll variables
load proc12; load proc16; load proc21;
F = [cd '\' 'Results'];
dfactor = 1; % change this acordingly to intitial sampling freq.In our case no dowsampling required
FS = 40;
load("chanlocs.mat");
p... |
114b6e60899aa846b5f8c9b429d1ad1044790bf59fcb573079ee9306c0736cdc | MATLAB | 10,753 | 280 | % SUBSASGN - define index assignment for eegdata objects
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, wit... |
9e8aae192fe642ddb121ccf3b370a4b5c6ce066eed388ded5eb648890127ec86 | MATLAB | 10,761 | 225 | function [outdata,outstate, Y] = asr_process(data,srate,state,windowlen,lookahead,stepsize,maxdims,maxmem,usegpu)
% Processing function for the Artifact Subspace Reconstruction (ASR) method.
% [Data,State] = asr_process(Data,SamplingRate,State,WindowLength,LookAhead,StepSize,MaxDimensions,MaxMemory,UseGPU)
%
% This fun... |
17ca483b79bbd99a02e1ca5c050991f3f847178910ccd6b72ecc26ebf40f2ea1 | MATLAB | 10,782 | 439 | function [Model, Info] = linear_map_sparse_cov_pinv(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% [Model, Info] = linear_map_sparse_cov_pinv(X,Y,Model,parm)
%
% --- Input
% X ... |
d05c526ce392d66d069108e503b3a749d633c6a00df748f35a3a6ada021c26aa | MATLAB | 10,787 | 357 | function [out, fs, phs, w, driftPre, driftPost] = op_probabSpecReg(in, seqType, echo, F0, noAlign)
% Spectral registration is a time-domain frequency-and-phase correction
% routine as per Near et al. (2015). Incorporates a multiplexed,
% probabilistic approach for aligning HERMES data (MM: 170609)
showPlots = 0;
if nar... |
eb518ff424cf524e6cad910ed4393a28efe3e7486d9ff47b21c08f4c228ea114 | MATLAB | 10,804 | 263 | function checkhessian(problem, x, d)
% Checks the consistency of the cost function and the Hessian.
%
% function checkhessian(problem)
% function checkhessian(problem, x)
% function checkhessian(problem, x, d)
%
% checkhessian performs a numerical test to check that the directional
% derivatives and Hessian defined in ... |
c2d0f0a06c26d1c3e97bce04aacbfe6756ad4a68ca859f2a71fece56663663c0 | MATLAB | 10,805 | 294 | function out = SB_TransitionPAlphabet(y, numGroups, tau)
% SB_TransitionPAlphabet How transition probabilities change with alphabet size.
%
% Discretization is done by quantile separation.
%
% ---INPUTS:
%
% y, the input time series
%
% numGroups, the number of groups in the coarse-graining (scalar for constant, or ... |
7a5f6f0c814fe94857b27a4bbee7862ea225c4ca89edda80c0a9b12da3c32395 | MATLAB | 10,807 | 238 | function TS_CompareFeatureSets(whatData,cfnParams,whatFeatureSets)
% TS_CompareFeatureSets Compares classification performance of feature sets
%
% Gives information about how different subsets of features behave on the data
% (length-dependent, location-dependent, spread-dependent features, and features
% that operate ... |
12809d50de6f0b8df9624863d8555c362db61cc4042004a885232df66695a9fd | MATLAB | 10,812 | 360 | function coactPaper_figureS20()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
%
close all
fh=initFig('width',18.6,'height',3.6,'font','Arial','fontsize',fontsize);
x=7;y=7;
panel_01(x,y,fontsize)
panelLetter2(x-letGapX-1,y-letGapY,alphabet(1,labelCase),'fontSize',labelSize,'isBold',... |
8126f5a763eea80a3b9693a45fdab9c2fe4cbee30f14fad8fbe39db4909d9f9f | MATLAB | 10,814 | 299 | function [T_hub, T_lsq, T_cvx] = shapefit_smoothed(V, J)
% ShapeFit formulation for sensor network localization from pair directions
%
% function [T_hub, T_lsq, T_cvx] = shapefit_smoothed(V, J)
%
% This example in based on the paper http://arxiv.org/abs/1506.01437:
% ShapeFit: Exact location recovery from corrupted pai... |
9c5189471feb1e05eebe301a9f54ff143c5205e128beebc4cd16ee2280f3a747 | MATLAB | 10,821 | 413 | %io_loadspec_bruk.m
%Chathura Kumaragamage, McGill University 2016.
%Jamie Near, McGill University 2016.
%
% USAGE:
% [out,ref]=io_loadspec_bruk(filename);
%
% DESCRIPTION:
% Reads in Bruker MRS data (fid.raw, fid.ref).
%
% op_loadspec_bruk outputs the data in structure format, with fields corresponding to time
% scal... |
a5d0dad74388cd8be5570c45db590d21beebcf2ed8bd9cd21292b7a0864b6613 | MATLAB | 10,831 | 275 | %% SPM12 RFX batch code for Responsibility project. Can run "main" (conventional) and computational models.
%
% J Schultz 2019-2024
clear
baseDir = '/Volumes/LaCie_RAID_A/Documents/exp/SODEC/Responsibility/';
FFXbaseDir = [baseDir 'FFX/'];
RFXbaseDir = [baseDir 'RFX/FullFact/']; % Decision and Outcome are in subfolder... |
5d08046ece141a3503ea25d7de7e7890e632fe451cfbab69313c05061b389b02 | MATLAB | 10,833 | 318 | function Test_fixedrank_tensor()
% Given partial observation of a low rank tensor, attempts to complete it.
%
% function low_rank_tensor_completion()
%
% This example demonstrates how to use the geometry factory for the
% quotient manifold of fixed-rank tensors,
% fixedrankfactory_tucker_preconditioned.
%
% This geome... |
7f5420eef498b00a8f66ee015cf96ec8ece1aa5f1fcc4a77c57f3ead377442b7 | MATLAB | 10,835 | 279 | clc;clear;close all;
%%
DataManager = FileManager;
dataset_name = 'Lightfield';
stack = 'Zhang2020';
segmentation_version = 'auto';
raw_data_folder = DataManager.fp_raw_data_folder(dataset_name, stack);
processed_data_folder = DataManager.fp_processed_data(dataset_name, stack);
mask_folder = fullfile(processed_data_fol... |
31c4f5522d1de98b19aa0130794a50f18ca7fe6217895ca7a7368541164b8c02 | MATLAB | 10,842 | 309 | function [V] = ft_write_mri(filename, dat, varargin)
% FT_WRITE_MRI exports volumetric data such as anatomical and functional MRI
% to a file.
%
% Use as
% ft_write_mri(filename, dat, ...)
% where the input argument dat represents the 3D array with the values.
%
% The 3-D array with the values can be further describ... |
3b1782d335334b6d6b4b1d08079fb245fc5bbc3948004143c19e69ff1526654d | MATLAB | 10,843 | 251 | classdef McsEventStream < McsHDF5.McsStream
% Holds the contents of an EventStream
%
% Important fields:
% Events - (1xn) cell array, each cell holding either a (1 x events)
% vector of time stamps for each event or a (2 x events)
% matrix, where the first column are t... |
2d3387cff09616a3afe85df5a2221ca6ee7962b21318238910faf4ee7c3b9014 | MATLAB | 10,861 | 231 | % =============== parameters section ===============
% required input
if ~exist('out', 'var'), error('out file prefix is required'); end
if ~exist('mat_name', 'var'), mat_name = ''; end; % re-use minpvecs and mostvecs (i.e. minP and MOSTest test statistics) from previously saved <out... |
280563a9d412d9539f254fa2f2c86f5e71383b235e8450790bd02a3d429bfa67 | MATLAB | 10,870 | 292 | function [eta, Heta, inner_it, stop_tCG] ...
= tCG(problem, x, grad, eta, Delta, options, storedb, key)
% tCG - Truncated (Steihaug-Toint) Conjugate-Gradient method
% minimize <eta,grad> + .5*<eta,Hess(eta)>
% subject to <eta,eta>_[inverse precon] <= Delta^2
%
% See also: trustregions
% This file is p... |
655073189af347139d2f00e4b8c8abcfe1af09aac45b02f6a7210b09746722f7 | MATLAB | 10,875 | 348 | function [Vt,Vtshuff,shuffmean,shuffstd] = CPD_noOpt(file_idx,ops)
%a non-optimization-based form of coefficient of partial determination
%calculation, a way to assess relative changes in %variance explained due
%to a particular kernel in a model
%Inputs:
% file_idx: neuron index in concatenated A data structure, or ... |
c2ef6023e2827662437b31c6a022e3fc6d3a1c897b5fc344d85f919ac8ff7b5b | MATLAB | 10,888 | 330 | function [res, diagOut] = conf_index_adjustv2(res,i,CATMOS,predVT,predNT,predEPA,predGHS,predLD50,varargin)
%CATMOS_ENDPOINT_CONF_COVERAGE_ADJUST_V2 Pre-WoE endpoint confidence coverage adjustment.
%
% Purpose
% -------
% Adjust the five single-endpoint confidence indices BEFORE woe_corr runs:
% res.Conf_index_VT
% ... |
7117cb6a2fcf037ef771e321a235cd502e6d229043c003f1330000533a9c3da1 | MATLAB | 10,890 | 293 | function varargout = arg_guidialog(func,varargin)
% Create an input dialog that displays input fields for a Function and Parameters.
% Parameters = arg_guidialog(Function, Options...)
%
% The Parameters that are passed to the function can be used to override some of its defaults. The
% function must declare its argumen... |
e30d1fa45938922d31bac68b4ced0b31fe45384a9cf1fcdd552f511eca6a56db | MATLAB | 10,890 | 259 | function [eta, Heta, hesscalls, stop_str, stats] = arc_lanczos(problem, x, grad, gradnorm, sigma, options, storedb, key)
% Subproblem solver for ARC based on a Lanczos process.
%
% [eta, Heta, hesscalls, stop_str, stats] =
% arc_lanczos(problem, x, grad, gradnorm, sigma, options, storedb, key)
%
% This routine app... |
b8adf09473c3b7d4a33b0bfde091eba667cf5c8c88d46fbae11b5b2eb63a7d30 | MATLAB | 10,891 | 258 | function out = NL_ReturnTime(y, NNR, numLags, past, Nref, embedParams)
% NL_ReturnTime Analysis of the histogram of return times.
%
% Return times are the time taken for the time series to return to a similar
% location in phase space for a given reference point.
%
% Strong peaks in the histogram are indicative of p... |
cbfeb572fc4b270f56855dd28247645b0bd12b88a8b2559b3313a9673ec72fe5 | MATLAB | 10,915 | 295 | %% AnalyzeEventClassifierData
% Analyse event classification and draw graphs
%loadxkcd;
load('D:\Data\Lobster\BNB_Result_unitshffle.mat'); %% HEC Result Data
sessionNames = string(sessionNames);
tankNames = string(tankNames);
%% Classifier accuracy
prismOut_accuracy = table(zeros(40,1), zeros(40,1), 'VariableNames', [... |
6fc75c15de3506c47ec08e8bf39b76ffc4c2b3c5f3687f4f0bc54ad55a2e7858 | MATLAB | 10,918 | 237 | % WRITELOCS - write a file containing channel location, type and gain information
%
% Usage:
% >> writelocs( chanstruct, filename );
% >> writelocs( chanstruct, filename, 'key', 'val' );
%
% Inputs:
% chanstruct - EEG.chanlocs data structure returned by READLOCS containing
% channel lo... |
c4a7bf54d8b6879f3792c359cc9d5ab676c60340bea51bfa0b009025149713ed | MATLAB | 10,919 | 293 | function preprocess_nsd_structuralalignment(subjix,mode,wantpause)
% function preprocess_nsd_structuralalignment(subjix,mode,wantpause)
%
% <subjix> is 1-8
% <mode> is 1 (T1) or 2 (T2)
% <wantpause> is whether to pause for getting a better initial seed
%
% we do substantial work regarding preparing anatomical volumes:... |
5369983f4257de8b0f31cbb767a147bb2068972de6f42701327e840f6ed41f8b | MATLAB | 10,921 | 260 | function [ reachStart, reachStop, reach0, pos1, pos2] = getReachTimes( InData, Name, Date )
%Extracts best reach start times from .ns2 data unless BabData set to 1 for
%processed ContData files.
% Can be made to extract from other data types. Assumes 1kHz sampling
%filenamestr should be an .ns2 file or ContData.... |
e00c5e1b6b06cba7524c0f7d489ad318b1ea08b899252cd50f4c9e391609c724 | MATLAB | 10,924 | 244 | % This script is used to plot population-level results of the ABM averaged
% across multiple realisations.
% It requites data from the ABM_main_script to be in the workspace, or
% loaded in as a .mat file
%% Confirm Simulation Parameters
num_iter = length(bulk_result_data); % number of realisations averaged over
st... |
4fd4b5cf4851c1242c0a34c258bd0de18dba7e1e6e02bad9569e003b03fc3be9 | MATLAB | 10,932 | 403 | function varargout = boundedline(varargin)
%BOUNDEDLINE Plot a line with shaded error/confidence bounds
%
% [hl, hp] = boundedline(x, y, b)
% [hl, hp] = boundedline(x, y, b, linespec)
% [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2)
% [hl, hp] = boundedline(..., 'alpha')
% [hl, hp] = boundedline(... |
69d874d41b424bb8e1b5a74c35214089b97d082aa81674706ab831a56e0cf29f | MATLAB | 10,933 | 426 | function [Model, Info] = linear_sparse_stepwise(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% Notice !!
% Delay embedding is done in this module,
% then input vector shoul... |
952b01433c0ba5becff7494c746be36d4a4501a2f80f09a9a89e68fe5959e3b1 | MATLAB | 10,934 | 208 | % Matlab script to export to BIDS
% Exported dataset is available at https://openneuro.org/datasets/ds003061
%
% You may not use this script because you do not have the original data
% It is provided as an example to be adapted for your specific need
%
% Arnaud Delorme - Feb 2020
% export notes
% export event type pro... |
e2bfbdbe870105f6387f23da98ab42f37f18d336ca47667415b6d0b49db6c09b | MATLAB | 10,937 | 180 | clc
clear all
close all
whicheye = input('Please enter left or right to choose eye: ','s')
rawfilepath = input('Enter raw_data location(such as /home/EV_Eye_dataset/raw_data): ', 's');
processedpath = input('Enter processed_data location(such as /home/EV_Eye_dataset/processed_data): ', 's');
outputFile = input('Enter o... |
c6e96adebf2858805d669dedb90ba4c3966701b70a2d7c709b7222a9685c622b | MATLAB | 10,950 | 208 | function cifti_write(cifti, filename, varargin)
%function cifti_write(cifti, filename, option pairs...)
% Write a cifti file.
%
% Specifying "..., 'keepmetadata', true" leaves the file-level metadata as-is:
% if false or not specified, the 'Provenance' metadata value is moved to
% 'Paren... |
f13739394cd424f0bb141aa44e99b5132d2360289ee0c329a3b7eed5d42ea231 | MATLAB | 10,950 | 254 | % Multi-mode function for performing voxel-wise chi-squared analysis on
% meta-analysis data (peak activations)
%
% R = Meta_Chisq_new('compute', MC_Setup, ['mask', maskimg])
% cl = Meta_Chisq_new('write', R);
%
% Note: Meta_Chisq works with list of image names for all study maps
% Meta_Chisq_new works with output of '... |
42f0124d21b459b7859fb2ec4a6de361aec19f45bb714cff456c57af8cc1e162 | MATLAB | 10,951 | 260 | function out = NL_RQA(y, tau, m, theilerWin, rr, lmin, vmin, maxN, randomSeed)
% NL_RQA Recurrence quantification analysis (RQA).
%
% Embeds the time series in an m-dimensional delay space and computes
% standard recurrence quantification measures (Marwan et al., Phys. Rep.
% 438, 237 (2007)) from the resulting recu... |
33823fac62eba80fba413f5aba522109f3c508b6a1e57e9828d7594b0524a62a | MATLAB | 10,952 | 295 | function [xVi, mask] = spm_est_non_sphericity_lqc(SPM)
% Non-sphericity estimation using ReML
% FORMAT [xVi, mask] = spm_est_non_sphericity(SPM)
%
% Required fields of SPM structure (see spm_spm):
% SPM.xY.VY - nScan x 1 struct array of file handles
% SPM.xX - structure containing design matrix information
% SPM.... |
441df5b60c4496f59967dbbd827e15389599fac9ce830432aa315000acf25b74 | MATLAB | 10,959 | 305 | function TOL_fig_ga(config,params,dat)
% TOL_fig_ga, graphical abstract for Duvelle and Grieves (2026)
% Graphical abstract for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80
% years on: A meta-analysis reveals poor replicability and little evidence for
% shortcutting. European Journal of Neuroscience. DOI:
%... |
683b231a730c6605a0a37f870ce5f0dc3fd2ee3e30338b1dccbb1a1f356d719a | MATLAB | 10,973 | 363 | function Fig4Sup3_pKaCalc(varargin)
% Fig4Sup3_pKaCalc
% pH titrations — normalized Apo/Sat fluorescence with sigmoid fits
% per sensor to calculate apparent pKa values.
%
% USAGE:
% Fig4Sup3a_pKaCalc() % process all CSV files in current dir
% Fig4Sup3a_pKaCalc('filename', '01_raw_tecan_data.csv')
% Fig4Sup3... |
69e5918ce6d8b2f96bca72a9c9d4036b6f16dc54fda860e8b8d7ed42365b0f84 | MATLAB | 10,982 | 321 | function hadProblem = TS_InspectQuality(inspectWhat,customFile)
% TS_InspectQuality Statistics of quality labels from an hctsa analysis.
%
% This function loads the calculation quality information from HCTSA.mat,
% and plots a visualization of where different special-valued outputs are occurring.
%
% Useful for check... |
e6b2b279597fadcd50e4845217bdd459a4bf51e07cf478e100483b5505786b61 | MATLAB | 10,986 | 222 | function [SSA, P1] = RMAOV1(X,alpha)
% RMAOV1 Repeated Measures Single-Factor Analysis of Variance Test.
% One-way repeated measures ANOVA is used to analyze the relationship
% between the independent variable and dependent variable when:(1)
% the dependent variable is quantitative in nature and is measured... |
802c71fd3ffa7744a4e0fc0973265b639dd136af3461c1e69e67d95ee5651c22 | MATLAB | 10,994 | 207 | function out = SP_SummariesPhase(y)
% SP_SummariesPhase Statistics of the Fourier phase spectrum of a time series.
%
% cf. SP_Summaries, which characterizes the *magnitude* spectrum in
% detail but discards phase entirely -- the only other place phase
% appears anywhere in this codebase is SD_MakeSurrogates.m, which
... |
ebb6e21e5dc13f003cb8381af8d9e08c4bc8af27abcdfe064c2ae381e270e357 | MATLAB | 11,004 | 294 | function ft_progress(varargin)
% FT_PROGRESS shows a graphical or non-graphical progress indication similar to the
% standard WAITBAR function, but with the extra option of printing it in the command
% window as a plain text string or as a rotating dial. Alternatively, you can also
% specify it not to give feedback on... |
4b0b354b57db89de1d1949d4b99c41161e0828a835b1187bb2934b966f871fca | MATLAB | 11,031 | 218 | % Differential evolution-based combinatorial optimization algorithm that
% tests and builds on identified factor interactions to identify an
% optimal combination of factors and respective doses.
% Objective function of optimization problem used for the generation of
% in silico data (with simulated respo... |
398d467753f8245f1809df14ed3bb1ebb52f48ec75d2787cd443836abd7dc410 | MATLAB | 11,035 | 307 | function Ok = InstallMex(SourceFile, varargin)
% INSTALLMEX - Compile and install Mex file
% The C, C++ or FORTRAN mex file is compiled and additional installation
% routines are started. Advanced users can call MEX() manually instead, but some
% beginners are overwhelmed by instructions for a compilation sometimes.
% ... |
5d27cd4c54d8e005bb3840704944c3ae063f819ad8cbf8edf5659308805d1d99 | MATLAB | 11,042 | 227 | %% Load data
data_path = 'Y:\Alice\0012_NeuroGI\NeuroGI_ephys_data\2024-09-25 Experiment\';
load([data_path 'iv13-wt-03.mat'], 'data')
%% Preprocess data for Fig. 3 panels A and B
reorder = (1:32:128)' + (0:31);
reorder = reorder(:);
y1 = single(data(1:3*60*2000,:));
y1 = highpass(y1, 10, 2000);
ba... |
ad7b66bf4254badc2d4686c6510f29732f42ba8034e21dde529ecfd301278581 | MATLAB | 11,048 | 285 | function SuppFigure_VarOriPair(varargin)
%SUPPFIGURE_VARORIPAR Generate supplementary figure for variable orientation pair analysis
%
% Purpose:
% Creates a figure showing the relationship between normalization indices
% for different orientation pairs, comparing default model with superimposed
% conditions and a... |
7cd22fe982f06a6fea6c5d08043b0ae976a09937dd3d4e89e1efa9f9dab9f9c1 | MATLAB | 11,052 | 307 | function DBExportGallery(name,query,varargin)
%DBExportGallery - Create figure gallery from current database.
%
% Select figures and create an HTML gallery (although not required, installing
% <a href="http://sites.google.com/site/oliverwoodford/software/export_fig">export_fig</a> will yield better PNG images).
%
% U... |
0969261ba3e9906d8189c34c6ab4490b2a8aaf1b0c0b80a27e295b301b6b73d6 | MATLAB | 11,053 | 386 | % GELoad.m
%
% USAGE:
% [FullData,WaterData,hdr]=GELoad(fname);
%
% DESCRIPTION:
% Reads in GE P-files (.7 file) using code adapted from GERead.m, provided
% as part of the Gannet software package by Richard Edden (gabamrs.com).
% Developed by Ralph Noeske and Mark Mikkelsen.
%
% INPUTS:
% filename = filename of GE P... |
e54d70791a3c1ba475d545f678fd9035fd2c7726c6e7d9162a3ee1c95036bede | MATLAB | 11,056 | 390 | function [unmixedMovie, summary] = unmixMovies(SCE, REF, Fs, varargin)
%% UNMIXMOVIES: unmixing the voltage movie from the source (mixed) movie
%
% [unmixedMovies,unmixMap, summary] = unmixMovies(SCE, REF, Fs)
% [unmixedMovies,unmixMap, summary] = unmixMovies(SCE, REF, Fs,Parameter,Value,...)
%
% INPUT:
% SCE ... |
cd9d76b086a3dad42ad0c52736e0744a0bfdbdfa05e6717d69a1ae419fb8d9bc | MATLAB | 11,061 | 363 | function Meta_interactive_table_vox(compareflag,varargin)
% Meta_interactive_table_vox(compareflag,[data matrix, volInfo struct])
% Make table output when you click on a voxel in orthviews.
%
% This version uses fields in DB.PP and computes voxel-based distances
% for consistency with Meta_Setup and other meta-analysis... |
0bb01d4b5437173c85e9aece14c475c8a2715f08dd0e8059c5fc882acbbadec1 | MATLAB | 11,066 | 295 | % op_plotspec.m
% Jamie Near, McGill University 2015.
%
% USAGE:
% out=op_plotspec(in,norm,GUI,color,shift,tit,ppmmin,ppmmax,xlab,ylab)
%
% DESCRIPTION:
% Plot the MR spectrum in the frequency domain.
%
% INPUTS:
% in = input data in matlab structure format. This argument can be a
% MATLAB structure ... |
da3ca4dd61c6b2245c2fe42bf6bc25eee55115636d672a5037af185734509b6c | MATLAB | 11,066 | 358 | function [] = PlotFigure4(datadir, codedir)
%PlotFigure4 - Plots Figure 4. Must be run after ProcessData_Figure4.
% INPUTS:
% datadir - Directory where output from ProcessData_Figure4 was saved
% codedir - Directory of code (e.g., published/dynamic_learning_rate/)
%% Set Path and Load Data
s = pathsep;
pathStr = ... |
5e2c4d5524246ff6605c8cacc3c817bd69b056a949a04271f7c16de87cad63e8 | MATLAB | 11,073 | 342 | function [tableVolSliPhase, indVolPerPhaseSlice, imgCardiacPhasesMeanVols, ...
imgCardiacPhasesFirstVol, fh] = ...
tapas_physio_sort_images_by_cardiac_phase(ons_secs_or_c_phase, sqpar, nCardiacPhases, ...
fnTimeSeries, verbose, dirOut)
%performs retrospective cardiac gating of image time series using phys l... |
7824ac9b45690bd2f074eab717ee5886c3ae55c7b4dec5dd56c2b05b439c19b2 | MATLAB | 11,075 | 280 | % POP_BIOSIG - import data files into EEGLAB using BIOSIG toolbox
%
% Usage:
% >> OUTEEG = pop_biosig; % pop up window
% >> OUTEEG = pop_biosig( filename, channels, type);
%
% Inputs:
% filename - [string] file name
%
% Optional inputs:
% 'channels' - [integer array] list of channel indices
% 'blockrange' -... |
df4f3122458df6a966a21b711c7a2baa193eb3b0e066bd2e4dd4f1e7fdb997e5 | MATLAB | 11,076 | 246 | function out = CO_TimeRevKLD(y, tau, m, k, theilerWin, maxN)
% CO_TimeRevKLD Kullback-Leibler divergence between forward and time-reversed embeddings.
%
% Embeds the time series in m dimensions at time delay tau (e.g., the pair
% (x_t,x_{t+tau}) for m=2, or the triple (x_t,x_{t+tau},x_{t+2tau}) for
% m=3), and estima... |
0dcdc0b39ddbe2b617b647237c3fc39aa1911db350d13d61a058597195193337 | MATLAB | 11,085 | 384 | function plotFigureS4_muscimolBehSupp(processedMuscimolPath)
% Plot Figure S4. YOU MUST RUN processMuscimolData BEFORE RUNNING THIS
% FUNCTION
% INPUTS:
% processedMuscimolPath = local path to output saved from running
% processMuscimolData
%%
x = 1:5;
%general functions
sem = @(x) std(x,'omitnan')./sqrt(su... |
59d44f73583a07fb3540d5dffe3f231da7930b2a7490fca25365b507c623d7cb | MATLAB | 11,086 | 226 | % MAKE_TIMEWARP - Select a subset of epochs containing a given event sequence, and return
% a matrix of latencies for time warping the selected epochs to a common
% timebase in NEWTIMEF. Events in the given sequence may be further
% restricted to those with speci... |
73fbc0c2eca65b5b4f766c08f6755412f925a4de44b0f9d3828fa68646ce8a8e | MATLAB | 11,086 | 356 | function plot_points_on_medial_surface(coords,colors,varargin)
% plot_points_on_medial_surface(coords,colors,varargin)
% plot_points_on_medial_surface(coords,colors,[factor variable],[factor levels],[newfig],[mytextlabels])
%
% examples:
% plot_points_on_medial_surface([EMDB.x EMDB.y EMDB.z],{'ro'})... |
7e85070e0ecf46053274dbce99660a77966d2fbcd4508db19621ff06037587d9 | MATLAB | 11,092 | 257 | function out = PP_Compare(y, detrndmeth)
% PP_Compare Compare how time-series properties change after pre-processing.
%
% Applies a given pre-processing transformation to the time series, and returns
% statistics on how various time-series properties change as a result.
%
% Inputs are structured in a clunky way, unf... |
6bb26042e7aa5dd8b7aed2e897c93f7aa3fae49fb57f06078219d64a836d8bf4 | MATLAB | 11,094 | 300 | %% KJH
% prep the data for sharing on github
% load('dataframe_01132025.mat')
% load('dataframe_perm_01132025.mat')
%
% alldata.R2=data.R2;
% alldata.permR2=data_perm.R2;
% alldata.regionsLR=data.regionsLR;
% alldata.regions=data.regions;
% alldata.domains=data.domains;
% alldata.catnames=data.catnames;
% alldata.cat... |
f5d30cbf9fc94d22fc64ab8a8644a03e89255612974bc003c09d98f4b1cebb4e | MATLAB | 11,100 | 315 | function varargout = osp_platform(varargin)
% Platform specific configuration parameters
%
% FORMAT ans = spm_platform(param)
% param - optional string argument, can be
% - 'bigend' - return whether this architecture is big endian
% - false - is little endian
% - tr... |
fb2b8ebb098f8f5cbebf5d182521375a73314834769261436e850ed8dab67a35 | MATLAB | 11,101 | 305 | % Single-Step QSM with a Total Generalized Variation regularization with spatially variable fidelity and regularization weights.
% This uses ADMM to solve the functional.
%
% Last modified by Carlos Milovic in 2017.06.09
% bug fix: line 123 KC (2 March 2020)
%
function out = WH_wTGV_4sepia(params)
%
% input: params - s... |
de3f9b079fb2b64e00b4e3c752e4b99fd6c0e7d33b7304eb24827ce12f381c44 | MATLAB | 11,102 | 262 | function [MRSCont] = OspreyCoreg(MRSCont)
%% [MRSCont] = OspreyCoreg(MRSCont)
% This function parses header information about the dimensions, location,
% and rotations of the MRS voxel. It then proceeds to call SPM12 to
% import structural images that have been provided in the job file.
% These images are sup... |
5643214a8f5b6d6972e57be80a53e8278d7dda201e09238bf0e586a1af7c4497 | MATLAB | 11,104 | 289 | function [odm,clusters] = i_density(XYZ,radius,niterations,varargin)
% function [odm,clusters] = i_density(XYZ,radius,niterations,[resume at iteration])
%
% iterated density algorithm, to mask out significant areas from
% density analysis and re-run on remaining points, until convergence
% this is a step-down test.
%... |
7cd57806777deff94d9e0dd5b65a16cfd065fecd5e5df474d8e7b5ac8813bae3 | MATLAB | 11,117 | 314 | function out = CO_StickAngles(y)
% CO_StickAngles Analysis of line-of-sight angles between time-series data points.
%
% Line-of-sight angles between time-series points treat each time-series value
% as a stick protruding from an opaque baseline level.
% Statistics are returned on the raw time series, where sticks pr... |
a6cc6a4d9edd2b098a5ee0dc7e5a0d51a1c1c8e3a6217c28c4f95425f32920c0 | MATLAB | 11,125 | 362 | function [varargout] = compute_modelMetrics(y_true,y_pred,metrics)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% compute_modelMetrics evaulates classification or prediction performance
% of the model given and returns a performance score.
%
% Arguments:
% y_true = True labels.
% y_pr... |
68203c07ec14eb28e90aa44ed8635b953da5aea0ac1520d9c6350d9f292c7bba | MATLAB | 11,137 | 381 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add paths
baseloc="C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC";
% For outputs
str='\Outputs';
outputpath=strcat(baseloc,str);
addpath(outputpath);
% F... |
b03fb55f177ef5d5f0c7379e0e5b40339101f8102448c5bcb14ddb80b8adc2a7 | MATLAB | 11,139 | 218 | %% get_MuSus100_atlas_labels(input,mask,output_dir,algorParam)
%
% Usage:
%
% Input
% --------------
% input : structure that contains input nifti file names
% mask : structure that contains mask nifti file names
% output_dir : directiry where the output files will be stored
% algorParam : algori... |
00a1d57e3800d40f9afb04e49fa384207ca2ca91477439b433f751f0b4c23c8b | MATLAB | 11,143 | 291 | function hText = xticklabel_rotate(XTick,rot,varargin)
%hText = xticklabel_rotate(XTick,rot,XTickLabel,varargin) Rotate XTickLabel
%
% Syntax: xticklabel_rotate
%
% Input:
% {opt} XTick - vector array of XTick positions & values (numeric)
% uses current XTick values or XTick... |
5bc1b4f5d0a206de1593e0bffd8b283014199ce6e82ec43155f765f8be19c53c | MATLAB | 11,148 | 334 | function synnConnEditor(basename)
% synnConnEditor(basename)
% visual inspection of synnaptic connection on CCG
% this function requries
% [basicMetaData.AnalysesName '-synConn.mat']
% [basicMetaData.AnalysesName '-spkCCG.mat']
% [basicMetaData.Basename '.goodunits.cellinfo.mat']
% and the results are... |
334ac0ea3cce62bdfb363e99b888750f98bfb4487c8d6319450f545650a1f64c | MATLAB | 11,150 | 285 | % POP_BIOSIG - import data files into EEGLAB using BIOSIG toolbox
%
% Usage:
% >> OUTEEG = pop_biosig; % pop up window
% >> OUTEEG = pop_biosig( filename, channels, type);
%
% Inputs:
% filename - [string] file name
%
% Optional inputs:
% 'channels' - [integer array] list of channel indices
% 'blockrange' -... |
8035eb0feb134fe2ba8e4c2cba4e88540824997f0e9046623b1d0c3965816a4d | MATLAB | 11,153 | 333 | function stats = FieldPSP(stims,lfp,varargin)
%FieldPSP - Measure field EPSPs (waveforms, slope, amplitude) across time.
%
% Slope is determined as the maximum slope during the time window around stimulation.
% Amplitude is determined as the maximum amplitude during the same time window.
%
% USAGE
%
% stats = Fi... |
74a42286a4b6b7338175c79051b54c93093a505caa4a7508e7b0be1bb0ec4995 | MATLAB | 11,171 | 272 | % STD_ERP - Constructs and returns channel or ICA activation ERPs for a dataset.
% Saves the ERPs into a Matlab file, [dataset_name].icaerp, for
% data channels or [dataset_name].icaerp for ICA components,
% in the same directory as the dataset file. If such a file
% ... |
b1b94d5122545c0e7afbc67a9890bcfd666b6d9ccbdada1331a859dd43a3e07c | MATLAB | 11,171 | 304 | function out = EN_Randomize(y, randomizeHow, randomSeed)
% EN_Randomize How time-series properties change with increasing randomization.
%
% Progressively randomizes the input time series according to a specified
% randomization procedure.
%
% The procedure is repeated 2N times, where N is the length of the time serie... |
2764eb40fc4669f070d0b501e308969b5321df0db2d0353678338ef69127f73a | MATLAB | 11,179 | 343 | function [b,p,ci,stats,dist] = permuglm(x,y,varargin)
%PERMUGLM Permutation-based generalized linear models (GLM).
% B = PERMUGLM(X,Y) performs a permutation-based generalized linear
% regression of the responses in Y on the predictors in X, and returns
% the estimated coefficients. X is an N-by-P design matrix,... |
6799acc5a1c084e0a335897f1e96efc77e567858ec82b30e98c3510b24865413 | MATLAB | 11,180 | 320 | function M = grassmannfactory(n, p, k, gpuflag)
% Returns a manifold struct to optimize over the space of vector subspaces.
%
% function M = grassmannfactory(n, p)
% function M = grassmannfactory(n, p, k)
% function M = grassmannfactory(n, p, k, gpuflag)
%
% Grassmann manifold: each point on this manifold is a collecti... |
31a3e56cf4d5c2257f6490de61cfba895559e0e38aaf0c0da30625d09a03dac8 | MATLAB | 11,203 | 230 | function [MRSCont] = OspreyMMSecondary(MRSCont)
%% [MRSCont] = OspreyMMSecondary(MRSCont)
% This calculates the MM concentrations from a cleaned MM spectrum using
% the methods discribed in Hui et al. MRM 2021. It is based on the pre
% v.3.0.0 model and the scripts that were published with the manuscript.
%
% U... |
bcebb5e3d0d7d4f3c068da877379497432b303816cc4e2cfa03f49276f3726c6 | MATLAB | 11,212 | 315 | function y = vl_nnloss(x,c,dzdy,varargin)
%VL_NNLOSS CNN categorical or attribute loss.
% Y = VL_NNLOSS(X, C) computes the loss incurred by the prediction
% scores X given the categorical labels C.
%
% The prediction scores X are organised as a field of prediction
% vectors, represented by a H x W x D x N array... |
0d692f917aa2ac6244532de8c17695f5656e6e519ee086f2d3356d32f8f94e72 | MATLAB | 11,221 | 278 | function [results,cnm_struct] = run_cnmfe_large_data_1p(proc_path,Fs,use_prev)
%% clear the workspace and select data
% clear; clc; close all;
%% choose data
% data_path = 'C:\Users\Zoe\OneDrive - Stanford\Desktop\data\5_10_2022\H20_M17_S49';
neuron = Sources2D();
nam = [proc_path '\mc_data.mat'];
nam = neuron... |
2c15fe1f59b0ab43ea676707ac88f919c819c68bd3208d663c9799d5bf389377 | MATLAB | 11,228 | 302 | % Script for simulating EEG data for testing cross-frequency
% phase-amplitude coupling methods
% defining center frequencies, for which to calculate coupling
freq4phs = 9; % in Hz
freq4amp = 60; % in Hz
% amount of simulations (e. g. 100 for coupling or 10000 for no coupling)
nrpts = 100;
% defini... |
69ca35fe09f433d8376597a74886de96932e7f0145e00fceebfa1507daf5028c | MATLAB | 11,228 | 297 | function [ subject ] = nmri_mri_suma_segment(subject, params)
% [ subject ] = nmri_mri_suma_segment(subject, params)
%
% This function will deal with reading the MRI info
% per default will read from SUMA, other options may be integrated later
% will assume that the subject.id = basename
% otherwise you should spec... |
5a1eba1eb42b4bd763d2c74105bbc7458db0ff4c46ef3c8634216c6a1dfd2d1f | MATLAB | 11,230 | 337 | %% Reference script: Evoked Synaptic Currents
% This script reproduces the analysis pipeline used in the associated
% manuscript but requires raw data that are not provided. Users should adapt
% as needed for their own data.
%% Description of analysis:
% Date: 2024.12.30
% Title of analysis: Kcng4 Paired Recordings
% ... |
630f6f0ab86023e74c5098730325d098eb9404a2a39740d499e241d26d4a6f5e | MATLAB | 11,234 | 364 | function [map,scheme] = brewermap_view(N,scheme)
% An interactive figure for ColorBrewer colormap selection. With demo!
%
% (c) 2014 Stephen Cobeldick
%
% View Cynthia Brewer's ColorBrewer colorschemes in a figure.
%
% * Two colorbars give the colorscheme in color and grayscale.
% * A button toggles between 3D-cube and... |
98b1565d7a97cc75670ed25d6157457c489a6856e541760e991c89cfb7001a96 | MATLAB | 11,240 | 185 | function LFP_Analysis(PhaseLocking,SpikeFieldCoherence,AmplitudeXCorr,FileName,Parameters)
%% Runs the requested analyses with the supplied parameters
% Inputs
% PhaseLocking -- whether or not to perform phase locking analysis
% SpikeFieldCoherence -- whether or not to perform spike field co... |
fde4eafc2157f0cb5c1c225c5c7d71217b4384890675bb5f7d5f89aee1d88a66 | MATLAB | 11,244 | 299 | function dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx)
% READ_BIOSEMI_BDF reads specified samples from a BDF continuous datafile
% It neglects all trial boundaries as if the data was acquired in
% non-continuous mode.
%
% Use as
% [hdr] = read_biosemi_bdf(filename);
% where
% filename ... |
10293e52bd19dd3ffea6e7cdf73f7cacb8e0c759b4b88e35d3108cc8883274d4 | MATLAB | 11,250 | 309 | function [voltage_paths_structure,options]=voltPaths(varargin)
% EXAMPLE USE WITH ARGUMENTS
% [voltage_paths_structure,options]= voltPaths() - analyzing and generating
% the path structure for the parent working directory (pwd)
% [voltage_paths_structure,options]= voltPaths(folder_path) - use 2, etc.
% [voltage_paths_s... |
51efc77d2a77be4ac489d5f66f27f84fcce0b685012d081eb2edb9548f5229f9 | MATLAB | 11,255 | 343 | function [orig, data] = load_curry_data_file(datafile)
[PathName, FileName, Extension] = fileparts(datafile);
if isempty(PathName)
% the dataset is in the current working directory, refer to this with a .
% to ensure proper path detection later on
PathName = '.';
end
FileName = [FileName, Extension];
PathName ... |
e665f1640c5bdcc6859c434cebab319029983f48bd65a729313adeeb15c142c5 | MATLAB | 11,255 | 318 | function [ subject ] = nmri_load_subject_stamps( subject, params )
%[ subject ] = nmri_load_subject_stamps( subject , params )
% Will load subject struct from the stamps/log directory and unified
% cache in subjec conf
% check time
runT=now;
% check if subject struct is okay
if ~isfield(subject,'id') || ~isfield(... |
e84ab95cb8ba04c8f9bb0635b5dbf1caae628ef7657396fce9ed024ef5bd2e7e | MATLAB | 11,255 | 312 | function [S,h,PDC,COH,DTF,DC,pCOH,dDTF,ffDTF, pCOH2, PDCF, coh,GGC,Af,GPDC]=mvfreqz_faster(B,A,C,N,Fs)
% MVFREQZ multivariate frequency response
% [S,h,PDC,COH,DTF,DC,pCOH,dDTF,ffDTF,pCOH2,PDCF,coh,GGC,Af,GPDC] = mvfreqz(B,A,C,f,Fs)
% [...] = mvfreqz(B,A,C,N,Fs)
%
% INPUT:
% =======
% A, B multivariate polynomials... |
6f858e4e5e4805df25122321e086fd722f6ff8e770b6ed4bb12dcfe41408ed76 | MATLAB | 11,276 | 317 | function run_lassoglm_grid_aa1(param1Name, param1Vals, param2Name, param2Vals, seeds, outdir)
% RUN_LASSOGLM_GRID Sweep two parameters and seeds, run full pipeline in parallel, aggregate metrics.
% Usage:
% run_lassoglm_grid('sparsityval', 0.05:0.05:0.30, 'snr_dbval', 0:5:10, 1:10, 'test_out')
%
% Notes:
% - This v... |
8f8c9c1333e0b9329daa86bbe2c942b293e6627882825443694b5f23a0903b95 | MATLAB | 11,281 | 238 | set_up_paths_and_data_directories;
bold_suffix = 'space-MNI_desc-ppres_bold.nii';
tr_length = 1.3;
stim_names = {
'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ...
'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ...
'Superhero', 'Tears_of_St... |
a34f0b88845cb974faefb3caa2e655b233e229de48ae22b9be4b2e37f861271b | MATLAB | 11,282 | 300 | function [] = StandardisedNetworkPlotNodeColourMap2(adjM, coords, edge_thresh, z2, z2name, plotType, FN, Params)
%{
% script to plot the graph network
%
Parameters
----------
% adjM - adjacency matrix
% coords - electrode/node coordinates (x and y, num nodes * 2)
% edge_thresh - a value between 0 and 1... |
3f73a1de0fd826e9df1702c73a290d927d0c20c6fffda1ad676de85035609c97 | MATLAB | 11,286 | 210 | function [freezing,quietWake,SWS,REM,movement] = behavioralStates(corticalLFP,hpcLFP,speed,speedTreshold,varargin)
% behavioralStates determines freezing, quiet wakefulness, slow wave sleep, and REM sleep based
% on animal motor activity and LFP.
%
% USAGE
%
% [freezing,quietWake,SWS,REM... |
07e76fad0a99e6f048d46e43176b5f7ce2c214286cf54c12b7d48ccaf9591486 | MATLAB | 11,291 | 362 | function [err, Qd, s, termname, nterms, sindices, dfbothSS, modw, modwo, tnames, dfterm, dfe, Contr] = PreProc(n, NF, group, varnames, FL, Contr, cov, unbalanced)
%
% [err, Qd, Rd, sindices, dfboth, modw, modwo, dfx] = PreProc(n,group,varnames)
%
%Purpose:
%
% Returns QR decomposition results for the design matrix p... |
a8cb8ee69846608db44c2f1d1b8d32cec159dbcf457e5ea9b531587a9fc2689a | MATLAB | 11,298 | 318 | function [p,gof]=plpva(x, xmin, varargin)
% PLPVA calculates the p-value for the given power-law fit to some data.
% Source: http://www.santafe.edu/~aaronc/powerlaws/
%
% PLPVA(x, xmin) takes data x and given lower cutoff for the power-law
% behavior xmin and computes the corresponding p-value for the
% Ko... |
e0f7aad483a7809d629dcc72de708112032b71769f27e6230eba48c3c3f10c7b | MATLAB | 11,299 | 342 | function [hubBoundaryWMdDeg, periPartCoef, proHubpartCoef, nonHubconnectorPartCoef, connectorHubPartCoef] = ...
TrialLandscapeDensity(Params, ExpName, experimentMatFileFolder, fig_folder, add_fig_info, cartographyLagVal, oneFigureHandle)
% TrialLandscapeDensity calculates and plots the distribution
% of Within-mod... |
377f9cb703087f76cf34fe773e42fb360ddbb017aea6beb4f4df83a1dae32ab1 | MATLAB | 11,313 | 257 | %PRINT2EPS Prints figures to eps with improved line styles
%
% Examples:
% print2eps filename
% print2eps(filename, fig_handle)
% print2eps(filename, fig_handle, bb_padding)
% print2eps(filename, fig_handle, bb_padding, options)
%
% This function saves a figure as an eps file, with two improvements over
% MATL... |
7e517076756925e3d6bfa7263d2fd228561b7948a3ec6a73498a5ad0eb6559ad | MATLAB | 11,315 | 266 | % pop_multifit() - fit multiple component dipoles using DIPFIT
%
% Usage:
% >> EEG = pop_multifit(EEG); % pop-up graphical interface
% >> EEG = pop_multifit(EEG, comps, 'key', 'val', ...);
%
% Inputs:
% EEG - input EEGLAB dataset.
% comps - indices component to fit. Empty is all components.
%... |
9087ec7527524444e9ccc253f05653bc98d0671185c92311a67a9f3cc32f481d | MATLAB | 11,316 | 418 | function [Model, Info] = linear_sparse_space(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% in original input space (not for delay embedding space)
% is imposed to get sparse weight matrix
%
% Notice !!
% Delay emb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.