sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
382b87d7dd224dd1970e0038ce141da74622c3d80a8ccc1ea0206de6641cbc55 | MATLAB | 9,822 | 279 | %% function [chi] = QSMMacro(localField,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue field), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of the data, ... |
c8dcd3b8fd91aa462122ffe7181dfdb8b328a2ba871b091cfab455f8b3174ed9 | MATLAB | 9,824 | 306 | function out = PP_Iterate(y, dtMeth)
% PP_Iterate How time-series properties change in response to iterative pre-processing.
%
% The pre-processing transformation is iteratively applied to the time series.
%
% ---INPUTS:
%
% y, the input time series
%
% dtMeth, the detrending method to apply:
% (i) 'spline' ... |
4db9a4886355fe1bfd374aaead1331e63d82d7ca37b30d6a42f9f685890dee09 | MATLAB | 9,828 | 253 | % STD_DETACHPLOTS - Given a figure with subplots and several lines per axis, will add a callback to
% each axis specified in the 'figtitles' input. The callback consist in a figure with all the detached
% individuals lines.
%
% Usage:
% >> std_detachplots('','','data',data 'figtitles', alltitlestmp,'sbtitles',sbti... |
5d3f58a0cbfd8f1a6172cbe91563434ccdf545971a438dde6a8c4a311d92bea0 | MATLAB | 9,830 | 271 | function [vhdr] = read_brainvision_vhdr(filename)
% READ_BRAINVISION_VHDR reads the known items from the BrainVision EEG
% header file and returns them in a structure.
%
% Use as
% vhdr = read_brainvision_vhdr(filename)
%
% See also READ_BRAINVISION_EEG, READ_BRAINVISION_VMRK
% Copyright (C) 2003-2024, Robert Ooste... |
7e25d17baa333d76a3655942738e62b1a7dd67616656aa38e5ac3e4a69790932 | MATLAB | 9,833 | 228 | function P = smc_oopsi_m_step(V,S,M,P,F)
% this function finds the mle of the parameters
%
% Input---
% V: simulation parameters
% R: real data
% S: simulation results
% M: moments and sufficient stats
% P: old parameter estimates
%
% Output is 'Enew', a structure with a field for each parameter, plus some... |
438bd063bdc01963c62b90205a955b26eb8186c25b7822e3e059a0c04a11674e | MATLAB | 9,844 | 339 | function [L, betas, convergenceFailures] = ridgeMML(Y, X, recenter, L)
% [lambdas, betas, convergenceFailures] = ridgeMML(Y, X [, recenter] [, lambdas])
%
% This is an implementation of Ridge regression with the Ridge parameter
% lambda determined using the fast algorithm of Karabatsos 2017 (see
% below). I also made ... |
56cabfca662a9f6afa17171a5923e47ff160e5170080d58d16493907c64c5da3 | MATLAB | 9,846 | 181 | function newInfo = miniReplaceWithGoodies(funcState)
% Function sorts through SelectedVectors to use library of top scoring
% vectors to replace poorly scoring vectors instead of randomly generated
% replacement vectors.
global numFact numComb numDose interVarAlgo scoreProxThresh highScoreMRWG
global low... |
2574239a9aab55715415b8801f81f558c0f361353c730f56ce799fa24c552453 | MATLAB | 9,850 | 239 | function this = load(this, inputDataOrFile, varargin)
% loads (meta-)data from file(s), order defined by loopDimensions
%
% Y = MrDataNd()
% Y.load(varargin)
%
% This is a method of class MrDataNd.
%
% IN
% inputDataOrFile can be one of the following inputs
% 1) a Matrix: MrDataNd is cr... |
925d5daaaf877d6419ba19a63614cb00b5e4a8d8367921bb7a97e78ea577f217 | MATLAB | 9,850 | 194 | 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... |
c08370c33843e16fbe61beffeeb7f38900f7ae879106a1258496eea22d6222fb | MATLAB | 9,850 | 238 | function SuppFigure_fI_curve_control(varargin)
%SUPPFIGURE_FI_CURVE_CONTROL Generate supplementary figure for f-I curve control analysis
%
% Purpose:
% Creates a figure showing different f-I curve shapes and their effects on
% normalization, including linear, sublinear, and supralinear curves for
% both E and I n... |
3436b7f9edbe2a4fa83accd4d6e041f4aa7c5a361c5c4d26c63fe4babc5db54c | MATLAB | 9,851 | 197 | function analyze_communication_subspace_subspace_similarity(group)
close all
clearvars -except group
clc
% Analyze communication subspace similarity.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
switch group
case 'control'
load('behavior_control.mat')
load('activity_... |
25242474cf9c7d28413e7de0904385a603653c22d02ec2b5ee604571225bca40 | MATLAB | 9,856 | 239 | % POP_NEWCROSSF - Return estimates and plots of event-related spectral coherence
%
% Usage:
% >> pop_newcrossf(EEG, typeproc, num1, num2, tlimits,cycles,
% 'key1',value1,'key2',value2, ... );
% Inputs:
% INEEG - Input EEG dataset
% typeproc - Type of processi... |
eb6e873b2ca400010a027df175ea51140a257976d01a96ccc1d7906831a7b334 | MATLAB | 9,860 | 280 | function [config] = getConfig(analysisName, testRun)
% Returns configurations for running all analyses.
%
% Parameters
% ----------
% analysisName (str) : name of analysis
% testRun (bool) : if configurations are for a test run
%
% Returns
% -------
% config (struct) : configurations;
% set defaults
if nargin==0
... |
82777672b8c6deb575f08d7dd0fba92bf61375d06d8f8103e96b423a68a7e601 | MATLAB | 9,864 | 248 | function this = MrDimInfo_select(this, testVariantsDimInfoSelect)
% Unit test for MrDimInfo select.
%
% Y = MrUnitTest()
% run(Y, 'MrDimInfo_select')
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrDimInfo_select
%
% See also MrUnitTest
% Author: Saskia Bollmann
% Created: 2018-02-1... |
c415c559f7fd19f9b477de40ddd9e15cb3d83d9a7fec48459dd34eeed4a8692a | MATLAB | 9,873 | 162 | %% NORMALIZED CROSS-CORRELATION USING XCORR MATLAB FUNCTION
%Modified by Lida Du OCT 2020
% Essential question does the activity of one neuron predict a second neuron activity in
%% INPUT
%1. you need to renumber your t64 files from 1 to the number of neurons your looking at and keep a ledger to keep track of tehi... |
0570f9f99080cccb10b1fd77db46f5d02ce7533470f643e3619a6b9cb6a186cd | MATLAB | 9,874 | 239 | function [groupLabels,newFileName] = TS_LabelGroups(whatData,keywordGroups,saveBack,filterMissing)
% TS_LabelGroups Label groups of a time series using assigned keywords
%
% You provide a set of keyword options to store a specific grouping of time series.
% Useful when doing a classification task -- can store your c... |
2109ad4479458341148380c85657160278637061972e60e2436a75edb0dfc1de | MATLAB | 9,880 | 164 | function [speed_trace,cupA_dist,cupB_dist,delta_implant_tail_to_cupA,delta_implant_tail_to_cupB,cups_dist,mouse_dist,mouse_x,mouse_y] = ...
load_align_dlc_traces(dlc_paths,num_first_plane_frames,onset_delays,sub_session_frame_start,Fs,camFs)
speed_trace = []; % analogue behavior measure
cupA_dist... |
4a9acda5df0322a318a4caec1191287fe1891f09ebd76ac88b8b217b00339774 | MATLAB | 9,887 | 334 | %{
Code for complexity, from Greg Scott
(gregory.scott99@imperial.ac.uk)
Adapted for use w/ cluster time series computed using Leading Eigenvector
Dynamic Analysis by Danielle Kurtin
Clear LZ ref: https://information-dynamics.github.io/complexity/information/2019/06/26/lempel-ziv.html
Greg & Rich's preprint:... |
0df856edba17d578e797c726c44cf96d71bcb9cb2f0f9727cf465b59cb4a9c64 | MATLAB | 9,894 | 247 | function out = NL_FNN(y, tau, maxm, theilerWin, justBest, bestp, escapeFactor)
% NL_FNN False nearest neighbors of a time series.
%
% ---INPUTS:
% y, the input time series
% tau, the time delay
% maxm, the maximum embedding dimension
% theilerWin, the Theiler window: {'ac', k} for k times the first zero-crossing
% ... |
d1ee74806d607c8b7362d360ac13001906d7dddd57edc08a039d6183a18d11fc | MATLAB | 9,896 | 248 | function M = hyperbolicfactory(n, m, transposed)
% Factory for matrices whose columns live on the hyperbolic manifold
%
% function M = hyperbolicfactory(n)
% function M = hyperbolicfactory(n, m)
% function M = hyperbolicfactory(n, m, transposed)
%
% Returns a structure M which describes the hyperbolic manifold in Manop... |
311a54e33f69e06eecb2301c0bea31d2bd01d7344b6aad91ad6be57df0a609b7 | MATLAB | 9,900 | 230 | % POP_REJTREND - Measure linear trends in EEG data; reject data epochs
% containing strong trends.
% Usage:
% >> pop_rejtrend( INEEG, typerej); % pop up an interactive window
% >> OUTEEG = pop_rejtrend( INEEG, typerej, elec_comp, ...
% winsize, maxslope, minR, superpose, reject,call... |
6a62bc2c2d2b8f076a17c61dee440fe215cfcfde2244eb84d454b522023c043a | MATLAB | 9,900 | 202 | %take ground truth synthetic data and run them through GLM to get the
%estimated connectivity
clear all;
close all;
clc;
warning('off')
scriptName = mfilename;
%% Ensure workers can see current code path (parfor safety)
p = gcp('nocreate');
if isempty(p); p = parpool; end
% Replicate current path on workers
pctRunOnAl... |
55acdbf74f014538f673c870f6d477c52ac1c465f0105a9a3a3a6776d1218aa3 | MATLAB | 9,901 | 211 | function [IT_Class_Lure_perf_exp_data,HC_Class_Lure_perf_exp_data,IT_Class_Novell_perf_exp_data,HC_Class_Novell_perf_exp_data,IT_Class_Familiar_perf_exp_data,HC_Class_Familiar_perf_exp_data,IT_Class_Novelf_perf_exp_data,HC_Class_Novelf_perf_exp_data,RSI_Bins_x_axis,IT_Beh,HC_Beh,IT_Beh_novell,HC_Beh_novell]=Plot_Sharpe... |
f614401598108dfc301d25bd60e035ce663a3afac5d08327d3d27244a9730232 | MATLAB | 9,907 | 276 | function cmap = hvn_cmap_coolwarm(N)
%VIRIDIS Blue-green-yellow colour map
% VIRIDIS(N) returns an N-by-3 matrix containing a colormap.
% The colors begin with dark purplish-blue and blue, range
% through green and end with yellow.
%
% VIRIDIS is the new default colormap for matplotlib
%
% Create... |
b0789c99c15c9c4e183f3c3e95ac08bc73e4064e24c9f76beb89a0ee9f011d05 | MATLAB | 9,915 | 226 |
%% this is for periodic analysis (actual direction)
% training part
clear;
mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble';
output_key_word = '';
for sub = 1:35
for sess = 1:2:8
% access raw table
mypath_time_record = [mypath, '/sub', num2str(sub), '_mri_record_sinusoid_s... |
f0d03e9175ecdbdfc526b3f53bc207200e97e280796c1317bd06325b6bafd639 | MATLAB | 9,916 | 314 | function [ subject ] = nmri_process_spike_data( subject, params )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
% check the call
if (~exist('subject','var') )
error('Need a valid subject struct or .m/.mat file to work with')
end
% call the subject and params include
nmri_includ... |
b3f5e305ffd41bdd41daff5563871d2a8420aa8c4c4def86a1be9d9cd0837d04 | MATLAB | 9,926 | 284 | function [a,b,c] = SyncHist(synchronized,indices,varargin)
%SyncHist - Compute a histogram on event-synchronized samples (e.g. a PSTH).
%
% Compute a histogram on event-synchronized point-process (e.g. spikes) or
% continuous (e.g. voltages) samples, obtained using the function <a href="matlab:help Sync">Sync</a>.
% I... |
c1b9e5f5d77db24f7c22eb55c2babc4acb049e60016261c6262a1745257da607 | MATLAB | 9,928 | 248 | function varargout = PETH(samples, events, varargin)
% PETH - Compute a peri-event time histogram relative to synchronizing events
%
% USAGE
%
% [mat,t,mean] = PETH(samples,events,<options>)
%
% INPUT
%
% samples either a list of timestamps (e.g. a spike train) or a
% (n,2) matrix of... |
b663e02ff3e26bf99f74ffca933cb149ba2e7303cc60af4f1eed2e0f43d60a91 | MATLAB | 9,936 | 275 | function HCP_neurosynth_kjhnotes_aparc(task,yourpath,yourhcppath)
yourpath='/fs/ess/PAS1305/ajuna';
task='reading';
yourhcppath='/fs/ess/PDE0021';
load([yourpath '/HCP_CIFTI_INDS.mat'])
% these are the indicies for the cortex & subortical regions
load([ yourpath '/APARCconn_meanconn.mat' ]) %%
% this is every voxel... |
c2db4e05057d74f2995f892e46f99979dd8838d6ef6a3dfccd7dde235a2b1e7a | MATLAB | 9,946 | 349 | function [f,p,ci,stats,tbl,dist] = permuanova2(x,reps,varargin)
%PERMUANOVA2 Permutation-based two-way ANOVA and aligned rank transform test.
% F = PERMUANOVA2(X) performs a balanced permutation-based two-way
% analysis of variance (ANOVA) for comparing the means of two or more
% columns and two or more rows of ... |
12b1728dc4aa7bfa015567ed43c961d0dbf8e0675d94c4de1afa61095343d40d | MATLAB | 9,949 | 263 | function [fieldMap T2map M0map Confidence]=T2starAndFieldCalc(Magnitude,Phase,te,varargin);
% usage
%[fieldMap T2correctmap M0map Confidence] =T2starAndFieldCalc(Magnitude,Phase,te,varargin);
% if a varagin is not introduced the method used for T2* calculations is
% a simple integral method.
% varargin{1} is the method... |
4debd76daa32f36066a5b2cd40ca7c09ade1da85d272a8822485a792c82871fe | MATLAB | 9,950 | 272 | function [C2,cfg] = mahal_iem_dual_trialwise(dat,theta,cfg)
% [C2,cfg] = mahal_iem_dual_trialwise(dat,theta,cfg)
% authors: M Stokes, E Spaak, N Myers
if nargin < 2
help mahal_iem_dual_trialwise
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = s... |
0223c6390cc1439c8c0dbf7a27b17f24436bec41408e2c8557fa046de3bc47b1 | MATLAB | 9,953 | 392 | function [Model, Info] = linear_sparse_cov(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 should be ... |
ebb3f67da0c468befb334b8ae64f4a7967fdf7b0a58cf19c8fa382531946ef6f | MATLAB | 9,957 | 274 | function [cpulse, verbose, plotData] = tapas_physio_findpeaks_template_correlation(...
c, pulseCleanedTemplate, cpulseSecondGuess, averageHeartRateInSamples, ...
verbose, varargin)
% Finds peaks of a time series via pre-determined template via maxima of
% correlations via going backward from search starting poi... |
b6e45899eb548347d265554d61761b74eafef16ec36408cf48bba6437616cc47 | MATLAB | 9,968 | 254 | function [hdr, record] = edfread(fname, varargin)
% Read European Data Format file into MATLAB
%
% [hdr, record] = edfread(fname)
% Reads data from ALL RECORDS of file fname ('*.edf'). Header
% information is returned in structure hdr, and the signals
% (waveforms) are returned in structur... |
e15536a77d313f20051a5fbfd5e9460bce63db47432a7156c7b5a92d285d21a8 | MATLAB | 9,972 | 196 | function TOL_fig_kendler1947(config,params,dat)
% TOL_fig_kendler1947, figure of Kendler et al.'s (1948; 1949) apparatus and design
% Figure S7 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 N... |
ce4ee63c56a47f5f4f4c48ed1fb0c96daf1ffce236358d7be7eeece5b343b03e | MATLAB | 9,977 | 191 | %% Script to run gPPI analysis on Responsibility study data.
% As we use spm8 to run the PPPI and spm12 to estimate the contrasts, it's
% recommended to exit Matlab between model estimation and contrast calculation.
%
% J Schultz 2019-2024
%% Preparation
clear, close all
addpath(genpath('/Applications/PPPIv13.1'))
%%... |
1095e7ab1e02f449fe94e7e7120bdde0911075688cb1170579fe55fd0b8a7f8b | MATLAB | 9,983 | 323 | function fear_detectPfcLowGamma(basename,varargin)
%%
% clear
% load('~/data/Fear/triple/nostrum200304/nostrum200304.basicMetaData.mat')
% basename=basicMetaData.Basename;
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
[lfpFile,lfp... |
64c915a1c2768ec686613451f433faac24074cc3d6d46f18f1a5c7f646b5f6ca | MATLAB | 9,984 | 285 | function [x, cost, info, options] = neldermead(problem, x, options)
% Nelder Mead optimization algorithm for derivative-free minimization.
%
% function [x, cost, info, options] = neldermead(problem)
% function [x, cost, info, options] = neldermead(problem, x0)
% function [x, cost, info, options] = neldermead(problem, x... |
7efedca12ee019129cc8ffd56f34fe4b68361707a2c2f3a29c5634971c6e0c15 | MATLAB | 9,992 | 228 | function matlabbatch = get_matlabbatch(this, module, varargin)
% Returns matlabbatch to perform spm-processing with an MrImage. Fills out
% all necessary file parameters and options for different modules, e.g.
% realignment, smoothing
%
% matlabbatch = get_matlabbatch(MrImage, module, varargin)
%
% This is a method o... |
3be0492773b8ee660215013a4cc5328bf109b598f4f4738a040aa1724cc667e3 | MATLAB | 9,993 | 223 | % setup
cd /home/stone/generic/Dropbox/nsdfaceprf/
hemis = {'lh' 'rh'};
setfsnsd;
% load stuff
clear rois rps angs eccs preds r2s szs prfangs prfeccs prfr2s prfszs; % 8 subjects x 2 hemis
for p=1:8
for hh=1:2
rois{p,hh} = cvnloadmgz(sprintf('~/nsd/nsddata/freesurfer/subj%02d/label/%s.prf-visualrois.mgz',p,hemi... |
d2c70d340e6d900734dcbd2c0f6fbd707ce43cc4d4f682c50e812d7bc08c6f80 | MATLAB | 9,998 | 290 | function uTest_GetMD5(doSpeed)
% Automatic test: GetMD5 (Mex)
% This is a routine for automatic testing. It is not needed for processing and
% can be deleted or moved to a folder, where it does not bother.
%
% uTest_GetMD5(doSpeed)
% INPUT:
% doSpeed: Optional logical flag to trigger time consuming speed tests.
% ... |
2608385c4548be970b86a068b2a2cea64f7b3a0654178469b4aacf3cf243e88a | MATLAB | 10,002 | 256 | function runMEANAPviewer()
MEANAPviewerApp = MEANAPviewer;
MEANAPviewerApp.UIFigure.Name = 'MEA-NAP viewer';
% Resize the right column
% Currently the ordering are
%(1) Left gap (2) File selection (3) Gap (4) Image (5) File manager button
MEANAPviewerApp.GridLayout.ColumnWidth = {[79] '0.5x' [50] '1x' [125]};
ME... |
de761a97b435497aab470c1bac5ec935478a4c7eaf148bd7080b0a8eca63c5f0 | MATLAB | 10,004 | 347 | function [traj, infStates] = tapas_hgf_binary_mab(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF in a multi-armed bandit
% situation with binary outcomes
%
% This function can be called in two ways:
%
% (1) tapas_hgf_binary_mab(r, p)
%
% where r is the structure gener... |
1e33332adf36be193f6cf124159d9e48ade09f34bacf21043cb53275781226c3 | MATLAB | 10,013 | 225 | function [EEG, varargout] = pop_iclabel(EEG, icversion)
%POP_ICLABEL Function for EEG IC labeling
% Label independent components using ICLabel. Go to
% https://sccn.ucsd.edu/wiki/ICLabel for a tutorial on this plug-in. Go
% to labeling.ucsd.edu/tutorial/about for more information. This is a
% beta version and r... |
227f0ede5dc45a0aaaf75fb9abe9f27665f1931941ac6e7f92c04e6e014e5860 | MATLAB | 10,014 | 315 | function [tableVolSliPhase, indVolPerPhaseSlice, imgRespiratoryPhasesMeanVols, ...
imgRespiratoryPhasesFirstVol, fh] = ...
tapas_physio_sort_images_by_respiratory_phase(ons_secs, sqpar, nRespiratoryPhases, ...
fnTimeSeries, verbose, dirOut)
% TODO: Test functionality, does not work yet!
%
%performs retrospe... |
1a88912717ef9b7f8dfe8c9f9d004a753620de9c1cf06115be6d8235a888789d | MATLAB | 10,017 | 189 | 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... |
27cf8d8f7b01506b90e27bdea5ef2485e2992ebdb60174de3f0b59581a646d4d | MATLAB | 10,020 | 318 | function varargout = peakfinder(x0, sel, thresh, extrema, includeEndpoints, interpolate)
%PEAKFINDER Noise tolerant fast peak finding algorithm
% INPUTS:
% x0 - A real vector from the maxima will be found (required)
% sel - The amount above surrounding data for a peak to be,
% identified (defaul... |
1fa105c75c308985cc29801cd90c42ff28c0cd9c7058d3ab067a0e01d41d134b | MATLAB | 10,022 | 186 | function plot_histograms_mean_neural_activity_trial_epoch
close all
clear all
clc
% Plot histograms of mean neural activity during the trial period for control and APP-KI mice.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
% Control.
load('behavior_control.mat')
load('activity_control.ma... |
e0ef5e00b4a7760c07edc6f09d87b3d8d4aad308eb81e18305fcf92096df5586 | MATLAB | 10,025 | 212 | %% This file is used to generate dual-color STORM images by aligning individual STORM images to the centers of endocytic pits
clear all;
close all;
clc;
% Define folder paths
folder_path = 'Y:\20250927 DIV14 OE_EndoA2_583 b2_647\Analysis\diat_regions\2 Type Puncta';
saving_path = fullfile(folder_path, '2D average');
... |
41d9ac746bbed11195a5438aac558c03ca7ab4f9e939b9417419cd96f4810fa9 | MATLAB | 10,028 | 299 | % Analysis of the zero pipette position from Artemia swimming+release MFS
% experiment
%
% net Propulsive force = swimming force(measured by MFS) + Drag forces
% Fnet = k.x + c.v
%
% The data set has double peaks in the
% negative Y-axis (valleys) which repeat at a regular interval. I will be
% calling them... |
b248b653a3b714784e1a0d8d007bde03c8561311bda5b5857615a24ca285017a | MATLAB | 10,028 | 254 | function [transform, coordsys] = ft_headcoordinates(fid1, fid2, fid3, fid4, coordsys)
% FT_HEADCOORDINATES returns the homogeneous coordinate transformation matrix
% that converts the specified fiducials in any coordinate system (e.g. MRI)
% into the rotated and translated headcoordinate system.
%
% Use as
% [transf... |
0d2406affd1a56da34b71016de0e16efa3166b147d36fecb133a299f40d7daba | MATLAB | 10,035 | 236 | classdef McsCmosStaExplorerSource < handle
% Holds the contents of a STAExplorer data source
%
% Important fields:
% STAData - (cell array) Holds the STAs for each channel/unit
% in the group. The STAs are read from the file the
% first time this array is ac... |
09482d2a785dcf7fcff998989e32e8b361ca38a69022058e2162b487bafc2d32 | MATLAB | 10,036 | 259 | % POP_EEGFILT - interactively filter EEG dataset data using EEGFILT
%
% Usage:
% >> EEGOUT = pop_eegfilt( EEG, locutoff, hicutoff, filtorder);
%
% Graphical interface:
% "Lower edge ..." - [edit box] Lower edge of the frequency pass band (Hz)
% Same as the 'locutoff' command line input.
% "Higher... |
7eaf656713d955c9e3f2b5cbe6c5f03a6d6de095bfb2a14c9d9f57253f4cda9a | MATLAB | 10,036 | 277 | function data = LoadBinary(filename,varargin)
%LoadBinary - Load data from a multiplexed binary file.
%
% Reading a subset of the data can be done in two different manners: either
% by specifying start time and duration (more intuitive), or by indicating
% the position and size of the subset in terms of number of r... |
7abdca59bb15b7e2098412cfee205986c5edc27ad1ba378a1bd62df35ca553ff | MATLAB | 10,038 | 249 | function [outputImage, affineCoregistrationGeometry, outputOtherImages] = coregister_to(this, ...
stationaryImage, varargin)
% Coregister this MrImage to another given MrImage
% NOTE: Also does reslicing of image
%
% Y = MrImageSpm4D()
% [outputImage, affineCoregistrationGeometry, outputOtherImages] =
% Y.co... |
05e8ec423cfa1294508348d6960924cbb90f2b416338b6b0b018a5a02ac4f89a | MATLAB | 10,041 | 213 | function [x_data,xxline] = fg_bootstrap_two_groups_seed(fig_num,seeds,B_L,group_1_data,group_2_data,group_1_counter,group_2_counter,log_scale,frequencies,CIU,CIL,freq_lims)
%Use bootstrapping for statistic of power spectra
%output gives the coordinates for points of significant difference
%input is figure number, th... |
199be762571fcbbc36ec47d23b18b1a3e4c1eed79c85faf07f5d441498c7f2c2 | MATLAB | 10,045 | 244 | function [C2,cfg] = mahal_multiclass_trialwise(dat,labels,cfg)
% [C2,cfg] = mahal_multiclass_trialwise(dat,labels,cfg)
% authors: M Stokes, E Spaak, N Myers
if nargin < 2
help mahal_multiclass_trialwise
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
n... |
e3ce1e7f49c9d50280b5bba065a7e84b6d08adfec8b2ee6e57c04d53c5d323ac | MATLAB | 10,048 | 199 | %take ground truth synthetic data and run them through GLM to get the
%estimated connectivity
clear all;
close all;
clc;
warning('off')
scriptName = mfilename;
%% Ensure workers can see current code path (parfor safety)
p = gcp('nocreate');
if isempty(p); p = parpool; end
% Replicate current path on workers
pctRunOnAl... |
dcbdb23cb2a7cec91bc54c9e22954e827318de309f3003d25ab1ef78a83ce524 | MATLAB | 10,055 | 313 | function [ haxis ] = scrollplot(times, data, t_window, events, hparent, haxis, hscroll)
%SCROLL Plot EEG channel or component activity with events and scrollbar.
% Creates a 1-dimensional scrolling plot that can incorporate EEGLAB
% events.
%
% Inputs:
% times: vector of times used to label the horizontal a... |
a54e06a408005028fccaa333c87ed4b687d7e5e7d1e185a2d8372ee7538357cb | MATLAB | 10,062 | 217 | %% This script contains a tutorial demo for the HGF toolbox
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2014 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% ... |
b7f7a4934fa35d9d2e54f9e4a9e2be6686cc3d80231c7459fca6932a37fdabbf | MATLAB | 10,062 | 335 | % TDM analysis
%
% This script executes the TDM method developed by Kendrick Kay et al.
% (2019) to separate early and late BOLD contributions within an fmri
% timeseries. In this script, a simple block design with one experimental
% and one baseline condition is expected. Furthermore, the onset times and
% stimulus du... |
f18bf9d6e6bd1a8780cc1127a0156b839eac9bef7cbe00c187ddeed8cd88a490 | MATLAB | 10,067 | 310 | function [ obj ] = estimate( obj, varargin )
% Estimate parameters of the HUGE model.
%
% INPUTS:
% obj - A tapas_Huge object containing fMRI time series.
%
% OPTIONAL INPUTS:
% This function accepts optional name-value pair arguments. For a list of
% valid name-value pairs, see the user manual or type 'help
% ... |
ba59cf848344582fa1c1b63949b40b5d958265cf6c9f58eb9987c2479936a832 | MATLAB | 10,068 | 274 | % FINPUTCHECK - check Matlab function {'key','value'} input argument pairs
%
% Usage: >> result = finputcheck( varargin, fieldlist );
% >> [result varargin] = finputcheck( varargin, fieldlist, ...
% callingfunc, mode, verbose );
% Input:
% varargin - Cell array 'v... |
76f65665a1e868d67193ed425eb120e55a4b91ba83d617ab1fa350296d1747de | MATLAB | 10,072 | 325 | %% Computing the ensemble sequences
load('/home/octodon/Documents/MATLAB/raster2Ens/Analyzing4Exp_FullRecording/v4_4_exps_ens_seq.mat')
load('/home/octodon/Documents/MATLAB/FastEnsDet/4exps/4_exps_6_conds_concatenated.mat')
nexps = 4;
condnames = {'iSA','iPA','WN','NM', 'fPA','fSA'};
%% removing 0s from the sequence
en... |
97aa0f691d9fc6e32b73c4bc54350ac609c41c5c213713d5b8ef4588dc35d338 | MATLAB | 10,075 | 319 | function [theta,varargout] = subspacea(F,G,A)
%SUBSPACEA angles between subspaces
% subspacea(F,G,A)
% Finds all min(size(orth(F),2),size(orth(G),2)) principal angles
% between two subspaces spanned by the columns of matrices F and G
% in the A-based scalar product x'*A*y, where A
% is Hermitian and positiv... |
349e2d548fce7744babd5cf2d305e9ac53bc0c4e1ad36c3cfafaec57db36b82d | MATLAB | 10,076 | 348 | function [traj, infStates] = tapas_hgf_ar1_binary_mab(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF in a multi-armed bandit
% situation with binary outcomes
%
% This function can be called in two ways:
%
% (1) tapas_hgf_ar1_binary_mab(r, p)
%
% where r is the structu... |
862ed9e0bf4c9f6595909f698273b604296688dd67edf59d80345fd9b9075867 | MATLAB | 10,076 | 234 | function out = NL_DVV(x, m, numDVs, nd, Ntv, numSurr, randomSeed)
% NL_DVV Delay Vector Variance method for real and complex signals.
%
% Uses predictability of the signal in phase space to characterize the
% time series.
%
% This function uses the original code from the DVV toolbox to do the computation
% and produ... |
0b0621c990b21e924f67ac51f529d8f46e19bb755f73a3e2ba80e81fe86b33a2 | MATLAB | 10,081 | 239 | function [MRSCont] = OspreyFit(MRSCont)
%% [MRSCont] = OspreyFit(MRSCont)
% This function performs spectral fitting on MRS data loaded previously
% using OspreyLoad.
%
% The method of fit, fitting range, included metabolites and other
% settings are set in the job file.
%
% USAGE:
% MRSCont = OspreyFit(... |
d20f54554f9dad7b6a95142e618e54392fc0b36b487325dd230f61b46063c706 | MATLAB | 10,089 | 216 | function GRUP = ch2roi_load_FB(params, dataInfo)
% !!! TBD !!!
% pools results from trigger analysis over:
% - freq. bands
% - ROIs (regions of interest): anatomic areas, ...
% - subjects
% returns:
% D{roi,freq} = 3D: t x ch x clz
% (c) Jiri, Nov21
%% required variables
list_AA = dataInfo.list_AA; % list o... |
51440e33556b2bab4cf52d96220244572b39b8c689462880b68bca74150a26ac | MATLAB | 10,093 | 283 | function [mri, hdr, cpersist] = read_ctf_mri4(filename)
% READ_CTF_MRI reads header and imnage data from CTF format MRI file
%
% [mri, hdr] = read_ctf_mri(filename)
%
% See also READ_CTF_MEG4, READ_CTF_RES4
% Copyright (C) 2008 Ivar Clemens
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for... |
25b62479e38ba728782fede6c38b8df53acd6699c58760345dafca4a62d79a09 | MATLAB | 10,096 | 187 | %% |NATSORT| Examples
% The function <https://www.mathworks.com/matlabcentral/fileexchange/34464
% |NATSORT|> sorts the elements of a text array |A| (cell/string/...)
% taking into account number values within the text. This is known as
% _natural order_ or _alphanumeric order_. Note that MATLAB's inbuilt
% <https... |
cc673f06449a502ed464603d901f371d05af818eb96a1ba692d7980776a13a0b | MATLAB | 10,096 | 265 | function out = MF_arfit(y, pmin, pmax, selector)
% MF_arfit Statistics of a fitted AR model to a time series.
%
% Uses various functions implemented in the ARfit package, which is
% freely-available at http://www.gps.caltech.edu/~tapio/arfit/
%
% cf. "Estimation of parameters and eigenmodes of multivariate autoreg... |
e4bde7548b3f43084bc1e04482a6d852bc0cf6396247aa81dfaea27fbf0363b2 | MATLAB | 10,096 | 275 | %% Loading data generated by CMOS-MEA software
% Starting from version 2, CMOS-MEA-Control generates HDF5 files with the
% extensions .cmcr and .cmce, while CMOS-MEA-Tools generates HDF5 files
% with the extensions .cmtr and .cmte. All these files can be imported into
% Matlab with the command
%
% data = McsHDF... |
0320d8df81250fc19ed541f09f57db2ecb18ae85fd5f8d9350b9dccf46cce9c5 | MATLAB | 10,098 | 299 | % figure3_tf_itemdistance_calculate.m - Calculate power modulation by item distance
%
% This script analyzes how oscillatory power (particularly beta-band) scales
% with the angular distance between the two memory items ("item distance").
% Larger item distances require larger-magnitude priority shifts.
%
% KEY ANALYSE... |
9d0aaead9ed6ea9732ca42e6594b36e50e144865fa07f1001385655874863a70 | MATLAB | 10,103 | 307 | function devSandbox
% This script is a stand-alone function that can be useful as a sandbox to
% develop the PTB audio/visual stimulation of your experiment. No input/output
% required.
%
% Here, a tutorial from https://peterscarfe.com/contrastgratingdemo.html is
% provided for illustrative ... |
8d4945bb88c6106930b219d31b923194615cfa34c34b9ef1ec9b18c48b868560 | MATLAB | 10,116 | 285 | function [smm_rs, smm_ps, n, searchlightRDMs] = searchlightMapping_fMRI(fullBrainVolumes, models, mask, userOptions, localOptions)
% ARGUMENTS
% fullBrainVolumes A voxel x condition x session matrix of activity
% patterns.
%
% models A struct of model RDMs.
%
% mask A 3d or 4d mask to perform the sea... |
69c941eacf7166f25f3ea40232317b1a2dffeb2f1aec238058fafd1c92f8c22c | MATLAB | 10,120 | 197 | %% get_CIT168_reinf_learn_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 : al... |
0d2da997e68d6137bb463980d4e4d9af0b9a3e1046438651d2d2516be85d8998 | MATLAB | 10,121 | 261 | %% h = sepia_handle_panel_bkgRemoval(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global stru... |
2b1737a0cb38b3ab2fcc570b2ad47c649a5d37653dc960c1b51358d26f760033 | MATLAB | 10,123 | 279 | function nmri_plot_layout(lay, varargin)
% based on:
%
% FT_PLOT_LAY plots a two-dimensional layout
%
% Use as
% ft_plot_lay(layout, ...)
% where the layout is a FieldTrip structure obtained from FT_PREPARE_LAYOUT.
%
% Additional options should be specified in key-value pairs and can be
% 'chanindx' = list of c... |
6cd64e1943d62bc929c8d2c4eb4f474925e44f2b5a334bd2eac5e1e920c81563 | MATLAB | 10,124 | 256 | % fit_waterOsprey.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [fitParams] = fit_waterOsprey(dataToFit, resBasisSet, fitOpts);
%
% DESCRIPTION:
% This is the function describing the Osprey water fitting model, which is
% performed with the resampled water basis set resBasisSet on the data contain... |
98e5d36a8d98f9d2454daf332bbcc73dbf95e84b395f739e4436b4fb1df2463c | MATLAB | 10,129 | 319 | % GETHELPVAR - convert a Matlab m-file help-message header
% into out variables
% Usage:
% >> [vartext, varnames] = gethelpvar( filein, varlist);
%
% Inputs:
% filein - input filename (with .m extension)
% varlist - optional list of variable to return. If absent
% return all ... |
e0b96f61b24e486d5ca7335d4b07a815f7e95781f114677115133e48557d2a78 | MATLAB | 10,130 | 269 | %% h = sepia_handle_panel_qsm(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure c... |
213dbe800b569d73fa0fe554f93c7b1db8ae060c840dd992fabd8efefd4737d0 | MATLAB | 10,133 | 274 | % DeOblique
% a script that figures out the rotation to apply to
% cardinal-plane-acquired data to bring it into alignment with oblique functional data
%
% Usage:
% The script will prompt you for an Ifile filename, say: may0603mj/I.610
% and will output the 3drotate command needed to apply to the
% High resolution anat... |
22923ac0650d6f5b203f01b49795188694150ac9d831d55a75c3db27339b3f20 | MATLAB | 10,138 | 286 | function GEDeIdentify(fnames)
% GEDeIdentify
% Reads GE P-files and removes participant/exam information from the
% header. Newly de-identified P-files are then output, with filenames
% appended with '_noID'. The original files are not overwritten.
%
% If GEDeIdentify has already been run, and de-identified fil... |
738b4687a1dcaa673839a8f948183808975ad63b41e22436005283f712c82a3a | MATLAB | 10,145 | 291 | function [Z,order,Md] = som_linkage(sM,varargin)
%SOM_LINKAGE Make a hierarchical linkage of the SOM map units.
%
% [Z,order,Dist] = som_linkage(sM, [[argID,] value, ...])
%
% Z = som_linkage(sM);
% Z = som_linkage(D,'complete');
% Z = som_linkage(sM,'single','ignore',find(~som_hits(sM,D)));
% Z = som_linkage(sM... |
4607f1a6d79ab79f32eef3b39c8291ac706354c23c62b04575ae7191287b5194 | MATLAB | 10,146 | 249 | % eeglab2fieldtrip() - This function converts EEGLAB datasets to Fieldtrip
% for source localization (DIPFIT).
%
% Usage:
% >> data = eeglab2fieldtrip( EEG, fieldbox, transform );
%
% Inputs:
% EEG - [struct] EEGLAB structure
% fieldbox - ['raw'|'timelock'|'comp'] for reasons, you can a... |
3d039e614cd4cd2da2e558ff830f3302b02e15d5c1b91ad158044fb8a6e863d9 | MATLAB | 10,148 | 255 | function behavior_neuron_activity_correlation()
%% ========================== CONFIG ============================
dataDir = 'H:\Kaizhen\Anxiety_behavior_phenotyping_analysis\Ethological_Behavior\Correlation of neuronal activity with behavior\PV';
calciumFiles = { ...
'PVm17_EPM_1st.xlsx'
, 'PVm19_EP... |
6e14d3deee1dab35c04b5451434a11a48860ba00bef41b2981384c5075c143a0 | MATLAB | 10,152 | 214 | function [MRSCont] = osp_fitUnEdited(MRSCont)
%% [MRSCont] = osp_fitUnEdited(MRSCont)
% This function performs spectral fitting of unedited MRS data.
%
% USAGE:
% [MRSCont] = osp_fitUnEdited(MRSCont, basisSet);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
% basisSet = Osprey basis s... |
fd0efa62378490245627bfd1b347b6389427417a4d5938ff2c607e195b8448a8 | MATLAB | 10,161 | 183 | function [hdr, fid, cleanupObj] = read_nifti2_hdr(filename)
% READ_NIFTI2_HDR
%
% Use as
% [hdr, fid, cleanupObj] = read_nifti2_hdr(filename)
% where
% filename = string
%
% cleanupObj MUST be kept around until you are done reading from fid,
% as it will close fid when it is ... |
9f5a6f1eceff7fbb3a1e222221c8ee1cb2c093453db1c3952f73359ec79d65e6 | MATLAB | 10,164 | 240 | function out = NL_EVTLocalDim(y, tau, m, q, theilerWin, nPoles, mOrder, maxN, randomSeed)
% NL_EVTLocalDim Extreme value theory local dimension and persistence of the attractor.
%
% Time-delay embeds the series and, for a sample of reference points
% ("poles") on the reconstructed orbit, treats close returns of the ... |
e600d693e70055ef55a68890adfdbaf1fd5c528b94a04e3df37dc72587bfba43 | MATLAB | 10,166 | 271 | function out = NL_PoincareSection(y, ref, embedParams)
% NL_PoincareSection Poincare section analysis of a time series.
%
% Time-delay embeds the time series and computes a Poincare section using
% TISEAN's 'poincare', which cuts the trajectory on a fixed embedding
% coordinate (the last, by convention) held at its o... |
b137e651be1fda6b17df3cfe668d09778b54c605b6ed39e72762852476c88657 | MATLAB | 10,171 | 268 | function BF_AnnotatePoints(xy,TimeSeries,annotateParams)
% BF_AnnotatePoints Annotates time series/metadata to a plot
%
%---INPUTS:
% xy, a vector (or cell) of x-y co-ordinates of points on the plot
% TimeSeries, a table of time series making up the plot
% annotateParams, structure of custom plotting parameters
% ... |
2ac928a8a1ed634b56120104262843a00cc8f630490647ccaebf50a7e5f898c5 | MATLAB | 10,179 | 191 | function [rippledata_clean] = iEEG_clean_rippledata(settings,rippledata)
%% ########################################################################
% - Clean ripple data according to settings -------------------------------
% #########################################################################
% [Usage:]
% >> [ri... |
c1f92eb7b57dac9f0212a120cf647887c2b7e8e1076da3317de3cd38ff9be55f | MATLAB | 10,180 | 284 | function [alpha, xmin, L]=plfit(x, varargin)
% PLFIT fits a power-law distributional model to data.
% Source: http://www.santafe.edu/~aaronc/powerlaws/
%
% PLFIT(x) estimates x_min and alpha according to the goodness-of-fit
% based method described in Clauset, Shalizi, Newman (2007). x is a
% vector of ob... |
5248abb11101afadf0df177403478fb21ccfc9ca20d6a7a18889ca010a50611e | MATLAB | 10,184 | 228 | function out = SB_TransitionMatrix(y, howtocg, numGroups, tau)
% SB_TransitionMatrix Transition probabilities between time-series states.
%
% The time series is coarse-grained according to a given method.
%
% The input time series is transformed into a symbolic string using an
% equiprobable alphabet of numGroups lett... |
95542644753933bf1f1569748378f7adbc49ffe8ee29362bbe2cf8a4f7097cb6 | MATLAB | 10,191 | 201 | clear all;
clc;
ForderName=['ALL/LHbnPAG']; %ALL LHbnPAG
Monkey_name='all'; % 'c' 'k' 'all'
Num_context=4;
Num_probability=3;
POP_foldapath=['POP_Behavior/PavFo4C4S/FOR/',ForderName]; %_LHb
POP_allfolda=dir([POP_foldapath,'/*.mat']);
load(['Labnote/Labnote.mat']);
load(['Labnote/Labnote_RAW.mat']);
load(['Labnote/La... |
55c9cad5b4dccc9d567e07cfffe5bc0261839c5c7550a568750cbb4cbbe11b51 | MATLAB | 10,192 | 296 | function X = palm_miscread(filename,varargin)
% Read various scalar data formats based on the file extension.
%
% X = palm_miscread(filename,useniiclass,tmppath,precision,mz3surf);
%
% filename : File to be read.
% useniiclass : True/False. For NIFTI files, use the NIFTI class
% when reading them. It r... |
2b40428789be3f31c785245d16d76a0e95846db47552b7b811b360a29c14bbf2 | MATLAB | 10,207 | 209 | % POP_EEGPLOT - Visually inspect EEG data using a scrolling display.
% Perform rejection or marking for rejection of visually
% (and/or previously) selected data portions (i.e., stretches
% of continuous data or whole data epochs).
% Usage:
% >> pop_eegplot( EEG ) % S... |
65b6d9b443d80db50b63699ca5ba3d60c0e0c8730b8646e01315e5b46227b6f4 | MATLAB | 10,216 | 261 | function [A, bcol] = print2array(fig, res, renderer, gs_options)
%PRINT2ARRAY Exports a figure to an image array
%
% Examples:
% A = print2array
% A = print2array(figure_handle)
% A = print2array(figure_handle, resolution)
% A = print2array(figure_handle, resolution, renderer)
% A = print2array(figure_handle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.