sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
32bf6a938870a85dfd7a90b4dce1a92ecf9863324259c6e1c1cc7f407ff9cd70 | MATLAB | 6,173 | 200 | %% tsdata_to_var
%
% Fit VAR model to multi-trial, multivariate time series data
%
% <matlab:open('tsdata_to_var.m') code>
%
%% Syntax
%
% [A,SIG,E] = tsdata_to_var(X,p,regmode)
%
%% Arguments
%
% See also <mvgchelp.html#4 Common variable names and data structures>.
%
% _input_
%
% X multi-trial time s... |
b8a7ecd5bd86baec02bd1729fee693d90189454233276ca3edb6d4b36a1016d1 | MATLAB | 6,183 | 116 | function [AcceleroPerChannelMovementTimeInSec,AcceleroSumAllChannelMovementTimeInSec,AccelerometerDataIn5000HzNormalized, AccelerometerAngleDataIn100HzForStatic, ...
AccelerometerDataAt5000HzUpTo100Hz,Acc_dbscanIDX_Results_ForSession,Acc_ClusterTimeInSec_ForSession,DataFor_tSNEOfXChannels] ...
... |
15fb224d02772bc3473526f3bd190e3700f2ae5520f85a6e01b3fffd9dda2336 | MATLAB | 6,201 | 204 | function [fn,saveName,tbl1] = st_plot_varexp_violin(DT, params,roiList)
% initial filter
df = tableFilter(DT,params);
df = st_tablegiveROInumber(df, roiList);
[G,~] = findgroups(df.roiNumber,df.tmodel,df.subjID);
df.G = G;
eachGroup=[]; N = []; newT=[];
% edges = linspace(0,1,nbin);
for i = 1:length(unique(G))
... |
df87e9b3a135f9e1ab0136bd039b8144f316afbfe664442839cd846e7d67cb32 | MATLAB | 6,201 | 248 | function sff = sff_fffabc(sff)
%SFF_FFFABC sff wrapper for fffabc
v1 = sff.gp1.mov;
v2 = sff.gp2.mov;
prm = sff.prm;
disp('gp1')
sff.gp1 = fffabc(v1,prm);
disp('gp2')
sff.gp2 = fffabc(v2,prm);
end
%% track
function ff = fffabc(v,prm,ffprior)
%FFFABC Find FireFlies Adaptive Background Compensatio... |
48c10ffe4a22d526c5c2db4c3d34bd926a6dc6853450bca2a4385ff1c58da7d3 | MATLAB | 6,202 | 188 | function [offsets, totprob] = markov(probMat, minShifts, lambda, ...
refOffsets, gain, numLines, numFrames, frameRate, maxShift, doFull, ...
verbose)
%markov - Calculate line-by-line offsets
%
% See also utils.motion_correct, utils.hmm
%% Assing paramemeters
% Decide wether to do an abbreviated or full run
if... |
955126abe7f04a83118104f76f83547f2f7ed2ee41b14e89d4d8631eeb6ba147 | MATLAB | 6,243 | 225 | function A = convnfft(A, B, shape, dims, options)
% CONVNFFT FFT-BASED N-dimensional convolution.
% C = CONVNFFT(A, B) performs the N-dimensional convolution of
% matrices A and B. If nak = size(A,k) and nbk = size(B,k), then
% size(C,k) = max([nak+nbk-1,nak,nbk]);
%
% C = CONVNFFT(A, B, SHAPE) controls the si... |
186567e13401ada3600f13d67da5ddac6504630f19275eafaef87e937bad6f90 | MATLAB | 6,251 | 208 | %% LineScanDiam
% Analyse line scan images of vessel diameters
%% Usage
% OBJ = LineScanDiam(NAME, RAWIMG, CONFIG, COLS, CH, ISDP)
%% Arguments
% * |NAME| is the name for this |LineScanDiam| object.
% * |RAWIMG| is the |RawImg| object that will be used to create the
% |LineScanDiam| object.
% * |CONFIG| contains th... |
a8e87f7e2cce6b5d218ec118a128b0170a675bf5035cb2410e639e8c23009076 | MATLAB | 6,251 | 168 | %==========================================================================
% This script examines the durations of the different trial phases.
%
% Lukas Kunz, 2023
%==========================================================================
% start
clear; close all; clc;
addpath(genpath('E:\OpenField\Functions\'));
%... |
db44aab532db2e5962182fa7c1f4904fbeba3ed471c502b4323eaf01490c8ef1 | MATLAB | 6,255 | 186 | function varargout = opt_config(self)
%opt_config - Optimise the parameters in Config objects using a GUI
%
% opt_config(OBJ) opens a GUI that allows interactive adjustment of the
% parameters in each Config object. The GUI can also be used to reprocess
% the object, and produce various plots, which makes it easi... |
892e02c1df237db993c08fbeccb5e366c09cb0356dc10239a909023b11f0a247 | MATLAB | 6,256 | 180 | clc;
clear;
%% Add paths now..
loadpath;
%% Dataset details now..
datasetname = ['06032019_SponSleep']; %'27072018_SponSleep','14092018_SponSleep',
%'17092018_SponSleep','30102018_SponSleep',
%'01112018_SponSleep','03112018_SponSleep','13112... |
517e12e2893bb50bcb938bd246bc73a210e368f9f5632bff79ac11cea281c04a | MATLAB | 6,259 | 185 | % Script to generate anatomy_cortical_pairwise_distance_distribution.mat
%%%% Set up triangular mesh of cortex (units in mm)
[sa,X] = network_simulation_beluga.getHeadModel;
A0 = zeros(size(X.faces,1),1);
norm_vec = zeros(size(X.faces));
for i = 1:size(X.faces,1)
tri = X.vertices(X.faces(i,:),:);
A0(i) = 1/2*n... |
060c01d2b5f83c3899593b18e672068ee0b5f48370aab43b1308002910c85256 | MATLAB | 6,261 | 165 | classdef DataDiameterTiRS < DataDiameter
%DataDiameterTiRS - Data from TiRS diameter calculations
%
% The DataDiameterTiRS class is a data class that is designed to
% contain all the basic data output from CalcDiameterFWHM.
%
% DataDiameterTiRS public properties inherited from Data:
% mask - A mask com... |
50a9e2b938419f824e00663f9c0c1df943c460bdfe64e362c19f1295fa1ba3a0 | MATLAB | 6,264 | 165 | %% Export Continuous Data To Corpus Emulator
%
% <html>
% Import continuous data into Matlab using TDTbin2mat <br>
% Export to binary files that are read into Corpus as PZ5 data <br>
% Use SynapseAPI to generate new recordings with this data <br>
% Concatenate the resulting data sets into one master data structur... |
3296c8da545fda5f278f5808f261a0d19a614896beba898d64da22907ec3c1aa | MATLAB | 6,265 | 165 | %% Export Continuous Data To Corpus Emulator
%
% <html>
% Import continuous data into Matlab using TDTbin2mat <br>
% Export to binary files that are read into Corpus as PZ5 data <br>
% Use SynapseAPI to generate new recordings with this data <br>
% Concatenate the resulting data sets into one master data structur... |
81389ffa1f7c9a03c08410641576d181e9e466ee8a0a174e60089362474ac46c | MATLAB | 6,289 | 255 |
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
V = round(pix2deg*2);
W = round(pix2deg*2);
S = imSize;
M = S(1) - mod(S(1), V);
N = S(2) - mod(S(2), W);
MV = M / V;
NW = N / W;
sigXY = pix2deg * .25;
load('a0_0_bhv2trialStrct.mat');
N1 = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
49
52
5... |
63fb09b5d1f7c9932af8ed283dd719d7d682d8c070da36b280a30fc6e67a1c9f | MATLAB | 6,291 | 252 | %io_loadspec_GE.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% [out,out_w]=io_loadspec_GE(filename,subspecs);
%
% 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).
%
% op_loadspec_GE outputs the data in... |
84af7c191671b4b5f826ac5e91b2a485cb3304a51334de6c82acc6471b40083e | MATLAB | 6,297 | 161 | function [settings,setTests] = default_settings
% Return a set of default system settings to write to a file in the settings directory
%
% function [settings, setTests] = zapit.settings.default_settings
%
% Purpose
% Defines the default settings of Zapit. These are what are written to YAML when ... |
2c7ed90317c62f23197df51f8038d5c22d20dff9151ba888a546f9c0a46fb417 | MATLAB | 6,300 | 169 | classdef streamingPlotter < handle
% Simple example of defining a class in MATLAB
%
% streamingPlotter.m
%
%
% INTRODUCTION
% This class provides an example of stuff that is easy and natural using object
% oriented programming but more awkard with regular approaches. Please see
... |
6ae4bcba29dc20335c627eea1b8021a38f3bb3c9b9e5273a334ed354cac96a54 | MATLAB | 6,310 | 181 | classdef Test_CalibrationPixelSize < matlab.unittest.TestCase
%TEST_CalibrationPixelSize Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (Constant)
fnCalObj = 'calibration_dummy.mat';
... |
371cec356deceaff03c57b6857dd63081307a35d1e9ee017dac3964d6a1cfdf6 | MATLAB | 6,314 | 131 | classdef (Abstract) settingsValuesTests
% Tests associated with default_settings
%
% zapit.settings.settingsValuesTests
%
% Purpose
% Defines generic tests that can be combined to ensure values in settings file reasonable.
%
%
% See zapit.settings.checkSettingsAreValid for how these... |
9e87baa7e28b808a6af70d3024c231985c10549f40d617d8b0fd336b6a26cb99 | MATLAB | 6,330 | 190 | function [mask_out, Nmask_out, overlap] = FilterMasks(mask_in, varargin)
IP = inputParser;
addRequired( IP, 'mask_in', @iscell )
addParameter( IP, 'break', false, @islogical)
addParameter( IP, 'minFoot', 0, @isnumeric )
addParameter( IP, 'edge', [0,0,0,0], @isnumeric )
addParameter( IP, 'show', false, @islogical ... |
1ce8181c1ae234d75da1c5e9424b0e2ebfdf5b4603f6217f078cb721a7cc2edd | MATLAB | 6,346 | 238 | function run_tests_params_R2013a(varargin)
% Set up the path
testDir = fullfile(utils.CHIPS_rootdir, 'tests');
oldpath = addpath(testDir);
addpath(fullfile(utils.CHIPS_rootdir, 'tests', 'res'));
clear run_method_params
% Work out which tests we should be running
if nargin > 0
testlist = varargin;
else
% Assum... |
326fabeec6d39b593ea9a9d68d16e77d42f838839fee615839a7200cf809c520 | MATLAB | 6,361 | 194 | % DA_TREE Displays the adjacency matrix of a tree.
% (trees package)
%
% HP = dA_tree (intree, color, DD, xyscale, options)
% --------------------------------------------------
%
% Displays the adjacency matrix of a tree by filling in an N x N square
% with 1s and 0s if N < 50 and by black dots if tree is bigger.
%
%... |
4bb3840e8aceb2dea2a043b6b4c585192243f387ed4155e19692d9920cf0e67c | MATLAB | 6,368 | 127 | function [ ROI, Nroi, F, dFF, C, S, O, Sbout ] = ManualROIextract( metadata, T, varargin )
IP = inputParser;
addRequired( IP, 'metadata', @isstruct )
addRequired( IP, 'T', @isnumeric )
addOptional( IP, 'duraMovie', NaN, @isnumeric )
%addParameter( IP, 'server', [] )
addParameter( IP, 'pad', 3, @isnumeric )
add... |
5f8fb49a6fb8ea5e34b9e2e125ce0715af3e0c21cf42af2768aabd2cf1280b5b | MATLAB | 6,370 | 181 | function [rpulset, verbose] = tapas_physio_filter_respiratory(...
rpulset, rsampint, cutoff_freqs, despike, normalize, verbose)
% Preprocesses respiratory data
%
% Key steps
% + Remove NaNs and outliers
% + Optional: Despike with sliding-window median filter
% + Detrend at `cutoff_freqs(1)` Hz
% + Remove no... |
93bcec2e18e00583c7f2b318900acd3ede2209cd02918afcce18c5f7ea4b8879 | MATLAB | 6,379 | 158 | clear;
clc;
spm fmri
func_path = 'G:\Functional_data';
folderstruct = dir(fullfile(func_path,'SEMI*'));
FunImg_sublist = {};
NSlice = 62;
TR = 2;
dcm_file = 'G:\Raw\SEMI1101\1006-sms_bold_2mm_run1\SEMI1101-1006-sms_bold_2mm_run1-00001.dcm';
Slice0 = dicominfo(dcm_file);
SliceOrder = Slice0.Private_0019_... |
dd9605c98e6bd51c3b0907dd85cfe52b50b669e507534573b0f58504cac1491f | MATLAB | 6,386 | 158 | % FigureS11.m
% Create source data files for Supplementary Figure S11.
% Plots were created as screenshots from FSLeyes.
%
% EEG/fMRI STUDY, DONDERS INSTITUTE, NIJMEGEN.
% J. Algermissen, 2018-2023.
% Should work in Matlab 2018b.
% we are here:
% cd /project/3017042.02/Analyses/FiguresOutcomeLocked
% clear all; clos... |
455854d1a37d2aed8d1e6cee163a204b486171ff8d027e6b2e0853a2e9c2207f | MATLAB | 6,397 | 161 | % EEGfMRIPav_OutcomeLocked_9_time_grouplevel_plot
% This is an interactive script---execute it step-by-step.
% Set the appropriate job settings for loading TF data aggregated across
% subjects, then create plots.
% - two-line plot contrasting two conditions of cotnrast
% - multi-line plot contrasting all conditions wi... |
f78798192e0599f851141ab2b767b28efdf7cdd8521bb1e16b96b71303824070 | MATLAB | 6,397 | 123 | function sbxInfo = RegisterCat3D(sbxInfo, regParams, varargin) % mouse, exptDate
% Run scanbox data through stages of rigid 3D registration, z interpolation and affine registration. Optionally, write out tifs showing results from each stage.
IP = inputParser;
addRequired( IP, 'sbxInfo', @isstruct )
addRequired( IP,... |
cc65e11254d3a4127aa11321654c8e279620b5ebf7040d3c7628a42fde55fe8d | MATLAB | 6,416 | 122 | %% Plotting script for eLife paper 2026; contains table of trials and conditions for Zapit eLife paper 2026 plots and plotting code
% Michael Lohse 2026
clear all
try % if folder exist
cd('eLifeDMDMZapitBehaviour')
end
Organised=1; % Organised data is aready saved
if Organised
load('OrganisedV1S1ConPlotting... |
dc539c52ae67d6f0640fda108dfe4ae9ac3446e3a2d35d385ccd6681fda7ba0f | MATLAB | 6,418 | 189 | % clear;
% clc;
%
% eeglab
% %% set the path to the directory with the EEG files
% % change this path to the folder where the EEG files are saved
% EEGdir = 'F:\4447\';
% % retrieve a list of all EEG Files in EEGdir
% EEGFiles = dir([EEGdir '*.set']);
% %% 3.3 Data selection and aggregation
% %% 3.3.1 Loadin... |
67ec407519666e551d0b6083c6256a3742ee68ca9520e5d8522d244623a69aea | MATLAB | 6,422 | 163 | function multiLinePlot(job, data, errorbar)
% multiLinePlot(job, data, errorbar)
%
% Creates lineplot for all conditions specified in data.
% Works for both ERP and TFR data.
%
% INPUTS:
% job = cell with relevant fields for plotting settings,
% required fields:
% .nCond = numeric, nu... |
86588df3c3cd928c7be79d000d0418f6db55024f7fb3d5fd1ea60fb4c14a81ef | MATLAB | 6,443 | 192 | function response = processBufferMessageCallback(obj,~,~)
% Process TCP/IP message coming into the buffer from the client
%
% function response = zapit.interfaces.TCPserver.processBufferMessageCallback()
%
% Purpose
% Callback function that handles the TCP messaging system for zapit.
% For m... |
33b09d8ef0e6ac5118edfcc5eb4d158645cada9cafa80b6a5444d870d5ce41d4 | MATLAB | 6,452 | 168 | function f = LK_PlotPlaceCell_20220330(dt)
%
% LK_PlotPlaceCell_20220330 plots firing rate as a function of location.
%
% Input is a structure with multiple fields:
% visible --> whether the figure shall be shown
% place --> place settings
% FR --> firing-rate map
% PF --> place fiel... |
0b0fff6f1572ca1156bacdab14e420ca2afac2c4a2a051644f02bc425822e298 | MATLAB | 6,465 | 128 | % ----------------------------------------------------------------------------------------------
% -- Title : VocalMat Analysis
% -- Project : VocalMat - A Tool for Automated Mouse Vocalization Detection and Classification
% -------------------------------------------------------------------------------------... |
e5b17dfd961618c23df9ec27c1d6882e943564d26f31e13d30df205e15fae872 | MATLAB | 6,473 | 155 | %%==========================================================================
% This is the main part of codes for neural utility model in Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness
% This script should be used in combination with the function file:
% Neural_utility_model.m
% Detaile... |
0890babd128fd05e1ee4d867a59358bf21b2dd2afd1e38c78262009dd93716ee | MATLAB | 6,479 | 155 | %%==========================================================================
% This is the main part of codes for reciprocity model proposed by Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness
% This script should be used in combination with the function file:
% Reciprocity_model_function... |
4f05ae12d23a0f690d348a16b5609f96e908fa70e7141d14087ce25605df37a3 | MATLAB | 6,480 | 182 | %==========================================================================
% This script examines the percentage of IEDs during the OpenField task and
% plots example IEDs.
%
% Lukas Kunz, 2022
%==========================================================================
% start
clear; clc; close all;
addpath(genpath('... |
89ac1cdaa5c28e8c0695f9fb6e152e8bbfe5b9c60224f8b6e1617c6e6241b2f3 | MATLAB | 6,480 | 127 | function InspectPeriDeform3D(expt, periBout, defVars, varargin) % periStat,
% Visualize deformation variables associated with locomotion bouts
IP = inputParser;
addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'periBout', @isstruct )
%addRequired( IP, 'periStat', @isstruct )
addRequired( IP, 'defVars', @isc... |
966f08c8a6b05ab358e27895d2382d371240a4725b340ec966144fc56aa19a18 | MATLAB | 6,485 | 166 | function X = simulate_erp_peak(n_trials, n_time_points, pos, width, amplitude, weight, shape, scale)
% Simulates ERP data.
%
% Usage: X = simulate_erp_peak(n_samples, n_time_points, pos, width, amplitude, weight, shape, scale)
%
% Parameters:
% n_trials [int] total number of samples (e.g. trials)
% n_time poin... |
becde8d73071ce13adb0e75d69df863123ab55b2c44b0e439418541d2d8560a6 | MATLAB | 6,491 | 117 | function [BoutOnsetHeatmaps, figParams] = MakeBoutOnsetHeatmaps(figParams, expt, periBout, boutSumm, onStruct, csdBout )
%figParams, expt(x), periBout{x}, boutSumm(x), onStruct(x), csdBout{x}(expt(x).csd)
% Heatmaps of bout onsets pre- and post-CSD, optionally including CSD itself
%if exist(figParams.path,'file') ... |
5b52c5d5839713126e299be3feeda0f9f341d58e49d91ead2a89656b887595fe | MATLAB | 6,493 | 174 | classdef phaseMonitor < handle
% Plot the relative phase of two AO tasks on different boards
%
% vidrio.sync.phaseMonitor
%
%
% Hook up AO0 of DAQ_a to AI0 of DAQ_a and AO0 of DAQ_b to AI1 of DAQ_a
% Then run, e.g. vidrio.sync.phaseMonitor('DAQ_a','DAQ_b';
% The input args are the devic... |
18bda22718711ccdc2f7e5bc79420d14a0caf70b5f6e40271ab60ef9fc6ba310 | MATLAB | 6,503 | 250 |
%To make the first day in new env and last day in old env consistent with
%all later days, we use M2 data for all
load('E:\learningAnalysis\summaryManyMice_includingOldEnvGoodMoreMice\commonUniqueCells\nCellsAllPerM2.mat');
GM=nCellsAllPerM2;
figure
subplot(141)
pie(mean(GM,1));
colormap(summer);
load('E:... |
112ff4644c66f3ea9afbe3bc81199584329dcaf06bc8592ad9e6845a36aafaee | MATLAB | 6,516 | 193 | function [simulations, job] = EEGfMRIPav_cbm_sim(job)
% [simulations, job] = EEGfMRIPav_cbm_sim(nMod)
%
% Perform model simulations or one-step-ahead predictions for given model for given type of parameters.
%
% INPUTS:
% job = structure with the following fields:
% .simType = string, type of simulation, eit... |
0cc69c50063bcd64a78b512c5997386c23e716deed5b559274db7cd81d8269e4 | MATLAB | 6,526 | 158 | % 2021 EDIT: This function is now deprecated. The current version of the
% shaped semiLASER simulation is sim_semiLASER_shaped.m, which employs
% coherence selection rather than phase cycling to null undesired signal.
% sim_semiLASER_shaped_phCyc.m
% Dana Goerzen (McGill University, 2019).
%
% USAGE:
% out = si... |
e59a57c7a749f685dfa30aac72ea5516dffae16d1b63e0eec89a7876c3530cc7 | MATLAB | 6,526 | 180 | function ac = savefor_Figure12(subnum)
subnum
blocknum=12;
channum = 9;
condition=2;
category=4;
frequency=1:1:60;
% filter parameter setting
load([pwd,'\temporary data\parabp_m.mat']);
parabp_m; %2*60
load([pwd,'\temporary data\para_abn.mat']);
para_abn; %2*60*3 a b n
home_path=[pwd,'\temporary data\Do... |
4f5c3e60c5ef521d428e988d3fbe00b9e08422e2284dadf12f1f6e268f01db82 | MATLAB | 6,537 | 165 | classdef Test_ImgGroup_ui < matlab.unittest.TestCase
% ================================================================== %
methods (TestMethodSetup)
function clear_persistent(~)
utils.clear_persistent();
end
end
% ==========================================... |
551eacac47476184c12193c1aa213de6b90b0133cbde47b124202193f6026e35 | MATLAB | 6,539 | 235 | %%
function [fn,saveName]=st_plot_beta(DT, params,roiList)
% params=[];
% initial filter
df = tableFilter(DT,params);
% % params=[]; df=[];
% targetTmodel = {'1ch_glm','1ch_dcts', '3ch_stLN'};
% for tm = 1:3
% params.tmodel = targetTmodel{tm};
% df{tm} = tableFilter(DT,params);
% df{tm} = tableOutlier(df{... |
75cba38187992b471eaa51ffb30602e61b209dee290733001e65ec064d6295d2 | MATLAB | 6,539 | 205 | function [pacmat, freqvec_ph, freqvec_amp] = find_pac_shf (sig_pac, Fs, measure, ...
sig_mod, ph_freq_vec, amp_freq_vec, plt, waitbar, width, nfft, num_shf, alpha,...
dataname, sig_pac_name, sig_mod_name)
% This function calculates a matrix of PAC values using either the ESC, MI
% or CFC measure.
% It uses sh... |
4682006328ea2ba7704bf96375585b79545a4074b8c23f8faea75a4e7573cbe4 | MATLAB | 6,541 | 141 | function val_gamma
% Calibration of the Gamma approximation of the maximum distribution.
%
% FWE-corrected p-values are obtained by fitting a Gamma distribution to the
% permutation distribution of the maximum statistic (moment matching on mean,
% variance and skewness), instead of counting exceedances. Counting cannot... |
7eb1436c1722ef48748d94bb090ed0179c81a5e33abd5d67693fedc6da0ec90e | MATLAB | 6,553 | 188 | classdef (Abstract) IRawImg < matlab.mixin.Copyable
%IRawImg - Interface for classes that include raw images
%
% The IRawImg class is an abstract superclass that implements (or
% requires implementation in its subclasses via abstract methods or
% properties) most functionality related to the rawImg property in o... |
7b23d354066e38148e890fd59deea28b8a6bfa0e1b2979a098c55419243c4faa | MATLAB | 6,559 | 205 | % clear;
% clc;
%
% % start EEGLAB to load all dependent paths
% eeglab
% %% set the path to the directory with the EEG files
% % change this path to the folder where the EEG files are saved
% EEGdir = 'F:\4447\';
% % retrieve a list of all EEG Files in EEGdir
% EEGFiles = dir([EEGdir '*.set']);
% %% 3.3 Dat... |
d6ab39850b9f7ce0e782927aa856a93543d7a4aa9a1e8b9b1535ed2f0c64f62d | MATLAB | 6,565 | 223 | % DELETE_TREE Delete nodes from a tree.
% (trees package)
%
% tree = delete_tree (intree, inodes, options)
% --------------------------------------------
%
% Deletes nodes in a tree. Trifurcations occur when deleting any branching
% point following directly another branch point. Region numbers are changed
% and regio... |
028680534c120f7117395dd0645e471e76f84d21ecb1e6588e63b17deab68529 | MATLAB | 6,574 | 196 | % Load data
clear;
addpath './Tools'
X = 100:1:450; % selected ROI
Y = 100:1:450;
% 0 degree trails
load('./RawRecon/cond3_recon.mat')
ReconData_condition1 = Xt_Stacku8(Y,X,:);
clearvars Xt_Stacku8
% 90 degree trails
load('./RawRecon/cond6_recon.mat')
ReconData_condition2 = Xt_Stacku8(Y,X,:);
clearvars ... |
5f284540fbd483363fa3c48d41aa71a22b664e320d178033e89f4904dbf251bd | MATLAB | 6,574 | 203 | % SORT_TREE sorts index of nodes in tree to be BCT conform.
% (trees package)
%
% [tree, order] = sort_tree (intree, options)
% -------------------------------------------
%
% Puts the indices in the so-called BCT order, an order in which elements
% are arranged according to their hierarchy keeping the subtree-struct... |
0cb24b0abcd4e155dd3739a49d1ac420efd83fe9caa10765e82a896bfedd1de4 | MATLAB | 6,579 | 151 | function InterpZ(sbxPath, sbxInfo, varargin)
IP = inputParser;
addRequired(IP, 'sbxPath', @ischar )
addRequired(IP, 'sbxInfo', @isstruct )
addOptional(IP, 'shiftpath', '', @ischar )
addParameter(IP, 'chunkSize', 15, @isnumeric )
addParameter(IP, 'refChan', 'green', @ischar ) % for scanbox, 1 = green, 2 = red. -1 ... |
5170e6e04f69909daf89a5842f35d24c154541b3fb2d513a6832dee13cb20276 | MATLAB | 6,579 | 198 | function EEGfMRIPav_0_Polhemus_Template(rootDir)
% EEGfMRIPav_0_Polhemus_Template(rootDir)
%
% Interactive script (visually inspect channel locations).
% Load polhemus data of all (valid) subjects, create mean as template for
% invalid subjects.
%
% INPUTS:
% rootDir = string, root directory of project
%
%... |
f7ba921509405178b017732cac6f82fadd4d2350baf81939d8f37de90a912c3a | MATLAB | 6,590 | 141 | function sbxOutputInfo = FixSBX(sbxInputPath, sbxInputInfo, varargin)
checkInfo = @(x)(isstruct(x) || isempty(x));
IP = inputParser;
addRequired( IP, 'sbxInputPath', @ischar )
addRequired( IP, 'sbxInfo', checkInfo ) % @isstruct
if isempty(sbxInputInfo)
[pathDir, pathName, ~] = fileparts(sbxInputPath); % path... |
de74e2313e20a90e0f10e90cdfa5e9416f0c9883e5725302e8306e1967c7e5a6 | MATLAB | 6,595 | 131 | function [varargout] = t2n_getMech(neuron,tree,var)
% This function maps the values of a given NEURON variable onto each
% morphology and optionally returns these values, too;
% INPUTS
% neuron t2n neuron structure or cell array of structure (see
% documentation)
% tree TREES toolbox morphologies
% va... |
cf0ac8f890ebcf7468945fa9b25619b7061a6b21d88735cb5b4ea25b4a65162b | MATLAB | 6,599 | 222 | % SPINES_TREE Add spines to an existing tree.
% (trees package)
%
% [tree, indhead, indneck] = spines_tree (intree, XYZ, ...
% dneck, dhead, mlneck, stdlneck, ipart,
% options)
% -------------------------------------------------------------------------
%
% Attaches cylinders with diameter dhead (dhead = length) to cl... |
3a2ec05ca43b286609f2e9e5d931ebf9da569f8130737af50ff549119222ea4a | MATLAB | 6,607 | 138 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Importing excel file with GT
clear all
close all
T_out = [];
txt_out = [];
raiz = pwd;
% list = dir;
% isdir = [list.isdir].';
% list_dir = list(isdir,:); list_dir(1:2)=[];
% Training DL
model_class_DL = load('Mdl_categorical_DL.mat');
model_class_D... |
cfa9e070dc4360fe4559935ff1997dbbb7480ff67dd166d4d43b590ff9048b99 | MATLAB | 6,607 | 196 | % clear;
% clc;
%
% % start EEGLAB to load all dependent paths
% eeglab
% %% set the path to the directory with the EEG files
% % change this path to the folder where the EEG files are saved
% EEGdir = 'F:\4447\';
% % retrieve a list of all EEG Files in EEGdir
% EEGFiles = dir([EEGdir '*.set']);
% %% 3.3 Dat... |
8a6e9253feea2348096bf6dd21c09a8a717d23c6373d6b7f651d415ad470961e | MATLAB | 6,609 | 199 | % readfid allows one to read in the Varian 4T FID data acquired with:
%
% [K, HDR, BLOCK_HDR] = READFID(FPATH, PAR, DC_CORRECT) reads k-space data
% from fid file if the FID directory FPATH. DC correction based on level
% and tilt can be can be suppressed by setting DC_CORRECT to false. If DC
% correction is applied, ... |
70f38e4aced3bc5da9df1472b78b36ec567149477cdb82f2bb14cfda6ef5cc01 | MATLAB | 6,614 | 212 | % op_CSIoverlayMRI.m
% Brenden Kadota, Sunnybrook 2022
%
% DESCRIPTION:
% Overlay MRSI structure on spm_image graphic. Displays the MRSI specs onto
% the axial plane of the brain.
%
% USAGE:
% op_CSIoverlayMRI('/path/to/nifit/mri.nii', MRSIStruct, 1);
%
%
% INPUT:
% mriFileName = string path to nifti file
% i... |
2953060ff473bc8f0283f74f71d4d1afd22e15efa94da3d84e8042ad189d4d16 | MATLAB | 6,622 | 143 | function hardwareContinuousVoltageOnBoardFIFO
% Example showing hardware-timed continuous analog output using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AO.hardwareContinuousVoltageOnBoardFIFO
%
% Purpose
% Demonstrates how to do hardware-timed continuous analog output using Vidrio's d... |
6db47a8d1c9031ed9d850e97c4e34d0b69a7db0080f6585f2ab83f074d85ecf8 | MATLAB | 6,637 | 275 |
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
V = round(pix2deg*2);
W = round(pix2deg*2);
S = imSize;
M = S(1) - mod(S(1), V);
N = S(2) - mod(S(2), W);
MV = M / V;
NW = N / W;
sigXY = pix2deg * .25;
load('a0_0_bhv2trialStrct.mat');
NIm{1} = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
49
... |
b61c2d7c7fe63da293447804eed6d37d7fd9282be0e440b7c866ad3d21f38c9f | MATLAB | 6,642 | 141 | function tforms_optotune = GetOptotuneWarp(sbxPath, sbxInfo, varargin)
IP = inputParser;
addRequired(IP, 'sbxPath', @ischar )
addRequired(IP, 'sbxInfo', @isstruct )
addParameter( IP, 'chan', 'green', @ischar ) % 'green', 'red', 'both'. for scanbox, 1 = green, 2 = red. -1 = both
addParameter(IP, 'firstRefScan', 3, ... |
01d57b6de0c88b90495101646340ee90e2e25e5a0220bce874895bb82af5b54e | MATLAB | 6,646 | 142 | function hardwareContinuousVoltageNoCallback
% Example showing hardware-timed continuous analog output using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AO.hardwareContinuousVoltageNoCallback
%
% Purpose
% Demonstrates how to do hardware-timed continuous analog output using Vidrio's dab... |
eb6c11f5ac2fe20478d9c753b9ff1457c10566fa0fe025c763ed4ce5dd34a6a2 | MATLAB | 6,649 | 185 | %% Filter and Threshold Raw Data Into Snippets
%
% <html>
% Import raw streaming data into Matlab using TDTbin2mat <br>
% Digitally filter the single unit data using TDTdigitalfilter <br>
% Threshold and extract snippets using TDTthresh
% </html>
%% Housekeeping
% Clear workspace and close existing figures. A... |
2530f2bb7d25ea42570d6a719985e5ec753ecab11c3d984bb099633467cc197a | MATLAB | 6,650 | 206 | function [pacmat, freqvec_ph, freqvec_amp] = find_pac_shf_spec (sig_pac, Fs, measure, ...
sig_mod, ph_freq_vec, amp_freq_vec, plt, waitbar, width, nfft, num_shf, alpha,...
dataname, sig_pac_name, sig_mod_name)
% This function calculates a matrix of PAC values using either the ESC, MI
% or CFC measure.
% It us... |
f0f974f280e68186bada493c0570359c8251a5daca80b768ca289b498bdb1994 | MATLAB | 6,651 | 143 | function hardwareContinuousVoltageNoRegen_2chans
% Example showing hardware-timed continuous analog output without regeneration using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AO.hardwareContinuousVoltageNoRegen_2chans
%
% Purpose
% Demonstrates how to do hardware-timed continuous ana... |
c3362227d0de79a10b92fe7fe9f00f0c074de0e619050b8b35c04c323de821f7 | MATLAB | 6,656 | 168 | function out = LK_3DPermutationTest_TwoSamples_20220302(dat)
%
% LK_3DPermutationTest_TwoSamples_20220302 performs cluster-based
% permutation testing between two three-dimensional datasets (e.g., time x
% frequency x channels).
%
% Note that the statistics are calculated across the third dimension of the
% input data ... |
7117003396b8c55aaa6648fdbfcdec1c312b647ba4cb82739a7af7c2fd1eb42e | MATLAB | 6,661 | 130 | function [fluorEvent, Nevent, actThresh] = GetFluorEvents(expt, T, fluor, varargin)
IP = inputParser;
addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'T', @iscell )
addRequired( IP, 'fluor', @isstruct )
addParameter( IP, 'peri', 60, @isnumeric )
addParameter( IP, 'zThresh', 2, @isnumeric )
addParameter( I... |
5c460c1b45bfddac6ca82078601336e8804ce0bfeb47d33b20bbb147bc9a10ae | MATLAB | 6,701 | 217 | %% Create barcodes plot and data
data=DataSet;
'tic'
tic
cluster_size=20; %minimal number of data points per cluster
distances = squareform(pdist(data));
distances(distances == 0) = 1; %
r_vec = 0.0001:0.0001:0.3;
%r_vec = 0:0.01:10;
all_bins_mat=nan(length(distances),length(r_vec));
values_array={};
indices_array={}... |
db8d72b3f09b03930ddd6db41215dd82339d9108fc23ab3072667b9c8c94f722 | MATLAB | 6,718 | 288 |
figure;
iB=[3 7 8 10];
iG=setdiff([1:1:15],iB);
save('iB.mat','iB');
save('iG.mat','iG');
%% Matrix correlation %2 figures
load('E:\learningAnalysis\behaviorVSActivity\MatrixCorrelation\deceNTDiffCM\corrM.mat');
NPerMouse=9;
idxB=[];
for n=1:length(iB);
a=[NPerMouse*(iB(n)-1)+1:1:NPerMouse*iB(n)];
... |
61f9a0aa87bd50f4032314eb6db71684d44445197b070a3b691210917224cf81 | MATLAB | 6,725 | 160 | function taft_postprocess_TF_main()
% taft_postprocess_TF_main()
%
% Interactive script.
% Main script to load a previously created TAfT object, align data
% (channels) across subjects, do one-sample-t-test across subjects and plot
% as TF plot and as topoplot.
% Use this script to select fMRI and behavioral regress... |
112997ed3956a0862b91e7eeef3023f0aea7563477c8bb22d542853d1bbc3593 | MATLAB | 6,726 | 230 | % SYNCAT_TREE Steady-state synaptic elect. signature of connected trees.
% (trees package)
%
% syn = syncat_tree (intrees, inodes1, inodes2, gelsyn, ge, gi, Ee, Ei, ...
% I, options)
% -------------------------------------------------------------------------
%
% Concatenates many trees with electri... |
0fac0e142de2f65c62cbfcf16d654fac12b684c4dde0e43e9cfdff5afc105bcd | MATLAB | 6,727 | 173 |
%%
% locally mount data.
% in terminal:
% sshfs alexg8@login.sherlock.stanford.edu:/oak/stanford/groups/giocomo/export/data/Users/WButler /home/alexgonzalez/oak_wb/
%%
data_info_dir = '~/Documents/data/butler_hardcastle/';
file_name = 'wb_kh_data.mat';
% loads two variables:
% 1) cell_info_trained
% 2) grid_cells_fr... |
f10ee6328286473a9a20d0795fda66119794583f33340d8e8b1bcdba5b9d0105 | MATLAB | 6,738 | 156 | %%==========================================================================
% This is the main part of codes for reciprocity model proposed by Gao, X., Jolly, E., Yu, H., Liu, H., Zhou, X., & Chang, L. J. (2020). The hidden cost of receiving favors: A theory of indebtedness. BioRxiv, 2020-02. doi: https://doi.org/10.1... |
bffcfa694fc391abb2063552e4fe61b2e2a2869db6b9346f4e072d4c069ebdbd | MATLAB | 6,753 | 163 | function param = mv_get_hyperparameter(model, param)
% Returns a struct with default hyperparameters for a given
% classifier or regression model.
%
%Usage:
% param = mv_get_hyperparameter(model, <param>)
%
%Parameters:
% model - [string] the classifier or regression model (eg 'lda')
% param - [str... |
5a2f1201db6f7a5903cb30172b605be236f512eb9a5f8479bd336bbddf76713c | MATLAB | 6,760 | 137 | % top1
% models_comparison(:,1) = models{1,1}(:,1);
% models_comparison(:,2) = models{1,1}(:,7);
% models_comparison(:,3) = models{2,1}(:,7);
% models_comparison(:,4) = models{3,1}(:,7);
% models_comparison(:,5) = models{4,1}(:,7);
% models_comparison(:,6) = models{5,1}(:,7);
% models_comparison(:,7) = models{6,... |
11429e1078b2b0e698b0f71a78d249ad697c8727c3893a00230a634e76c7852e | MATLAB | 6,771 | 218 | %% Pipeline for processing fMRI phase and magnitude data for QSM using the QSM toolbox
%
% fMRI presents the possibility of saving phase data, which can be used for
% QSM or as input to other phase-sensitive MR imaging pipelines
% 29 Nov 2022
% Editors (alphabetical order):
% Alexander Jaffray: ajaffray@physics.ubc.ca... |
94e80b7910bc61f0d54b723215e5ed904186215e37f8d162bcd10c25214822fc | MATLAB | 6,789 | 320 |
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
V = round(pix2deg*2);
W = round(pix2deg*2);
S = imSize;
M = S(1) - mod(S(1), V);
N = S(2) - mod(S(2), W);
MV = M / V;
NW = N / W;
sigXY = pix2deg * .25;
load('a0_0_bhv2trialStrct.mat');
NIm{1} = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
49
... |
91c3018713d22b4649536217f757b60cf9dc15d3eeee00327de504947a41bc1c | MATLAB | 6,794 | 201 | % RPOINTS_TREE Weighted distribution random points within a hull.
% (trees package)
%
% [X, Y, Z, HP] = rpoints_tree (M, N, c, x, y, z, thr, options)
% -------------------------------------------------------------
%
% Distributes N random points in accordance with the density matrix M. Only
% points within the sharp ... |
e6e8c5469c94eef8cbea92126764a281ba79ac235f80a77a43e81451c6c5af5d | MATLAB | 6,811 | 185 | % Usage: strvec = vect2colon(vec, options)
%
% Converts a vector into a string using MATLAB colon notation (single resolution).
%
% Options are:
%
% 'Delimiter' - 'on','yes','off','no' {default on} : Including square brackets []
% (or curly brackets {} when output's dimensions... |
50d2efc0c7a105ca019004c99afe9480a4535ff5ed27f2959252ad1b3e85d48b | MATLAB | 6,841 | 158 | %%==========================================================================
% This is the main part of codes for help rejection model proposed by Gao et al., 2021, The hidden cost of receiving favors: A theory of indebtedness
% This script should be used in combination with the function file:
% Help_rejection_model_fu... |
5f364a70b3a03877f34adf6b5468dc0fa197b0012e02dae061642661d32186c1 | MATLAB | 6,841 | 183 | %decc_plotFig5
% Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024
% PV 2024
load('DECCdataFig5.mat')
% Figure parameters
lcolor = [ 0.2 0.2 0.2; 0.0 0.4 0.5; 0.6 0.3 0.0; 0.1 0 0.5; 0.2 0.2 0.2; 0.2 0.2 0.2];
fstr = ['N1';'N2';'De';'SP';'Rl';'Ac'];
dur = 3700;
stp = 20;
wdw = 199;
kern = 50;
ts = dur/kern; %no.... |
1b850329cfa519cd48b90ca1af6afdf40ed7baa1f51a9457fd5a0bef6780691e | MATLAB | 6,842 | 154 | % 2021 EDIT: This function is now deprecated. The current version of the shaped
% PRESS simulation is run_simPressShaped.m. The current version employs coherence
% selection, resulting in a 4x simulation speed increase.
% run_simPressShaped_phCyc.m
% Jamie Near, McGill University 2015.
%
% USAGE:
% This script is run... |
15958410f4875ff5dc10a64c87989911646ebbfe86f0e433d8096e55fe78d661 | MATLAB | 6,843 | 173 | function varargout = motion_correct(self, varargin)
%motion_correct - Motion correct the images
%
% motion_correct(OBJ) motion corrects the OBJ using the utility function
% with default parameters.
%
% motion_correct(..., 'useParallel', TF) explicitly specifies whether to
% perform the motion correction in para... |
33ebeff18857ffe9f7741dcb81cccc3bb1e1556e4737757a528c0301b0c8b16e | MATLAB | 6,845 | 152 | function [transEst, emitEst, discreteExptData] = TrainLocoHMM(loco, varargin)
% Determine locomotive state using a Hidden Markov Model
IP = inputParser;
addRequired( IP, 'loco', @iscell )
addParameter( IP, 'overwrite', false, @islogical )
addParameter( IP, 'int', 0.1, @isnumeric )
addParameter( IP, 'var', 'veloci... |
e31d668ef42b2d44e0151b2a906ccf45e4f304a2a3d9a611ba084efe4017ec99 | MATLAB | 6,849 | 218 | % Compute expected EEG variance of 16 billion passive neurons
load(fullfile(dataFolder,'cortex_anatomy','anatomy_cortical_pairwise_distance_distribution.mat'));
signed_area = A;
N = 16e9;
dMids = 0.5*(rValues(2:end)+rValues(1:end-1));
nrnCount = mean(diff(signed_area),2)*200000;
nrnCount(end) = N-sum(nrnCount(1:end-1))... |
ee738258cf5ab9ee01f4504e3c331dfbf88f662bd539aa92892964379d442951 | MATLAB | 6,870 | 141 | function J = customcolormap(positions, colors, m)
%-----------------------------------------------------------------------
% FUNCTION "customcolormap" defines a customized colobar given the %
% positions and the colors that are going to generate the gradients. %
% ... |
d354a6cb1a8620e51b770bd9175c2cc0d8711d0ad5d06cadb8b8d2324f55f0d6 | MATLAB | 6,874 | 198 | %io_loadspec_rda.m
%Jay Hennessy, McGill University 2016.
%
% USAGE:
% [out]=io_loadspec_rda(rda_filename);
%
% DESCRIPTION:
% Reads in siemens rda data (.rda file).
%
% op_loadspec_rda outputs the data in structure format, with fields corresponding to time
% scale, fids, frequency scale, spectra, and header fields c... |
806e56e7647fab60e49951a46b49bb8a031107fb95aa9adbb18c9467c745b4c0 | MATLAB | 6,877 | 218 | function gitInfo = getGitInfo
% Get information about the Git repository in the current directory.
%
% function gitInfo = zapit.updater.getGitInfo()
%
% Purpose
% Get information about the Git repository in the current directory. Including:
% - Branch name of the current Git Repo
% - Git SHA1 HASH of ... |
8fc17762c831f83daf5951e0b0ba546be733a7d8547209151eb0e8b873789cbf | MATLAB | 6,891 | 286 | %
clear
close all force
load('a0_0_bhv2trialStrct.mat');
load a16_0_SacProperties.mat
%}
%%
iMonkey = 1;
UMuscimol = [ 0, 12,9 ,4,1 ,14,11 ,6,3 ];
UMuscimol = [ 0, 12,9 ];
UMuscimol = [ 0, 12,9 ,4,1 ];
UMonkey = [1,3];
nMuscimol = numel(UMuscimol);
figure(1);clf
figure(2);cl... |
375c074885bb2abb240d6b29b400cd0c3e65d507f2e4f9172c8633bbbe88c28d | MATLAB | 6,895 | 178 | classdef CalcDetectSigsCellSort < CalcDetectSigs
%CalcDetectSigsCellSort - Class for detecting and classifying signals
%
% The CalcDetectSigsCellSort class is a Calc class that detects and
% classifies signals in previously identified ROIs.
%
% CalcDetectSigsCellSort is a subclass of matlab.mixin.Copyable, which... |
a73c585018d31c2fa808e15750a6607e9282e2e093d51d3adabde16aa3a0a810 | MATLAB | 6,899 | 146 | %% Calculate CSD cross-correlation within each fiber
for x = intersect(xPresent, find(Nfiber>0)) % 37 %
if x == 37
csdOnsetWindow = [13, 27];
else
csdOnsetWindow = [-2, 12];
end
gaussFilt = MakeGaussFilt( 4, 0, 1/expt(x).scanRate, expt(x).scanRate, false ); % 8*(1/expt(x).... |
1dfe4931507150116d126c515451469561d10864f0807e0c5fb835f7960a045c | MATLAB | 6,904 | 249 | function [Crop, MethodMask, Thresholds, Mask] = SelectROI(hgaMap, mapLabel, hgaMask)
%% function [Crop, MethodMask, Thresholds, Mask] = SelectROI(hgaMap, mapLabel, hgaMask)
%
% Interactive selection of ROI.
%
% Input:
% - hgaMap: array of response maps in image handles used ROi selection.
% typically res... |
48076b32301020711f4a726c35b3519c87f1aaa273c532875bbfc43e6bca053c | MATLAB | 6,906 | 139 | function [W1,Wp,Clist_GT,Wm, X, threshold_GT] = sampling_ind_reg(subject_num, N, sigma0, f2, DF, cluster_size, rho_in, rho_out, L, Reliability)
% SAMPLING_IND_REG Simulates data for independent regression analysis.
%
% This function generates a simulated dataset for regression analysis,
% where the network structu... |
441d7464788a15326e9599b5d6dabe9821cbfca8c3a6766ed9f33a37af861e08 | MATLAB | 6,912 | 128 | function [periBout, periParam, loco] = PeriLoco3D( expt, T, loco, deform, fluor, defVars, varargin ) % , periStat
% PeriBoutData gather relevant data from a defined period of time around the onset of each bout of running.
IP = inputParser;
addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'T', @isnumeric )
ad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.