sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f88840af146930e119676d1b860fea72ee9bc3ae538d6b8f0b3451cb59596fcc | MATLAB | 11,319 | 263 | load('pooldata_SinGrat.mat', 'pooldata','name1','areaID')
load('pooldata_pupiltrack.mat')
Dir = [0, 135, 270, 45, 180, 315, 90, 225];
[DirSort, DirInd] = sort(Dir);
stimPara = ...
[8 0.16;
2 0.02;
8 0.02;
1 0.02;
1 0.16;
2 0.16;
8 0.04;
2 0.04;
1 0.04];
stimflag = [repmat(Dir',9,1)/360*2*pi, reshape(repmat(stimPar... |
6f7462d77c98ba1a9ea1c5e7a794bc9504d782186cdd04648ae96d502c9fd0ed | MATLAB | 11,325 | 412 | function [Model, Info] = linear_sparse_space_vec(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
% Noize variance for each ... |
5daca9a7601edc37209bcbc6f28f31522106b9995b94ad5a60e778fa968d3909 | MATLAB | 11,328 | 317 | function Pupil_analysis(path_to_data)
% Get the path to the pupil and behaviour data, calculates the relevant
% variables and plots figures.
%
% Kakaei, Schlecht, Hauser 2025
%
% See also Behaviour_analysis
if nargin<1
path_to_data = pwd;
end
for exper = 1:2 % experiment counter
if exper==1
arms = 3; ... |
7d742b5d23dbfc8052e0fd7f9692a78ec271c1572626218cdd02485ab30540a7 | MATLAB | 11,332 | 467 | function [C,T]=hungarian(A)
% HUNGARIAN - Solve the assignment problem using the Hungarian method.
%
% Usage: >> [C,T]=hungarian(A)
%
% Inputs:
% A - a square (correlation/distance/cost) matrix.
% C - the optimal assignment (closest row/col pairs)
% T - the total (minimized) cost of the optimal assignment.
%
% ... |
3c4ac3f76307ecbb425b56e210e145c1739736474bd50149f3256d7e4e0cba9e | MATLAB | 11,333 | 349 | % DIJKSTRA Calculate Minimum Costs and Paths using Dijkstra's Algorithm
%
% Filename: dijkstra.m
%
% Description: Given vertices and edge connections for a graph (represented by
% either adjacency matrix or edge list) and edge costs that are greater
% than zero, this function computes the shortest path from... |
acdcf89daccf74bd831d1a43066d68cb081b59b99da2deb648b623f22ef08122 | MATLAB | 11,334 | 334 | function [yp, best] = PP_PreProcess(y, chooseBest, order, beatThis, doSpectral, randomSeed)
% PP_PreProcess Returns a bunch of time series, preprocessed in different ways.
%
% ---INPUTS:
% y, the input time series
%
% chooseBest: (i) '' (empty): the function returns a structure, yp, of all
% preproces... |
18ebcf5999734b8f8a24cc6808d5de946392f4a7dd42334eb93ab1aee5b7ae2b | MATLAB | 11,335 | 414 | function DB = Meta_Logistic(DB,varargin)
% DB = Meta_Logistic(DB,[verbose],[mask image name],[control strings])
%
% NEEDS:
%
% to set up design:
%DB.(fields) % lists of fields containing task conditions for each coordinate point
%DB.pointind % indices of which coord points are in which unique
% cont... |
0eaa55e7d5eeab2abc3c1b9162f89025c7b9bc09f201c15670c8d0b092ded151 | MATLAB | 11,340 | 253 | % POP_REJCHANSPEC - reject artifacts channels in an EEG dataset using
% channel spectrum. The average spectrum for all selected
% is computed and a threshold is applied.
%
% Usage:
% >> pop_rejchanspec( INEEG ) % pop-up interactive window mode
% >> [OUTEEG, indelec] = pop_rejchans... |
c6d4c062878befc4fcfc35ff04f1d2268d2db9e8032a5736d8c629df11c885d3 | MATLAB | 11,341 | 286 | % Script demo_fmri_qa
% Performs quality assurance analysis on raw fMRI time series
%
% See also MrImage MrSeries
% Author: Sandra Iglesias & Lars Kasper
% Created: 2015-08-13
% Copyright (C) 2015 Institute for Biomedical Engineering
% University of Zurich and ETH Zurich
%
% This file is part of... |
ea8c8bd377961962be7b632bad96e54d05682d151c61b135e3af81c5b5974878 | MATLAB | 11,344 | 437 | function [y,t,optw,gs,C,confb95,yb] = ssvkernel(x,tin)
% [y,t,optw,gs,C,confb95,yb] = ssvkernel(x,t,W)
%
% Function `ssvkernel' returns an optimized kernel density estimate
% using a Gauss kernel function with bandwidths locally adapted to data.
%
% Examples:
% >> x = 0.5-0.5*log(rand(1,1e3)); t = linspace(0,3,500);
%... |
6859db154aca3b24c4e10604db3cfa8ba7260f10cc6560100cc26cdf56d4b99c | MATLAB | 11,370 | 289 | function [f,handles] = TS_Plot2d(featureData,TimeSeries,featureLabels,annotateParams,...
showDistr,cfnParams)
% TS_Plot2d Plot a dataset in a two-dimensional space.
%
% e.g., The space of two chosen features, or two principal components.
%
%---INPUTS:
% featureData, an Nx2 ... |
38f8d57d0ed2e2acc3aaeb4187a1a93f2d9851eb85bc9f4a01df0238e756c9b0 | MATLAB | 11,373 | 306 | %% The McsHDF5 Matlab tools
% This document gives a short explanation of the usage of the McsHDF5
% Matlab tools.
%% Adding the package base bath
% If you have download the package as a .zip file, you will need to add the
% base path of the +McsHDF5 folder to your matlab path after extracting the
% .zip file. T... |
c4677a1211f4c72657ea38720c53355acced80f6652343a2d9bda819eb2f3655 | MATLAB | 11,399 | 219 | function [X, fX, i] = minimize(X, f, length, varargin)
% Minimize a differentiable multivariate function using conjugate gradients.
%
% Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to the functi... |
eebe1c965a1c4739b3a8f582037cc911831e73e7a0d76214d335dc8bdd75e040 | MATLAB | 11,399 | 333 | function low_rank_tensor_completion()
% 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 ... |
f601db462cdada94e5a1d402661c1ec199b4c9ae1ae36997f9a55405e42dabce | MATLAB | 11,406 | 259 | % writeeeg - Generating CNT/EDF/BDF/GDF-files using BIOSIG toolbox. Note
% that the CNT file format is not fully functional. See also the
% writecnt.m Matlab function (there is no fully working
% Neuroscan writing function to our knowledge).
%
% writeeeg( filename, data, srate, 'key', ... |
fef10feb1954f01e688c0350dc051ff93074601dd4d9d552cfe0ae35fe042f3f | MATLAB | 11,409 | 274 | %function poolSubjects_brain3D(params, groupInfo)
% plots 3D brain & activations (ERP + freq.band + spectra)
% pools together subject processed by a given job
% settings (subjects, directory names, ...) are stored in 'params'
% (c) Jiri, Apr18
disp('Plotting channels: 3D brain & activations ...');
%% camera views: ... |
3b36f739156c09c9fb536eb7fe2f1b2ec45dda2e97312ad7afe9b4d041b80226 | MATLAB | 11,418 | 314 | function nf_batch_segment_new(files,outdir,def_field,bias,native,imported,unmodulated,modulated,cfg)
% function nf_batch_segment_new(files,outdir,def_field,bias,native,imported,unmodulated,modulated)
% Segements a batch of images with defaults otions
% Uses NEW segment (SPM8 + SPM12 only)
%
% files = char array... |
9cc9759a1457ba89c4c80c525affc24abbedecc3c28582b93e34c3de1463158e | MATLAB | 11,425 | 225 | function [post nlZ dnlZ] = infMCMC(hyp, mean, cov, lik, x, y, par)
% Markov Chain Monte Carlo (MCMC) sampling from posterior and
% Annealed Importance Sampling (AIS) for marginal likelihood estimation.
%
% The algorithms are not to be used as a black box, since the acceptance rate
% of the samplers need to be careful... |
6d233b0fcf7a135a8315ab5e206117a2f449b11a51a3430662fdfec1c96fc921 | MATLAB | 11,447 | 285 | function PlotExtendedData3(datadir, codedir)
%PlotExtendedData1 - Plots Extended Data 3.
% INPUTS:
% datadir - Local directory where ProcessData_ExtendedData3.mat was saved after running ProcessData_ExtendedData3
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = pa... |
86e13a483f68a01a767c558518dfa107c92fb55f2b3bd363874cce5ef1fb8b33 | MATLAB | 11,447 | 250 | %% ============================================================
% Main correlation analysis script
% - Aggregate spike trains across electrodes
% - Compute population firing-rate time series
% - Estimate inter-organoid and intra-organoid correlations
% ============================================================
... |
5ff5b9baf85adba7d560fa829ad408e4cba365e6f7cc23da9cdee68927ff302c | MATLAB | 11,450 | 324 | function B = jadeR(X,m)
% JADER - blind separation of real signals using JADE (v1.5, Dec. 1997).
%
% Usage:
% >> B = jader(X);
% >> B = jader(X,m);
%
% Notes:
% 1) If X is an nxT data matrix (n sensors, T samples) then
% B=jader(X) is a nxn separating matrix such that S=B*X is an nxT
% matrix of estimate... |
57c5db5481e333cd7a401ba4b22bd4d164bbeffe3b8acd0439fc6a2ffdb2c4ce | MATLAB | 11,454 | 233 | function [out] = TerminalOpt(outputDir,outFile,index_1,index_2, optim_method, organ)
% addpath(genpath(path));
switch optim_method
case 1
Bsets{1} = [0, 200, 500];
Bsets{2} = [0, 10, 20, 100, 200, 500];
Bsets{3} = [0, 200, 800];
Bsets{4} = [0, 30, 70,... |
cee70f35015c7a32228162f5d7b7c2a378606fbba1ace03b95ba214511d46435 | MATLAB | 11,459 | 251 | function out = SP_Bicoherence(y, segLength, maxN, numSurr)
% SP_Bicoherence Squared bicoherence of a time series
%
% Estimates the bicoherence, a normalized bispectrum, using the standard
% segment-averaging (indirect FFT) method: the series is split into
% overlapping segments (50% overlap, as many as fit), each seg... |
29aa86ce9b51013c60dc0d4b0208e201b27b8130bc743d9f37cadebebe213a68 | MATLAB | 11,467 | 267 | function out = NL_RecurrenceTimes(y, tau, m, theilerWin, rr, numSegments, maxN, randomSeed)
% NL_RecurrenceTimes Recurrence-time statistics from a recurrence plot
%
% Embeds the time series in an m-dimensional delay space and characterizes
% the *white* vertical structures of the resulting recurrence plot -- the
% g... |
fe660f5f6d8035f9464b9a94e7f2a8e93b943c1ae17e64f5cb33ccb86d15a2e2 | MATLAB | 11,470 | 313 | %% inputNIFTIcell = read_bids_to_filelist(inputDir,outputPrefix)
%
% Input
% --------------
% inputDir : input directory with BIDS
% outputPrefix : full output basename
%
% Output
% --------------
% inputNIFTIList: file list for SEPIA
%
% Description: This script (1) reads BIDS compatible input directory to a fi... |
0917e12bde4861e10289ccd28d1f5a375465c8443b0c48530343659c47fdc4c6 | MATLAB | 11,481 | 496 | function Pipeline_plotOptoData(params, plt)
% This function plots data from the Voltron + ChR2 co-expression
% experiments
analysisDir = getAnalysisDir(params);
ExpInfoFn = getFileName(params, 'ExpInfo');
tsFn = getFileName(params, 'TS');
wsFn = getFileName(params, 'WSData');
snipFn = getFileName(params, 'Snip');
lo... |
2d2907bd956e1cb35f7ba47f41c6c81aac5e9a36d252b8dbd8d2ba2823f757a7 | MATLAB | 11,489 | 312 | % io_LCMBasis.m
% Helge Zollner, Johns Hopkins University 2020.
%
% USAGE:
% [BASIS] = io_LCMBasis(LCMBasisSet, addMMFlag, sequence, editTarget)
%
% DESCRIPTION:
% Generates a basis set in FID-A structure. The code reads the LCM
% .BASIS-file and generates a Osprey compatible basis set. The output
% BASIS file will b... |
1507216cbe04ebfdfc52bb4cd1596ecd3e576771b4f982b6041104188d698188 | MATLAB | 11,495 | 224 | close all
clear
clc
% dataDir = '/Volumes/Scratch_abaram/shirley/alon/beh/training';
dataDir = '/vols/Scratch/abaram/shirley/alon/beh/training';
load(fullfile(dataDir,'allTrainingData.mat'),'D');
nSub = length(D.middle.hex_day1_ratioCorrect);
figure
%% is in middle task
% plot all datapoints
subplot(2,3,1)
hold o... |
87181dba9efa7470cd8632afe30cd06a38220d0e2d10c9f6af7c40102a121004 | MATLAB | 11,500 | 438 | function niml_cell = afni_niml_parse(s)
% Simple parsing routine for AFNI NIML datasets
%
% N=AFNI_NIML_PARSE(S) parses the niml string S and returns a parsed
% structure P.
%
% P can either be an niml element, or a group of niml elements. In the
% formder case, P contains a field .data; in the latter, a cell .nodes.
%... |
f013ad6b1adbe377da617d97978ae76eaff17be5548a08ccce6e4d803803f0b7 | MATLAB | 11,506 | 357 | % DB = Meta_Setup(DB, [radius_mm], [con_dens_images])
% Set up Meta-analysis dataset
%
% use after read_database.m
% See the Manual for more complete information.
%
% Special Fields
%
% Subjects or N : sample size
% FixedRandom : fixed or random effects
% SubjectiveWeights : weighting vector based on FixedRan... |
e8896864d8fabb36a6957b1543e5bfc075e9cfde586455066ee60223e7c7bfe8 | MATLAB | 11,519 | 322 | function [c, r, t, cpulse, verbose] = ...
tapas_physio_read_physlogfiles_siemens(log_files, cardiac_modality, verbose, varargin)
% reads out physiological time series and timing vector for Siemens
% logfiles of peripheral cardiac monitoring (ECG/Breathing Belt or
% pulse oximetry)
%
% [cpulse, rpulse, t, c] = tap... |
3c36579456408d5033b707802458ce161d113add166525890c03a194427644f7 | MATLAB | 11,520 | 360 | function [ltom, htom, mtol, mtoh, ltom_incong, htom_incong, sems, ...
mtol5, mtol10, mtoh40, mtoh80,...
ltom40, ltom80, htom5, htom10,...
ltom_incong40,ltom_incong80, htom_incong5, htom_incong10] =...
block_dynamics_wt(A, twin, smoothfactor, varargin)
%computes the change in z-scored wait time, normaliz... |
ed1c649affea4c02d9ea6b9e9da45e4d8a9590da700c3d16bade3fb34353c544 | MATLAB | 11,521 | 369 | //========================================================================
// GLFW 3.4 macOS - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided 'as-is', without any express or implied
// ... |
811419cbfc1caefe740afc6e400aa37be4ca3e7f1499c714d9643d181a8de359 | MATLAB | 11,525 | 208 | % EEGLAB cross-platform compiling script
% should be run on a newly checked out EEGLAB version as
% some folder are temporarily modified
%
% Arnaud Delorme - August 3rd, 2009
% Copyright (C) 2009 Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistr... |
f0fd236b2da75116c70a83378207d8afeb5f5bb47adb37172cbb1b7644414a3d | MATLAB | 11,530 | 382 | function [mixedsig, mixedfilters, CovEvals, covtrace, movm, ...
movtm] = CellsortPCA(fn, flims, nPCs, dsamp, outputdir, badframes)
% [mixedsig, mixedfilters, CovEvals, covtrace, movm, movtm] = CellsortPCA(fn, flims, nPCs, dsamp, outputdir, badframes)
%
% CELLSORT
% Read TIFF movie data and perform singular-value de... |
c33d12eefe002e3aa6b539805ac4eab449de26b2953306dec84e0c1fb0bf1bc4 | MATLAB | 11,545 | 270 | function [fig] = plot(str, cfg, varargin)
% plot function for a McsCmosSpikeSorterUnit object
%
% function plot(str, cfg, varargin)
%
% Produces a time series plot for each identified unit in the object.
%
% Input:
%
% str - A McsCmosSpikeSorterUnit object
%
% cfg - Either emp... |
32ce66486f6cbe682a92978b671b61b26852a7ac18cda87cd6e96cb9d7d08556 | MATLAB | 11,547 | 406 | % Helpful link = http://web.mit.edu/hst.583/www/LABS/lab5b_manual.pdf
% What I need to do - convolve each person's task timeseries with the HRF.
% I can read in each peron's EV text file, make a boxcar function with it,
% convolve i
% t with the HRF, then look at brain states during periods of
% task.
addpath(... |
487b2fe98f3829a363f3a55b93593fbd56718498ac9b2595887d152cfe7897ed | MATLAB | 11,549 | 314 | function out = DN_CompareKSFit(x, whatDistn)
% DN_CompareKSFit Fits a distribution to data.
%
% Returns simple statistics on the discrepancy between the
% kernel-smoothed distribution of the time-series values, and the distribution
% fitted to it by some model: Gaussian (using normfifit from Matlab's
% Statistics... |
e25adc488d15f6666631042bafb2351a518d3b0c57abbab27fe2b9286c0fe4ee | MATLAB | 11,549 | 347 | function spindleDetection_wavelet(basename,varargin)
% Sullivan Mizuseki Sorgi Buzsaki 2014 J Neurosci
%
% Spindles were detected via the following procedure, which is essentially the same as described by Johnson et al. (2010)
% (1) the maximum normalized wavelet power in frequencies between 9.27 and 17.34 Hz for ever... |
1eeda0c24f0af3aa0fb9dd4b2949a01324c3afa6100dcd53adab0ac44026a1eb | MATLAB | 11,570 | 428 | %% [freeEnergyFull, feAux] = tapas_huge_nfe( counts, priors, posterior, feAux, listSubjects )
%
% Calculates or updates negative free energy (NFE) for HUGE.
%
% INPUT:
% counts - number of parameters and subjects
% priors - parameters of prior distribution
% posterior - parameters of ... |
4d693e671c4b81102c2c294d853828501b6d25b72b12c0d74b614e07f03e5b60 | MATLAB | 11,591 | 329 |
%% Load procData
% FV
load('procData/procData_Fam_FV_HC_Final.mat');
HC_Fam_FV_Real = procData;
load('procData/procData_Fam_FV_IT_Final.mat');
IT_Fam_FV_Real = procData;
load('procData/procData_Lure_FV_HC_Final.mat');
HC_Lure_FV_Real = procData;
load('procData/procData_Lure_FV_IT_Final.mat');
IT_Lure_FV_Real = proc... |
6d27e29151ff0db03718ffc144e8642d49eee52e0e3107f8b20095e5c53df451 | MATLAB | 11,598 | 316 | function make_mne_freesurfer_like(input_img, num_vertices)
%MAKE_MNE_FREESURFER_LIKE
% Create an MNE/FreeSurfer-like folder structure from a segmented MRI:
%
% Inputs:
% input_img : path to the original MRI (NIfTI)
% num_vertices : integer used in the bnd4_<num_vertices>_corrected.mat
%
% Assumes:
... |
becc43c579a4a263a232a3eaa7aec3e3de4fc2b88a09b54147cb9c6bc7ce4569 | MATLAB | 11,605 | 262 | function params = preprocWavelets_grid_GetMetaParams(Arg)
% Usage: params = preprocWavelets_grid_GetMetaParams(Arg)
%
% Returns parameter set for a preprocWavelets_grid. The parameters
% specified by setting Arg to 2 are the parameters used to compute
% motion energy in Nishimoto et al (2011); Arg = 1 is a similar mod... |
a73ceea635dfcfe9abb0dee0478cdeaac81ac2d40cea0be3d805bd165f87bf33 | MATLAB | 11,606 | 197 | classdef MotorNeuronPool
%
% Copyright 2025 Laura Schmid
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the
% “Software”), to deal in the Software without restriction, including
% without limitation the rights to use, copy, m... |
23075a2c9bcf72c606fe95994d0351b94b51fabf1db581beab00f35aac87c654 | MATLAB | 11,610 | 335 | function y = vl_nnloss(x,c,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. The... |
4ececdc490fd4213794b75a15183a4a89e4ec8621f0f463d7d6d677642ac95e0 | MATLAB | 11,610 | 350 | function plotFigureS5_muscimolModelsSupp(behaviorPath)
% Plot figure S5. Simulate other versions of the inference model.
%INPUTS:
% behaviorPath = path to behavior data from all 349 rats
%% paths
load(strcat(behaviorPath, 'ratList.mat')); %list of rat data to use for model simulations
A = load(strcat(behaviorPath,... |
feb16197a524130aa325d26a27c6c6c6240dda6ac7aba2f9dcca0a7706ae6827 | MATLAB | 11,612 | 325 | function transformeddata = nsd_mapdata(subjix,sourcespace,targetspace,sourcedata,interptype,badval,outputfile,outputclass,fsdir)
% function transformeddata = nsd_mapdata(subjix,sourcespace,targetspace,sourcedata,interptype,badval,outputfile,outputclass,fsdir)
%
% <subjix> is the subject number 1-8
% <sourcespace> is a... |
85f7a1d896750cccbd23bdc161898875f90ce8a398d57356772637706b1d0241 | MATLAB | 11,624 | 333 | function varargout = dotPlot(S)
% function varargout = dotPlot(S)
% dotPlot - Doesn't plot box plots!
%
% based on: function notBoxPlot(y,x,jitter)
%
%
% Purpose
% An alternative to a box plot, where the focus is on showing raw
% data. Plots columns of y as different groups located at points
% along the x axis defined ... |
50761d4122ce7f6a3993509fd8bc2b5f71b6e137f796312cddbfa5bc2f663d63 | MATLAB | 11,656 | 221 | function PlotRippleStats(r,m,d,s,varargin)
%PlotRippleStats - Plot descriptive stats for ripples (100~200Hz oscillations).
%
% USAGE
%
% PlotRippleStats(ripples,maps,data,stats,<options>)
%
% Use the ouputs of <a href="matlab:help RippleStats">RippleStats</a> as input parameters. Using cell arrays of
% repea... |
d17de450095c651818ad345a5d8129dbecbefafaa09ba451379347614b480304 | MATLAB | 11,664 | 330 | function map = Map(v,z,varargin)
% Map z on (x,y) where x, y and z are time-varying variables (samples).
%
% Compute a continuous map, where one time-varying variable z is represented
% as a function of one or two time-varying variables x and y. The variable z
% can either be a point process (typically, a list of s... |
f41be0ce5b271594ddb85ccea00ed4f5320ef31b484c873aec8a9b83fd153a48 | MATLAB | 11,667 | 234 | % ----------------------------------------------------------------------- %
% Preprocessing of the NSD eye tracking data. M.N. July, 2021
% The following preprocessing steps are performed.
%
% EDF to ASCII conversion (requires edf2asci.exe on windows)
% Blink removal
% Temporal alignment to fMRI session
% Pixel to visu... |
1b8097696f171d5677f36fd69d7a8cc57ae9b8307fbb1a6ad7bdefa96748c27e | MATLAB | 11,670 | 223 | function sero_srr_simulation_1D_v2(snrRange, nObj, nSims, ar, reg_str, mode, checkpointFileInput)
% sero_srr_simulation_1D_v2 runs simulations over a range of SNR values, objects, and inner simulations.
%
% Inputs:
% snrRange - Array of SNR values to simulate.
% nObj - Number of simula... |
32f86c12799b6ac3720eb9f82894d0f055a9c4ecaf388ef64f27e10b3decc5d1 | MATLAB | 11,673 | 252 | %% extract the beta parameters in each clusters.
% use each mask - mt, mst from GLASSER ATLAS on tactile motion Localizer
% take the avg of beta values from the roi
% (1)lmst- motion_beta and (2) lmst -static_beta
% across two runs
clear
% roiType = 'subjectSphere';
% radiusNb='8';
taskName= 'tactileLocalizer2';
s... |
77f3639fc64b4e1f125e42d26bafd2a3994e23d10c2d75c2de22934d9ce8e91a | MATLAB | 11,674 | 386 | function [ obj ] = import( obj, listDcms, listConfounds, omit, bAppend )
% Import fMRI time series data into HUGE object.
%
% WARNING: Importing data into a HUGE object will delete any data and
% results which are already stored in that object.
%
% INPUTS:
% obj - A tapas_Huge object.
% dcms - A cell array ... |
ca1037e15a249d77a9ca3dd7f0e8a47081193960892c44bffdca21683c8dc1f0 | MATLAB | 11,684 | 279 | 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 o... |
5541223351ae9495e6193ed4a798d219fd0754aa276c138939af41fe89f58abb | MATLAB | 11,688 | 322 |
% breakyaxes splits data in an axes so that data is in a low and high pane.
%
% breakYAxes(splitYLim) splitYLim is a 2 element vector containing a range
% of y values from splitYLim(1) to splitYLim(2) to remove from the axes.
% They must be within the current yLimis of the axes.
%
% breakYAxes(splitYLim,splitH... |
6a46443728d3c3fbf5c6657831115b2594dbe083294e753f40674810fc25372f | MATLAB | 11,689 | 313 | function out = SC_MMA(y, doOverlap, scaleRange, qRange)
% SC_MMA Physionet implementation of multiscale multifractal analysis
%
% Scale-dependent estimates of multifractal scaling in a time series.
% ------------------------------------------------------------------------------
% Modified by Ben Fulcher for use in h... |
1ae75691c51eff8bba4e3e226af891af804a97cca85a94f5e7e8aac2b3befc19 | MATLAB | 11,696 | 332 | function out = MF_GP_LocalPrediction(y, covFunc, numTrain, numTest, numPreds, pmode, randomSeed)
% MF_GP_LocalPrediction Gaussian Process time-series model for local prediction.
%
% Fits a given Gaussian Process model to a section of the time series and uses
% it to predict to the subsequent datapoint.
%
% ---INPUT... |
e9e46d248771661ee873d30eaf99a88f5eb4571e65b3c11d38d35f9504f0eec7 | MATLAB | 11,702 | 237 | function [options] = getOptions(options,inputArgs,varargin)
% Gets default options for a function, replaces with inputArgs inputs if they are present.
% Biafra Ahanonu
% started: 2013.11.04
%
% inputs
% options - structure with options
% inputArgs - an even numbered cell array, with {'op... |
d572b153f51a62a2b540cf42ebb6d18dcb784ded9199991467769813c8a25397 | MATLAB | 11,721 | 312 | function [] = plotAnalysis02G(saveFigures)
% Produces plots to visualize the results of analysis02G.
% save figures by default
if nargin==0
saveFigures = true;
end
% get file paths
paths = addPaths();
%% anaylsis02G2
% results of this part of the analysis produce plots
analysisName = 'analysis02G2';
% load res... |
72ddb1d35101d405887674ecad9fca026d975cbeff30b8d5d7022f1ffd06d311 | MATLAB | 11,723 | 329 | function [ripples,sd,bad] = FindRipples(filtered,varargin)
%FindRipples - Find hippocampal ripples (100~200Hz oscillations).
%
% USAGE
%
% [ripples,stdev,noise] = FindRipples(filtered,<options>)
%
% Ripples are detected using the normalized squared signal (NSS) by
% thresholding the baseline, merging neighbo... |
a1d50c17fc2dcca4e7b5303b94af3ac652e96876b212f4854199107d19b206b5 | MATLAB | 11,739 | 322 | function verbose = tapas_physio_review(physio, newVerboseLevel)
% Reviews performance of PhysIO (recreating output plots and text)
% after running tapas_physio_main_create_regressors
%
% verbose = tapas_physio_review(physio, newVerboseLevel)
%
% NOTE: Change physio.verbose.level before running this function to get
% ... |
71afb742df91bcc01f6934ed7ec8194a9e0c75dc9ec8e539e9ae8a78b1142a98 | MATLAB | 11,745 | 290 | function align_axislabel(~,ax)
% This function first rotates x, y and z labels to the direction of their
% corresponding axes when a rotate operation has finished. So that labels
% will be parallel to axes. Then, moves the axis labels to a proper
% distance from the axes by calling 'axislabel_translation'.
% Th... |
1d7286455c0b9dee2b4028e90315cbc133153f44ffc9d63df3f2d8b4ed7dd4a5 | MATLAB | 11,746 | 260 | %% extract the beta parameters from ROIS
% spherical functional roi
% use subkect masks - lS1, lPC, rPC, lMTt, rMTt, lhMT, rhMT
% VISUAL MOTION LOCALIZER
% take the avg of beta values from the roi
% example (1)lPC- motion_beta and (2) rPC -static_beta
% across two runs
clear
roiType = 'subjectSphere';
radiusNb='8'... |
fafefd0a4244f16184a811b9bf9e5248049a77b3f7525ad57f1a0efcffdaa0e0 | MATLAB | 11,753 | 272 | % STD_CREATECLUST - dreate a new empty cluster. After creation, components
% may be (re)assigned to it using STD_MOVECOMP.
% Usage:
% >> [STUDY] = std_createclust(STUDY, ALLEEG, 'key', val);
% Inputs:
% STUDY - STUDY set comprising some or all of the EEG datasets in ALLEE... |
c6a5e873512a9db39d9c55432ad37905f220148574c5e044ce759ed2bb81f1c5 | MATLAB | 11,754 | 300 | % EEGMOVIE - Compile and view a Matlab movie.
% Uses scripts EEGPLOTOLD and TOPOPLOT.
% Use SEEMOVIE to display the movie.
% Usage:
% >> [Movie,Colormap] = eegmovie(data,srate,elec_locs, 'key', val, ...);
%
% Or legacy call
% >> [Movie,Colormap] = eegmovie(data,srate,elec_locs,title,moviefram... |
94fa597a0712bc8c29b1ef6f4683eb8b3948e5a9184d0bb2a8887bf0c0bc12c6 | MATLAB | 11,764 | 247 | function [outdata,outstate] = 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 functi... |
2a271827adbef71efce1cbecff159216ace07623424f0a7446ea9f4649e404fe | MATLAB | 11,769 | 374 | %% Figure 4
%% 1.1 SA ~ Status
clc; clear; close all
load data
data = dataStatus;
clearvars -except data*
measure = '_Area';
IV = '~ Status';
covariates = ' + Age + IQ + eTIV';
covariatesN = count(covariates, '+') + 1;
measureOfInterest = strfind(data.Properties.VariableNames, measure);
measureOfInterestID = fin... |
31c06150e6e940df96ca6e4fc1093dd9af8374e84aaacac5c31c9d82199fdf80 | MATLAB | 11,773 | 235 | % POP_INTERP - interpolate data channels
%
% Usage: EEGOUT = pop_interp(EEG, badchans, method, t_range);
%
% Inputs:
% EEG - EEGLAB dataset
% badchans - [integer array] indices of channels to interpolate.
% For instance, these channels might be bad.
% [chanlocs structure] cha... |
70b368683ddd78a6ad5c3fd5645ed2d9e7c96afcde4f3e2b7aa9b45f8831e5a2 | MATLAB | 11,774 | 342 | function [h,stats] = CompareDistributions(group1,group2,varargin)
%CompareDistributions - Compare two N-dimensional distributions (e.g. prospective place fields).
%
% This non-parametric test determines in which dimensions two distributions are
% significantly different. For example, the two distributions could be
%... |
f1e1d663d47d2108b4866a29b3161b5c2738a760c49fb147784064e48e9b75ce | MATLAB | 11,787 | 292 | function PlotExtendedData5(datadir, codedir)
%PlotExtendedData5 - Plots Extended Data 5.
% INPUTS:
% datadir - Local directory where ProcessData_ExtendedData5.mat was saved after running ProcessData_ExtendedData5
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = pa... |
030abefb793f653b19a919fb64150ff5dbae11723316182c66285e305306263c | MATLAB | 11,799 | 265 | function simHandMuscleSystem()
clear all
close all hidden
global mdl mdlWks sampFreq triggerTime aGainRate
outDataFolder = 'outData';
outFigFolder = 'outFigs';
if ~exist(outDataFolder, 'dir')
mkdir(outDataFolder);
end
if ~exist(outFigFolder, 'dir')
mkdir(outFigFolder);
end
sampFreq = 1000;
[emgFile, dataLabe... |
0542025a528a0aa010b84c419913cfe02b7d763feb94ff06e96abbca82a83630 | MATLAB | 11,799 | 261 | function [params] = tapas_BLT_initParams(expMode)
% Initialise parameters for BLT
params.task = 'BLT';
params.expMode = expMode;
% ________________________________________________________________________%
%
% Setup
% _____________________________________________________________________... |
28d9f0b9a64e38e927f60232e6d1d78c4cfb5f51bcbed5575a4207ab2173dbfc | MATLAB | 11,813 | 318 | function [fitParamsStep3,out] = fit_Osprey_SplineOnly(dataToFit, minKnotSpacingPPM, fitRangePPM)
%% [fitParamsStep1] = fit_Osprey_PrelimReduced(dataToFit, minKnotSpacingPPM, fitRangePPM)
% Performs the first step of the LCModel preliminary analysis
% analogous to the LCModel algorithm. The algorithm is described in... |
a777a6aa4d48e3e0ee92a7edf6da46fc8b3b0c88c7250d3a8113d9c7f8fc60df | MATLAB | 11,816 | 352 | function [res, Std_index_CATMoS, localY_index_CATMoS, nnConfDiag] = catmos_neighbor_conf_adjust(res,i,CATMOS,neighborsIDs,neighborsW,varargin)
%CATMOS_NEIGHBOR_STD_CONF_ADJUST Post-WoE neighbor-STD confidence adjustment.
%
% This helper reproduces the intent of the original CATMoS neighbor-based
% confidence adjustment... |
0930bade0828d7752db31cf37b033700d9bdb9912fb5e0cd1271e09e6c9025af | MATLAB | 11,817 | 300 | function posXYZout = forwardKinematics_PD_vAF(posXYZ, jointAngles)
% posXYZ input is a single trial of pose data for a set of markers from DLC
% posXYZ shape is Timepoints x XYZ x Markers
% Reconstructs only forelimb positions, leaves other markers as original
% Links, as pairs of markers
phal_dist = [[1, 5]; [2, 6];... |
37d59ad82ca45b287a94546ee738dda8b29fc7c5ea840c2f61f9fbc9990ca017 | MATLAB | 11,822 | 351 | % This script uses phantom 2D IVIM data to run a optimization to find the
% optimal TE combinations for the 2D IVIM model using a genetic algorithm.
% The optimization function uses CRLBs, as proxy vor variance estimator and
% the bias calcualted from the ground truth to minimize bias and variance
% for the f_fast esti... |
eea9aaf946b663fe49fe715e96a4fd71f8ddbb5852d3be55484702f5fbd283e0 | MATLAB | 11,823 | 268 |
clear all
tiktak0=tic;
AnalysisDirectory='G:\Users\Simon\00_TEMPO2D_AnalysisPackage_v2';
DataDirectory='F:\GEVI_Spike';
SaveDirectory='F:\GEVI_Spike_Analysis';
Experiment='Visual';
MouseList=[81 82];
Date='20200416';
GlobalBin=2;% account for hardware + software binning
FrameWindow=[1 5000; 5001 10000;...
10001 ... |
f4d7fddfaedf09793142ade350942bb0219e15ade82bac079cd7d32143935842 | MATLAB | 11,831 | 375 | function [map,num,typ,scheme] = brewermap_view(N,scheme) %#ok<*ISMAT>
% An interactive figure for ColorBrewer colormap selection. With demo!
%
% (c) 2014-2020 Stephen Cobeldick
%
% View Cynthia Brewer's ColorBrewer colorschemes in a figure.
%
% * Two colorbars give the colorscheme in color and grayscale.
% * A ... |
02fd8cbd357ade149e01f027934dfbefcd4af411535e2fa5077b587b6b57c27c | MATLAB | 11,832 | 334 | function [resultsall,mySTATSall,equationsall,betasall,hhall,y_covars] = regress_display(varargin)
% function [resultsall,mySTATSall,equationsall,betasall,hhall] = regress_display(x,y[,varargin])
% Uses regress.m to calculate simple regression between 2 input variables.
%
% Outputs a results string, a vector (or matrix)... |
22261988c07eeb3f8214b7a82db161816841816859392577e26271126ce46964 | MATLAB | 11,841 | 339 | function stats = MapStats(map,varargin)
%MapStats - Compute statistics for a map Z = f(X,Y), or a curve Z = f(X).
%
% Compute statistics on a continuous map, where one time-varying variable Z
% is represented as a function of one or two time-varying variables X and Y.
% The variable Z can either be a point process ... |
ee78d38ab5fa96b9afba33f0f3295cee4e24c8049fa1d72556766f6075b14859 | MATLAB | 11,850 | 453 | % load original network
NT = NetworkObj('../networks/circlenuchexresv_N20.net',struct('dim',2))
%%
NT.plotNetwork()
hold all
%% set up and mesh single flat perinuclear sheet
% pick out reservoir nodes
resvnodes = [];
for nc = 1:NT.nnode
if (~isempty(NT.nodelabels{nc}))
if (NT.nodelabels{nc}(1)=='R')
... |
cb6af599026771499ce5aa635b0475068e4e3dedb605947b88a3eee329073f40 | MATLAB | 11,854 | 326 | function out = SD_SurrogateTest(x, surrMeth, numSurrs, extrap, theTestStat, randomSeed)
% SD_SurrogateTest Analyzes test statistics obtained from surrogate time series
%
% This function is based on information found in:
% "Surrogate data test for nonlinearity including nonmonotonic transforms"
% D. Kugiumtzis Phys. R... |
5b335a71b2f1513676be2c1674ef8a2b0eaa6c1cd4389872dd756a6712b479f0 | MATLAB | 11,864 | 197 | function signal = clean_asr(signal,cutoff,windowlen,stepsize,maxdims,ref_maxbadchannels,ref_tolerances,ref_wndlen,usegpu,useriemannian,maxmem)
% Run the ASR method on some high-pass filtered recording.
% Signal = clean_asr(Signal,StandardDevCutoff,WindowLength,BlockSize,MaxDimensions,ReferenceMaxBadChannels,RefToleranc... |
c7d4094328e5854d30016b9313b4a17dc8a090b021272b64efd969a7bffc36b1 | MATLAB | 11,873 | 300 | function [settings, p, h_figure] = sd_display(layers, settings)
% SD_DISPLAY Displays one or more layers of a series of NIfTI image slices
%
% DESCRIPTION
% Displays layered brain maps
%
% SYNTAX
% [settings, p] = SD_DISPLAY(layers, settings);
%
% layers - Nx1 struct, specifying the N layers to be displayed ... |
6d0e43709d8bf78dab3a9e987bbee50448d6705a02e22916b39331f14acb2094 | MATLAB | 11,877 | 462 | function [Model, Info] = linear_sparse_seq(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
% Sequential iterative algorithm to increase parameters one by one
%
% Notice !!
% Delay... |
6256b9cccada176c7a5f17507b90c6edf3ea9db9619d759143740de4faa89476 | MATLAB | 11,887 | 403 | function [dmt,clusters,dm,OUT] = dbcontrast2density(DB,u,varargin)
% function [dmt,clusters,dm,OUT] = dbcontrast2density(DB,u,[radius_mm],[testfieldname],[contrast over levels],[con_dens_images])
%
% XYZ is 3-column vector of coordinates
%
% Tor Wager 11/20/04
%
% step 1: read database
% step 2: database2clusters -- g... |
a5b7d2237afecec5e85f3ed320f4d2a34a41635769b4061d1025d97fd46c29e0 | MATLAB | 11,888 | 431 | function [Model, Info] = linear_sparse_space_sw(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
% Trial data with variable ... |
711730371840388ee75350dd4a78f87253ca7da411841846d2f2505ed544e9a1 | MATLAB | 11,892 | 337 | %% CANlab MKDA meta-analysis results report
% "What's in the box": A series of tables and plots for a standard
% coordinate-based meta-analysis created with Meta_Activation_FWE in the
% CANlab MKDA meta-analysis toolbox.
%
% The script Meta_results_batch_script is meant to be run stand-alone or
% used in publish_meta_a... |
c90ba9f8623dd6bc8729139fe783bc3eb8d2ba15e5124b65debf61e4c660215c | MATLAB | 11,894 | 282 | function X = warp(u1, u2)
% This algorithm determines a warping function to maximise the similarity score
% of two frequency contours. The algorithm is similar to that of Itakura (1975).
% The maximum number of consecutive vertical steps (2 in Itakura 1975) is
% 'warpFactorLevel' in this version (determined by varia... |
21e2442bd4e91c74e565a3652528486f9b4046c1ba81fabd9a3b9d1c0bd11771 | MATLAB | 11,898 | 374 | function fearPool_tripleCCG_simulation()
nIte=500;
dt=0.02;
dur=60*60;
t=0:dt:dur;
showWin=60;
tripleRate=0.1;
doubleRate=1;
singleRate=100;
rateList=[ 0, 0, 0, 0, 1, 1, 1;
0, 0, 0, 0, 2, 2, 2;
0, 0, 0, ... |
ac6110915d4922bf75a2f01ec1230e022809901c51c163645f0af466722b1f83 | MATLAB | 11,898 | 298 | function out = MF_GARCHcompare(y, preProc, pr, qr, randomSeed, beVocal)
% MF_GARCHcompare Comparison of GARCH time-series models
%
% This code fits a set of GARCH(p,q) models to the time series and
% returns statistics on the goodness of fits across a range of p and
% q parameters.
%
% Uses the following functions fr... |
89ae10818e1c3b705724e11dc181c8c2941f6842e63c45df24a0e0648e2fe2b2 | MATLAB | 11,908 | 276 | % POP_REJCHAN - reject artifacts channels in an EEG dataset using joint
% probability of the recorded electrode.
%
% Usage:
% >> pop_rejchan( INEEG ) % pop-up interactive window mode
% >> [EEG, indelec, measure, com] = ...
% = pop_rejchan( INEEG, 'key', 'val');
%
% Inputs:
% INEEG - input ... |
5048cb34f20fee8ed2b9cf78595fac07c9cce77c90f04ab2eb9f830dde05c04c | MATLAB | 11,923 | 313 | function ch2roi_plot_tSeqFB_brain3D(GRUP, groupInfo)
% time resolved plots: one ROI (brain3D + channels) with all activations per class in time
% FIG:
% - 3D brain plot with highlighted channels in MNI
% - subplots = freqBands
% - 1 subplot: time x clz
% based on the following criteria:
% - selected anatomical... |
1b62cc629c645e7dbb0d04775b161721854644435ad1951dcda8614aa685c411 | MATLAB | 11,926 | 340 | function coactPaper_figureS23()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=9;
letGapY=5;
fontsize=6;
close all
fh=initFig('width',8.9,'height',3,'font','Arial','fontsize',fontsize);
x=15;y=6;
fID=fopen('~/data/Fear/triple/analyses/paper/SourceData/supplementary_fig23.csv','w');
fprintf(fID,'Supplementary... |
07622d0936365a56f518f4a6b37430b3880da1d0b4703214c5ad4b4c2dc73fbf | MATLAB | 11,930 | 253 | function tICACleanData(InputFile, InputVNFile, OutputNamesFile, OutputVNNamesFile, Timeseries, NoiseList, varargin)
optional = myargparse(varargin, {'VolInputFile' 'VolInputVNFile' 'VolCiftiTemplate' 'OldBias' 'OldVolBias' 'GoodBCFile' 'VolGoodBCFile' 'OutputVolNamesFile', 'OutputVolVNNamesFile'});
%InputF... |
71b759bf850f2904bdcd8d77695120b824ad796ed67cdb80b2f257058b7fc97f | MATLAB | 11,932 | 280 | function [fmatx,rmatx,ustudyout,taskindic,tasknms,allsuni] = dbcluster2indic(clusters,DB,fnames,varargin)
%[fmatx,rmatx,ustudyout,taskindic,tasknms,indices (allsuni)] = dbcluster2indic(clusters,DB,fnames,[Sample Size])
%
%[level ID, point count, study ID, indicator of study (contrast) x levels,unique level names] = ...... |
52164214689dbd2896168011e610ef37abfc46908ad35997d5ace3f0c76d32a2 | MATLAB | 11,935 | 290 | % CONDSTAT - accumulate surrogate data for comparing two data conditions
%
% Usage:
% >> [diffres, accres, res1, res2] = condstat(formula, naccu, alpha, ...
% bootside, condboot, arg1, arg2 ...);
%
% Inputs:
% formula - [string or cell array of strings] formula(s) t... |
e21fa90ccbe0fccced18692c4b1d1e42bff8d5a735f271c46aba1a285f39852c | MATLAB | 11,940 | 373 | function [err, v, Info, Com] = Read_1D (fname, p1)
%
% [err,M, Info, Com] = Read_1D (fname, [opt])
% or
% [err,M] = Read_1D (fname,[opt])
% or
% M = Read_1D (fname, [opt])
% or
% open a GUI file selector if no arguments are passed
%
%Purpose:
% Reads an AFNI 1D file into M
%
% The file is to contain an ASCII... |
ecc9d4cab50c88b8664ace2630a2ae41e94a6b385b0e6a715217accd3a837e9b | MATLAB | 11,954 | 362 | function plotFigure7_naiveEphys(ephysPath, codePath)
% Plot figure 7. Naive behavior for all recording sessions, ATI comparison
% between experts and naive, responses to 20ul trials before and after the
% first incongruent trial for low and high ATI sessions
% INPUTS:
% ephysPath = local path to .mat files for ephys... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.