sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
311ecf7fe6b7d72050521b1d5ee9a9e4d0edd1a3be280af22fe0e19f07ee3550
MATLAB
4,845
135
function varargout = load_xls(varargin) % LOAD_XLS M-file for load_xls.fig % LOAD_XLS, by itself, creates a new LOAD_XLS or raises the existing % singleton*. % % H = LOAD_XLS returns the handle to a new LOAD_XLS or the handle to % the existing singleton*. % % LOAD_XLS('CALLBACK',hObject,eventDa...
8c197966c1a0f80fb9efbc74a5a5d09768d3fc4bb05e52e457d343596e0b8461
MATLAB
4,846
151
function [ec2Instance] = awsEC2StartInstance(ec2RunStructure,instanceType,numberOfInstances,v) %This function starts an EC2 instance, returns instance hendle, it will %wait until instance is up and ready to recive commands %INPUT: % ec2RunStructure - see awsEC2BuildRunStructure for details % instanceType - see...
72dca11a07189e08681936ff28ab59534fec5c401f06b02560d13df715cfa0c1
MATLAB
4,858
137
%This script generates histology instructions %% Inputs subjectFolder = s3SubjectPath('01'); yourName = 'MyUser'; iteration = 1; isCutOnDotSide = 1; %1-true, -1 - oposite side %Distance to OCT origin: %In iteration #1 - distance from full face to origin %In following iterations - distance from current pos...
870a10f0d564aa3c3901ce73b00ce7cade8aba4649001b433e77cafc8d8b3f85
MATLAB
4,862
175
function [cmds, errs, msgs] = downloadSharedLibs(options, appname) cmds = {}; errs = 0; msgs = {}; if ~exist('options','var') || (isnumeric(options) && options==0) options = 'init'; end s = parseGitSubmodulesFile(); if ~optionExists_startup(options,'init') && ~optionExists_startup(options,'update') addSearch...
e4f616cc5e2ae75d35855531646b4cf09a63a12ca65bd5764079a81460a06889
MATLAB
4,880
142
function this = ci(this) %CI statistical inference % % Note: % Only works when one component is fitted. % For multiple components fit, math hasn't been worked out % % see also: FIT, PLOT, COSINOR % % $Author: Peng Li % Brigham and Women's Hospital % Harvard Medical School % ...
341b930046c22a4d540fd3a2027ca0c43f507ebf1ff366234dbef8b0643e9d04
MATLAB
4,881
160
classdef FileLoadSaveClass < matlab.mixin.Copyable properties (Access = private) filename; fileformat; supportedFomats; err; dataStorageScheme; end methods % ----------------------------------------------------------------------...
58dfa1f9c88b5922ecc18f34e89a2117b31336eb1b6696bd7e523f33d2cb8bbe
MATLAB
4,884
139
function [h, p, ci, stats, n, stderr1, stderr2]=total_ttest_downreg_210326(table1, table2) % Assumes tables 1 and 2 are already organized % input the metadata from the spontaneous and stimulated datasets into this function % if all(~ismember({'Electrode Pairs','Spike Area','Conduction Time','Unit Pairs','Direction'},...
8ca41b2071b6bd63cfa07db399f714c0e51a32435a4e9f078ce89547998a9385
MATLAB
4,886
147
%DEMGMM5 Demonstrate density modelling with a PPCA mixture model. % % Description % The problem consists of modelling data generated by a mixture of % three Gaussians in 2 dimensions with a mixture model using full % covariance matrices. The priors are 0.3, 0.5 and 0.2; the centres % are (2, 3.5), (0, 0) and (0,2); t...
f5814cc9889758c53d3168a350cbc8f9a7b5b652dd49367f8120a9ee2824f831
MATLAB
4,886
99
function [event_no_error,deleted_events] = Event_clearComments(event_orig,verbose) deleted_events.newSegment = []; deleted_events.overflow = []; deleted_events.Comment = []; deleted_events.deleteOrder = {}; ...
5326e671cb22c76b3c2bd04701e599b7db66f02c15386ac4d476c88541c52547
MATLAB
4,889
147
%DEMGTM1 Demonstrate EM for GTM. % % Description % This script demonstrates the use of the EM algorithm to fit a one- % dimensional GTM to a two-dimensional set of data using maximum % likelihood. The location and spread of the Gaussian kernels in the % data space is shown during training. % % See also % DEMGTM2, GTM,...
0b6fef1dcb45affa68627da9e22d8eab8cec968f526365d4c553d92d4095d0b0
MATLAB
4,894
185
% Test 3: transient SPGR, WM simulation addpath(genpath('lib')); addpath(genpath('EPGX-src')); %%% White matter model (see Gloor 2008) f = 0.1166; %% F=0.132 = f/(1-f) => f=0.1166 kf = 4.3e-3; kb = kf * (1-f)/f; R1f = 1/779; % ms^-1 R1b = 1/779; %<- Gloor fix as T1f R2f = 1/45; R1obs = 0.5*(R1f + kf + R1b + kb)-0.5*...
2375e8461f6741ffeca730d215169a05e4ac934a9c283bf3f24fdad5bf0321e4
MATLAB
4,894
133
function [areas,total_bins,overlap_bins, total_area, overlap_area]=... conduction_time_peak_finding_210816(stim, stim_dir, parent_dir,if_cw) % Testing peak finding capabilities across multiple units for elimination % of zeros % Fixed saving issue and added bin count for percent overlap bins 7/7/21 total_bins=0; ov...
ed02af8cbf7e4d09bb7990be4e4c03f118ad5acf46c1b7644836e27fcdad0b54
MATLAB
4,896
102
% This script is the default template, but with a modification that allows % balancing confounds. The two main approaches for controlling for % confounds are balancing confounds (by subsampling, supersampling, % or weighted classification) or analyzing data separately for each % confound. The approach in this file ...
9e356fd79f822fbf9637db5887387fd1df16b8f9b554c1c089ad8682122a9721
MATLAB
4,897
188
clear all [task_info,supPath,MaestroPath] =... loadDBAndSpecifyDataPaths('Golda'); NUM_COND = 20; req_params.remove_repeats = 0; req_params.grade = 7; req_params.cell_type = 'CRB|PC|BG|SNR'; req_params.task = 'choice'; req_params.ID = 4000:5845; req_params.num_trials = 180; req_params.remove_question_marks =0; re...
11c24c5ad4e6b5626949c706e1cc69a31a99f52055b5c20d61c80aeaa976c675
MATLAB
4,901
181
function [net, options, errlog, pointlog] = olgd(net, options, x, t) %OLGD On-line gradient descent optimization. % % Description % [NET, OPTIONS, ERRLOG, POINTLOG] = OLGD(NET, OPTIONS, X, T) uses on- % line gradient descent to find a local minimum of the error function % for the network NET computed on the input data...
3fda4ce750c95fe0e6b0a510818cf4fb6380a14d1a6e013a8d1da4f1fa9c207b
MATLAB
4,902
126
function varargout = load_data_1_var(varargin) % LOAD_DATA_1_VAR M-file for load_data_1_var.fig % LOAD_DATA_1_VAR, by itself, creates a new LOAD_DATA_1_VAR or raises the existing % singleton*. % % H = LOAD_DATA_1_VAR returns the handle to a new LOAD_DATA_1_VAR or the handle to % the existing s...
498d425f2d1d38d6544554063292b0b66a969f819e7e53c251f15d883ff53e58
MATLAB
4,902
129
%% COLLECTIVE ANTI-PHASE BEHAVIOR % SETTING clear rng(170) % seed Path = [pwd, '\IN_sims\']; clrs = ["b","r","g","k","c","y"]; % colors per_clr = [0.9290,0.6940,0.1250]; % periodogram color % TIME T = 1200; % time span dt = 0.01; % COUPLING eps1 = 0.10; eps2 = 0.10; epsilon = [ eps1, eps2; ... ...
04e45c2418e0d64c301cd817ac69b60fd0b20f61f1482103895efe696ac7ba1e
MATLAB
4,903
181
clear [task_info,supPath,MaestroPath] = loadDBAndSpecifyDataPaths('Vermis'); TASK= "both"; MONKEY = "albert"; req_params = reqParamsEffectSize(TASK,MONKEY); behavior_params.time_after = 1500; behavior_params.time_before = 1000; behavior_params.smoothing_margins = 100; % ms behavior_params.SD = 20; % ms ts = -behavi...
c6629a9b942f1f5bec845cd691ab020f26c4077fd7d1fe943641af82dc53f21e
MATLAB
4,911
143
function this = ci(this) %CI statistical inference % % Note: % Only works when one component is fitted. % For multiple components fit, math hasn't been worked out % % see also: FIT, PLOT, COSINOR % % $Author: Peng Li % Brigham and Women's Hospital % Harvard Medical School % ...
f8b1236f4c3c2013caf6decaced5967dbf3a734cdbfc42461215c0a0b356edd4
MATLAB
4,913
135
% modeNoiseAxis: 1 use PCA, 2 use covariance matrix of entire data, 3 use average noise covariance matrix % Node for modeNoiseAxis=2: this will also include signal correlations. This is useful when comparing % against a within-group scramble, in which signal corrs will be preserved. % %urut/aug23 function [errRate...
10b3017a20631c8a396a36669f72f5b44038468e08b4a729f418050c24faf9b1
MATLAB
4,914
140
function [h, p, ci, stats, n, stderr1, stderr2]=total_ttest_upreg_210326(table1, table2) % Assumes tables 1 and 2 are already organized % input the metadata from the spontaneous and stimulated datasets into this function % if all(~ismember({'Electrode Pairs','Spike Area','Conduction Time','Unit Pairs','Direction'}, t...
474094a0baa027331e628aeb9efb39d8558efd3b243b8e51fc72a01dc9789fec
MATLAB
4,915
96
% This script is a template that can be used for an encoding analysis on % brain image data using cross-validated Mahalanobis distance. It is for % people who have betas available from an SPM.mat (for AFNI, see % decoding_tutorial) and want to automatically extract the relevant images % used for calculation of th...
a350c3f21874ad955ba8219e1d0609dc6504374eec7800d56900ea3d281e2992
MATLAB
4,923
138
%% Access data loaded from import script nwb = nwbAll_sb{:}; tsMaint = nwb.intervals_trials.vectordata.get('timestamps_Maintenance').data.load(); electrode_labels = string(nwb.general_extracellular_ephys_electrodes.vectordata.get('location').data.load()); electrode_origChan = string(nwb.general_extracellular_ephys_...
574dc0b693c5ff73c2669a0a58e1f820193cb0818a50179ed2857fc201ec50a1
MATLAB
4,931
156
function [yo, fo]=mtcsd2(x1,varargin) %function [yo, fo]=mtcsd2(x,y,nFFT,Fs,WinLength,nOverlap,NW,Detrend,nTapers); % Multitaper Cross-Spectral Density % function A=mtcsd2(x,y,nFFT,Fs,WinLength,nOverlap,NW,Detrend,nTapers) % x,y : input time series % nFFT = number of points of FFT to calculate (default 1024) % Fs = sam...
35cd50c53b5164fb15c0f1b5f997e9cb8e75e259d7a7fb9bcc0cabb87f9ff196
MATLAB
4,934
139
function [h, p, stats, n, stderr1, stderr2]=total_wilcox_downreg_210630(table1, table2) % Assumes tables 1 and 2 are already organized % input the metadata from the spontaneous and stimulated datasets into this function % if all(~ismember({'Electrode Pairs','Spike Area','Conduction Time','Unit Pairs','Direction'}, ta...
2bfe00731ba3866f6a95d598b471b6d80753ccf10c3cd09be9c51ffcba566f6f
MATLAB
4,938
129
% function [Segs, Complete] = LoadSegs(FileName, StartPoints, SegLen, nChannels, Channels, % SampleRate, ResampleCoef, Buffer, IfNotComplete) % loads segments from FileName (full name) for selection of Channels % StartPoints give the starting times of the segments (in samples)...
44dd07621af25bf7f76a5dcaa6d707b91d0cf31b383ee7cd67856c5a3d8c5ddc
MATLAB
4,945
143
#import "UnityAppController.h" #import "Unity/UnityInterface.h" #import "UnityAds/UnityAds.h" #import <UnityAds/UADSBanner.h> #import "UnityAds/UADSMetaData.h" #import "UnityAdsUtilities.h" #import "UnityAdsPurchasingWrapper.h" #import "UnityAdsInitializationListener.h" #import "UnityAdsLoadListener.h" #import "Unity...
55dad5321a0d48aaf2a0bb6b7fa380c11d6a93f1a20c4af5f514d74793c420fb
MATLAB
4,964
141
% Data location data_location = TFR_Clustered_Data; save_data_location = TFR_Clustered_Data; % Condition name Condition_Name = cond_labels; % Channel list Channels = cluster_labels; %% PT vs. Color % Plot contrast figure; clf idx_subplot = [3,11,15,7,9]; for chan=1:length(Channels) ...
9c14ce57fe202bbfc82b356e6c8051d8f2f177687ca262607244360090d67df5
MATLAB
4,964
140
function [h, p, stats, n, stderr1, stderr2]=total_wilcox_upreg_210630(table1, table2) % Assumes tables 1 and 2 are already organized % input the metadata from the spontaneous and stimulated datasets into this function % if all(~ismember({'Electrode Pairs','Spike Area','Conduction Time','Unit Pairs','Direction'}, tabl...
49d92234db87adefa744556d077641667404a8ab7b17d480ee5aea98a072883a
MATLAB
4,969
117
function SemiCircleBullsEye(Struct2Plot, Sig, RANGE, COLORSCHEME,... XTICKLABELS, WEDGELABELS, param) %SemiCircleBullsEye creates a semicircle bullseye plot with each wedge of %the bullseye colored by a value (magnitude of change frome baseline). %Area/time bins significantly above baseline will have an asteris...
b4dfed056d07011aab2d9577a989fb5012060cf49a6fba042049a3b292e63f0b
MATLAB
4,974
106
function PlotMeanTSRepeatedMeasures_PercentInc_FlexibleCondInt( PerIn_ByTS_preVpost, pulse_idx, pulse_num, TITLE, YLABEL, YLIMS, XLABEL, XLIMS, XTICKS,XTICKLABELS,... DATALABELS, DATACOLORS, stdOrsem, cmap, cmap_num) % Michelle Cahill 20201006, updated 20201019 %PlotMeanTSRepeatedMeasures_PercentInc_FlexibleCond...
5f120b36eb3f3ffb270dcd2d8b8eab6ed8c181524da61c6f021c87f58754491f
MATLAB
4,976
182
function [samples, energies, diagn] = metrop(f, x, options, gradf, varargin) %METROP Markov Chain Monte Carlo sampling with Metropolis algorithm. % % Description % SAMPLES = METROP(F, X, OPTIONS) uses the Metropolis algorithm to % sample from the distribution P ~ EXP(-F), where F is the first % argument to METROP. T...
2a9d176ed3b1a8bbad7593c98778cb58ac2190b536edeb74a641c35d3381a3e7
MATLAB
4,977
109
clear () ; close () data_path='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/timeseries/outputs/Turbulence_30_06_2022/'; data_path_rev='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/timeseries/outputs/Turbulence_20_06_2023/'; % Data from controls cd(data_path) load('turbu_all_measurements_openneuro_controls_con1.mat') Turbu...
8d73a960eebb20262e4fa0d52aaefaf7453ae7bb08557245014241265d320387
MATLAB
4,988
116
function outHandle = barWhiskerBridge(inBar,inWhisker,inBridge) %BARWHISKERBRIDGE creates a bar-and-whisker plot with bridges connecting %related bars % OUTHANDLE = BARWHISKERBRIDGE( INBAR , INWHISKER , INBRIDGE ) outputs % the handle to an 'axes' containing a bar-and-whisker plot based on the % information in...
c1531ab546d1d5928eb62d514eace47ca8feb7d1df4eb607a1655646730020bc
MATLAB
4,988
120
function [class_low_sig,class_high_sig] = System_permutation_test(zX_RS,U,Vlow,Vhigh,mean_low,mean_high) % To examine the significance of system-level concentration of low- and high-frequency signals, % we performed a non-parametric permutation test for each cortical class % % ==================================...
8f09533e3162d0aaff9ce318954a41c72a99c9d88b552a1713c0b57b84b0cb8b
MATLAB
4,993
137
function this = m10l5Analysis(this) %M10L5ANALYSIS Perform nonparametric M10 and L5 analysis on an ACTI object % % $Author: Peng Li % $Date: Jun 15, 2021 % $Modif.: Jun 25, 2021 % instead of calculating per day, average the days first % see comment where revised % Feb...
a0c11dc2970a7de954d9476237e14f4c90352d112fb009e08d149232247207f0
MATLAB
4,996
143
function [OCTFolders,folderNames] = yOCTGetOCTFoldersInPath (p) %This function returns all OCT folders that are found in path p. %If p is an OCT folder it will return it, if p has sub-folders, this %function will search in subfolders. %INPUTS: % p - root path to search in. Can be on local disk or Amazon S3 %OUT...
55e5e040f204c8c49b9453c751e469860a0cb1ea29e5b9f6f94bc2991e211d02
MATLAB
4,997
181
function [mix, options, errlog] = gmmem(mix, x, options) %GMMEM EM algorithm for Gaussian mixture model. % % Description % [MIX, OPTIONS, ERRLOG] = GMMEM(MIX, X, OPTIONS) uses the Expectation % Maximization algorithm of Dempster et al. to estimate the parameters % of a Gaussian mixture model defined by a data structure...
b408eebee39e4ba6fb9db2fa51204e3cfd0fedf6a978a15f23afe5a01280d030
MATLAB
4,999
106
% For validation of createSingleTrialHRF_Updated function plotAvgOfSingleTrialHRF(sbjNum) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; saveDir2 = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment'...
5d1e32767fa1c431d556231d8aca7e2a6520a4281694476427b3dbfe77cd75cb
MATLAB
5,000
179
clear all [task_info,supPath,MaestroPath] = ... loadDBAndSpecifyDataPaths('Vermis'); req_params.grade = 7; req_params.cell_type = 'PC ss|CRB|SNR|BG'; req_params.task = 'choice'; req_params.num_trials = 120; req_params.remove_question_marks = 0; req_params.remove_repeats = 0; req_params.ID = 5000:6000; lines = fin...
8ac9cc1ffc1f87924ec66fc49bff3a22d0def702806bdd73136dc7bd9031b7e5
MATLAB
5,000
105
function vidObj = msFindBrightSpots(vidObj,stepSize, frameLimits,dFFTresh, backgroundTresh,plotting) %MSFINDBRIGHTSPOTS Function will identify the frame and pixel location of %local maxima of dF/F across entire video. msFindBrightSpots will step %through the video detecting locations that exceed dFFThresh and %backgrou...
cc43f775b3acdec6ad2d04ac627febfc593dc338a339b57e82fb59b685ae825f
MATLAB
5,008
143
clear; close all; clc; %% Analysis Parameters Day = '111522'; Deinterleave = 4; ChGFP = 1; Rig = 2; % 1: old scientifica, 2: hyperscope %% Load Data PathName = uigetdir(pwd, 'Select a folder'); FileNames = dir(fullfile(PathName, '*.tif')); FileIds = find(contains({FileNames.name},Day)); nFile = length(FileI...
b38e2cf584ca62b04c43368797c94f958fef8716bd684bde94a1cd39b92da70e
MATLAB
5,013
125
%% TWO CLUSTERS ON TWO LEVELS (transient VHFOs, 1400Hz) % SETTING clear rng(3) % seed Path = [pwd, '\IN_sims\']; clrs = ["b","r","g","k","c","y"]; % colors per_clr = [0.9290,0.6940,0.1250]; % periodogram color % TIME T = 700; % time span dt = 0.01; % COUPLING eps1 = 0.05; % within a cluster ...
6bffe0d938217d26d00bfe62b9183da387aef8aac5d17c14e7f921933d0dbf3f
MATLAB
5,016
156
% @author Farad Khoyratee % @date 16 Apr 2019 % @copyright % SPDX-FileCopyrightText: © 2021 Farad Khoyratee <farad.khoyratee@gmail.com> % SPDX-License-Identifier: GPL-3.0-or-later function [Cm, I_stim, Vinit, GVal, EVal, TauMax, Sm, VTraub] = NeuronTypeV2(TypeOfNeuron) if strcmp(TypeOfNeuron,'FS') ...
6e5aa58d4e0f8cb6cb00192b7e6d8d2d667fe8fe5266ec90547bb193386fcb4f
MATLAB
5,021
167
%%% Add analysis scripts and required toolboxes to the search path %%% addpath('/.../VisualImagery_paper/extended/fss_simulation/'); addpath('/.../VisualImagery_paper/analysis/general_purpose/'); % 1. The Decoding Toolbox (TDT), version 3.999E or higher % https://sites.google.com/site/tdtdecodingtoolbox/ addpath('/....
258c9fcdfe2f4293d2ce8e9efa75c66583f96b36b8c23142b60bb126f25e5bb4
MATLAB
5,022
114
function [r, cout] = normconv(signal, certainty, basis, applicability, ... region_of_interest, options) % R = NORMCONV(SIGNAL, CERTAINTY, BASIS, APPLICABILITY, ... % REGION_OF_INTEREST, OPTIONS) % or % [R COUT] = NORMCONV(SIGNAL, CERTAINTY, BASIS, APPLICABILITY, ... % REGION_OF...
bcf3f722020320e099bbcee0235e51f50b3cb42320cf4411e8880aa23c41fc22
MATLAB
5,028
176
function [L, model] = pure_mb_learner(param, behav_data) %% Read behav_data n_trials = behav_data.n_trials; state_switch_on_trial = behav_data.state_switch_on_trial; reward_switch_on_trial = behav_data.reward_switch_on_trial; max_reward = behav_data.max_reward; %% Parse parameter values %(transformations n...
cfc7f7167144094421b72a1a90428cac8ee78c0b419a937cd5baaadcc464b8b7
MATLAB
5,040
122
%Complex wheel kinematics script %Update v3 %C Mount July 2018 clear all; close all; %complex wheel data processing %handle = uigetfile('*.csv'); %identify data file %wheel parameters numRungs = 21; %number of rungs on wheel wheelR = 6; %wheel radius in cm smoothRevs = 100; %number of revolutions o...
0c1b9682390e809b2b0f6975677c5eef95474e3dbaf9d12442c92b41ea2f95fa
MATLAB
5,043
177
% plot histograms job.plot_GFXhistograms=1; % MS ver job.plot_GFXhistograms_cdf=1; % review ver %% set up some directories. %PC homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop\tracking-CFS'; %macbook: % homedir= '/Users/matthewdavidson/Documents/GitHub/tCFS-ver1/'; cd(homedi...
3ac9ae7b6f551696e3674ecb284fe5493dca3b42d5d151329a9b7090f1b24a13
MATLAB
5,047
146
% run CircleAnalysis_BipolarCellTerminal.m options.IsPCA = 1; options.IsDebug = 0; options.EstimationType = 'DoG'; %[Params, ~, Costv] = estimateCenterSurround(ROIFeatures, options); options.EstimationType = 'Amp'; [SimpleCSRio, Curves] = estimateCenterSurround(ROIFeatures, options); options.EstimationType...
0c2a84e8d3c6a5eede39e65e26f9988a23cccb635de8d6b4899a4e645131e0e5
MATLAB
5,051
122
% function [passed_data,cfg] = fill_passed_data(passed_data,cfg,label,chunk) % % This function fills in the fields of passed_data that can (in principle) % automatically be determined. IMPORTANT: There are no checks that the % fields which are filled would have been required for your decoding. This % means please...
b23c5ec6298329b2462ae7e9c456f4e58b12316755a52d3af3390e4de18e442f
MATLAB
5,051
237
clear [task_info,supPath,~,task_DB_path] = loadDBAndSpecifyDataPaths('Vermis'); EPOCH = 'targetMovementOnset'; TIME_BEFORE = 0; TIME_AFTER = 800; FEILD = 'directions'; req_params = reqParamsEffectSize("both"); req_params.cell_type = {'CRB'}; req_params.remove_question_marks = true; lines = findLinesInDB (task_info, ...
1b54ea24e6f6b2071d3f3713d524aa15a90d49788614bbbd4c0556f66bc2f84b
MATLAB
5,053
175
function [L, model] = hybrid_learner(param, behav_data) %% Read behav_data n_trials = behav_data.n_trials; state_switch_on_trial = behav_data.state_switch_on_trial; reward_switch_on_trial = behav_data.reward_switch_on_trial; max_reward = behav_data.max_reward; %% Parse parameter values %(transformations ne...
d6acc684abfa08e00be14c15263cc9ed2fc2d33de0280aef51443db340a9ba1a
MATLAB
5,053
166
clear all supPath = 'C:\noga\TD complex spike analysis\Data\albert\pursuit_8_dir_75and25'; MaestroPath = 'C:\Users\Owner\Desktop\DATA\albert\'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:500...
780f0eb0ea73185a4dee59a036a5cb074c9ec591a47526f881f9313b646eaaf4
MATLAB
5,054
161
% function fig_handle = display_volume(vol, mode, title_str, fig_handle, cfg) % % Show all slices of a volume in a new figure. Slices are along the 3rd % dimension of the input volume (z-direction). % % IN % vol: 3d matrix or name of 3d image (2d will also work, then it plots one slice) % OPTIONAL % title_...
006006deb920243ac619f3a90a5a3961d24184cd31334bc4f8209933abe92ab0
MATLAB
5,059
153
close all clearvars clc %get user input selpath=uigetdir('*.*','select MINFLUX directory for a single construct') %find result files files=dir(fullfile(selpath,'**','*reeval.xls')); %define edges for histograms edgeX=-0.5:24.5;ctrsX=(edgeX(2:end)+edgeX(1:end-1))./2; Tall=[]; for k=1:length(files) ...
0bc88cba11f18f546f1fafd05432865cd0efad4f84677808b65667061f1240c3
MATLAB
5,076
167
function net = vbhafa(Y, nStates, maxdim, nIter,tol,pcaflag,approach, net) global pa pb alpha alphaa alphapi psii u stran sprior Lm Wa Wpi Lcov... Xm Xcov Qns Qnss QnsCell a b logOutProbs Fhist F iter Ycell = Y; Y = cell2mat(Y); [p n] = size(Y); if nargin<2 error('at least two inputes are expected: data, n...
a5071affa3b54f5aceadd0f44e5fcd1d0e8ad65c471084198076359bc3fdf6b1
MATLAB
5,079
91
%Simulate 40Hz flicker data based on superposition hypothesis, and run PSD analysis. %2024/02/25 %% Set dataset directory and dependent repos: [root_dir,repo]=define_flicker_root_dir; for field_name=fieldnames(repo)' addpath(genpath(repo.(field_name{:}))); end %note: can use function fetch_flicker_subjectIDs to g...
f58c9631dbe0a3d83169c3e9df9cc06e6b0e36ca2ab3a60d9671fb3b8e7ccbfe
MATLAB
5,079
147
% for sbj 08 and 10 function [mlActAuto_Unused, allCues] = getPrunedChns_Special(s,snrThresh) sbjNum = s.name; rawDataFN = s.fName; movieList = s.movieList; %behData = s.resp; startT = s.startT; endT = s.endT; fs = 50; saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experim...
650739191c3a4482715b508dd15621e33c40b1161e5151da25c9bfcb3136d602
MATLAB
5,087
121
function [update] = symmetric_optical_flow_registration(... moving, fixed, movingDeformed, fixedDeformed, ... transformationModel, multiModal,varargin) % OPTICAL_FLOW_REGISTRATION Estimates a displacement field using optical flow % % [update] = symmetric_optical_flow_registration(... % moving, fixed, moving...
db5cdc58aa7413fe93ef915758668a6610bb7b00da670a1fd1a579ae1716f939
MATLAB
5,089
185
function [timescale,f,windownum,alpha]=DFA(data,dfaorder,segments,outfilename,figurenum) %The program performed the detrended fluctuation analysis (DFA) on the provided %signal. %Inputs: % data (signal data points) % segments (segments of data to be analyzed) % dfaorder (order of the DFA for the...
c734c9e95fe6ded518bcd0530ec1fed1282961664dad215ad258b160e40ab50b
MATLAB
5,100
154
function plot_post_scan_questionnaires(p) % Load post-scan questionnaire data vviq_file = dir(fullfile(p.dirs.data, 'questionnaire', 'post_scan.mat')); if isempty(vviq_file) warning('vviq.mat not found.'); return; end load(fullfile(vviq_file.folder, vviq_file.name), 'post_scan') vviq_post = post_scan.('VVIQ po...
4e5b5fda08d9c12a291b9e6acee8a8ecab9b1c4451c8bd13079ee86a8e3adf28
MATLAB
5,102
123
function plot_tunnels_in_graph_220309(unit_match_struct, endNodes, isSlope) get_well_node_no = @(NodeTable, well_name) find(strcmp(NodeTable.Name, well_name)); tunnelEndNodes=string(endNodes.Edges.EndNodes); if isSlope max_lwidth = 2; else max_lwidth = 1; end %% Create NodeTable, and EdgeTable NodeTable = c...
166c7ea22177074d53cee9177ddd20aac12a6d705f274f34de03d24855a29b37
MATLAB
5,104
120
function [T,Y]=msfm(F, SourcePoints, UseSecond, UseCross) % This function MSFM calculates the shortest distance from a list of % points to all other pixels in an image volume, using the % Multistencil Fast Marching Method (MSFM). This method gives more accurate % distances by using second order derivatives and c...
6c1dbe553ab580a5c56b0848dd81b3a754941699418943b3783bd7e7e4118ccf
MATLAB
5,107
189
clear [task_info,supPath,~,task_DB_path] = loadDBAndSpecifyDataPaths('Vermis'); EPOCH = 'targetMovementOnset'; req_params = reqParamsEffectSize("saccade"); %req_params.ID = 5666; lines = findLinesInDB (task_info, req_params); cells = findPathsToCells (supPath,task_info,lines); for ii = 1:length(cells) ...
e8d086b9730ffa22867618bf4d8ce060dcaf24fa1954f869f9d3cf950ff16bc8
MATLAB
5,115
161
function QA = getImagePairVisualQualityMetric(QA) % This function will prompt user to answer a few questions about image pair % quality matric. % QA - default or current QA metric if ~exist('QA','var') QA = []; end % set default answers if exist answer1 = []; answer2 = []; answer3 = []; answer4 = []...
3e3d65ec1ce1d4d556620e1cbc17c01b606f4d9c6a4247f3964f1f1db7a751e7
MATLAB
5,118
152
function h = mv_plot_1D(varargin) %Plots 1D results, e.g. classification across time. If a 2D matrix is given %several plots are created. % %Usage: Two possible usages, either giving additional parameters in a cfg % struct (with cfg.key1 = value1) or directly giving the key-value % pairs as parameters: % ...
0b05084a1d283801c4c995db08de7396937b36f5a0fd2c53c652bee52a61f4d2
MATLAB
5,122
123
function trial_wise_pattern_betas_1st() cfg = load('neurovar_cfg.mat').cfg; for i_sub = 1:44 fprintf(strcat('Sub_', string(i_sub),'\n')); %% Prepare folder sub_dir = fullfile(cfg.global.deriv_dir, 'trial_wise_pattern_betas',... strcat('sub-',sprintf('%02d',i_sub))); mult_con_dir = fullfil...
8fe6f81a2e86a3442a01af3555a8acff860091c39bb3c1dd783dc8faf484f354
MATLAB
5,122
102
function MachSetTimeConstraintPriority(periodSecs,computationSecs, constraintSecs, preemptibleFlag) % MachSetTimeConstraintPriority(periodSecs,computationSecs, constraintSecs, preemptibleFlag) % % Assign the main MATLAB thread "time constraint" status, giving it super % priority over other threads on the system. A t...
6d8583329b7974cb02858e8eb39b940d0706d9e6eab52a14d8fecc00930f304f
MATLAB
5,130
136
%% X = Dfull([(1:nBC)'; remids(:)+nBC], :); options.EstimationType = 'surround'; [SimpleCSRio, Curves] = estimateCenterSurround(X, options); options.EstimationType = 'linearity'; [SimpleONOFFRio, Curves] = estimateCenterSurround(X, options); % SimpleCSRio(SimpleCSRio<-0.4) = -0.4; options.EstimationType = 'tra...
c8afcc8e0b2d33250d3da9fa303b6ed7b2d5867f573925465f92517fb7ba277f
MATLAB
5,131
97
function model = BayesianSwitchingDynamicalSystems(data, max_nstates, max_ldim, opt) %Inputs: % data : {data_subj1, data_subj2,...,data_subjS}, data_subj1 is a D-by-N matrix where D is dimension and N is the number of samples % max_nstates : maximum number of states (set ...
5a77bc5f20a68685522953e9285690fd057125e7171eb878bec47739a6359c2d
MATLAB
5,132
143
function [res, fmt] = detUPMEMD(actigraphy, epoch, varargin) %DETUPMEMD do uniform phase masked empirical mode decomposition and calculate % circadian metrics % % [RES, FMT] = DETUPMEMD(ACTIGRAPHY, EPOCH, CYCLELENGTH, FILENAME, STARTTIME, FILEPATH, QUALITY, MINCYCLE) % performs uniform phase masked empi...
3a95d8cabed8f2e383bbde53da9060056345c8d3d6f3fb18157337d6e32fcf90
MATLAB
5,137
105
function [a11, a12, a13, a22, a23, a33, b1, b2 b3] = ... estimate_displacement_based_upon_least_square_solution3d(solution, variates, ... sizeImage, ... dk, ck, ... filterDirection, ... numberOfFilterDirections, ... t11, t12, t13, t22, t23, t33) % ESTIMATE_DISPLACEMENT_BASED_UPON_LEAST_SQUARE_SO...
cf07c6c2fe4518382325ba4b05ebdab1c876717452e0f0b9cfe0e5433fc302fd
MATLAB
5,137
167
celltype = [50 51 57 58 6 7 89]; BCTypelabels = {'BC5o', 'BC5i', 'BC5t', 'XBC', 'BC6', 'BC7', 'BC89'}; %% ON cts = 1; celltype = [50 51 57 58 6 7 89]; peakv = []; T = (-BasDurFrm:StmDurFrm)/Fz; Twin = T>0.1 & T<1.5; ii = 0; jj = []; for t = 1:7 ctyp = celltype(t); rois = find(Typ == ctyp); Vars...
9a224d2176bb543a6582f19d5ee25bfd88c8e1ef05de94414158c04f7d5ba703
MATLAB
5,141
167
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to evaluate the spatial correlation between % CCA-weighted brain map and math-related meta maps % % Jin % 7/21/2022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% set the...
aeac94c82d6cf652a64a7a0bd50d63835e6f611c2d15423b07e9be0ca3717326
MATLAB
5,142
141
% CCH_CONV predictor and p-values for CCH using convolution % % CALL [ PVALS, PRED, QVALS ] = CCH_CONV( CCH, W ) % % GETS CCH vector (a single CCH) or matrix (CCHs in columns) % has to be non-negative integ...
b5c09caeabc7102f1fe3da2c607e861b6b872fe8cc7bc19569f6e1e6b3b0fd45
MATLAB
5,146
107
% different from redefineStimulusClassesUpdated02. % removed prune channels step to observe auditory cortical regions. % This is for sbj 08 and 10 % For later sbjs, use plotSingleTrialHRF_UpdatedDCNew.m function plotSingleTrialHRF_UpdatedDCNew_Special(sbjNum) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatai...
fdb5b7b38d5560a6460a0bccd903c41ba12d25d08a6f707ac34145b6a1937ca7
MATLAB
5,151
130
Condition_Name = cond_labels; Channels = cluster_labels; chan=3; % right temporal parietal %% Load all data for sub = 1:length(subject_list) subject = subject_list{sub}; load([TFR_Data subject, '_tf_data_' int2str(1)]) % initialize matrices on 1st subject if sub == 1 tf_a...
d6d15653ef8192062e079c4fe8050856b3b2a9775b29708eccab5b1c6c947b9e
MATLAB
5,152
176
function [x, options, flog, pointlog] = quasinew(f, x, options, gradf, ... varargin) %QUASINEW Quasi-Newton optimization. % % Description % [X, OPTIONS, FLOG, POINTLOG] = QUASINEW(F, X, OPTIONS, GRADF) uses a % quasi-Newton algorithm to find a local minimum of the function F(X) % wh...
75588ebd5745543a0b23dd5753f24307c39aeea4aec04ac3e8130d59f252acd7
MATLAB
5,153
152
% STATUS: Inactive(?) % % SYNTAX: % performanceLDA = calcCumSum_DiffStartT_SingleChnHbX_NoSave(sbjNum,... % trialsTrHbO,trialsTstHbO,trialsTrHbR,trialsTstHbR,trialsTrHbT,trialsTstHbT,... % movieListTrain,movieListTest,numClasses,mlActAuto) % % DESCRIPTION: % Perform cross Validation where SS beta coefficients fro...
fedb8a9dd35e3c8469fdd072339bbb11188ebf30e2fb4692fad7349fc4aefb8c
MATLAB
5,155
163
function [chnList, LSChnList] = getChnList(isNew) % all 36 channels for fNIRS if isNew chnList = {'S1D1 Middle Posterior FEF Left',... 'S1D2 Posterior to sPCS/tgPSC Left',... 'S1D3 Middle FEF Left',... 'S1D4 sPCS/tgPCS Left',... 'S2D1 Posterior FEF Left',... 'S2D2 Inferior to FEF Left',... 'SS1...
0ef58e52d86487a05b1904fb5f5100c2f22dd11ef52252da7838b703ac6e44de
MATLAB
5,159
103
function [mat2d_T2_mapscan, dmat2d_coeffvals, k, dvec, dvec1, dvec2,cj] = curve_fitting21(dmat2d_coeffvals, k, dmat4d_ROI_T2, dcount, cj, dmat3d_cropped_label, mat2d_T2_mapscan, dvec, dvec1, dvec2); %Input: T2 scan multiplied with ROI mask for a given ROI for 15 TE's %Output: Monoexponential curve fitted T2 co-effe...
42691ea74478908c44082c652ec4edfeb42c78d2d643f50de5e8cd743969e44c
MATLAB
5,160
139
% Add repts and CI. Used for publication % % Each array is channels x time x trial % This use cross-validation where GLM is computed for each training fold % and SS beta coefficients from training folds are used for test fold. % % Used for subset of channels % DiffTLen!!! % STATUS: Active(?) % % SYNTAX: % [performanc...
d3d3880406bfdb02c733bb98cebcea256ca0ef3f6d3e72e47113f90a288628c5
MATLAB
5,160
141
function Y = runmean(X, m, dim, modestr) % RUNMEAN - Very fast running mean (aka moving average) filter % For vectors, Y = RUNMEAN(X,M) computes a running mean (also known as % moving average) on the elements of the vector X. It uses a window of % 2*M+1 datapoints. M an positive integer defining (...
e723d1acc819e9d0d6cc76e55c0c7eb1524a99de8d9903c0fc1019769f68ef81
MATLAB
5,163
134
function [transformationMatrix] = ... phase_difference_linear_registration3d(moving, movingCertainty, ... fixed, fixedCertainty, varargin) % PHASE_DIFFERENCE_LINEAR_REGISTRATION3D Estimates a transformation matrix using phase-difference % % [transformationMatrix] = ... % phase_difference_linear_registration...
508c7b885c888a277379eab75c3ab43ea4b65ea718077cffec1a97d30cfcb3b9
MATLAB
5,166
160
function [OUT] = getBehavior_vp_eegCAT(IN,locking,trialnums,set_fb,pos,set_stim,pos_stim,rt_stim) %aggregate variables valueP1 = [IN.value1_p1 IN.value2_p1]; valueP2 = [IN.value1_p2 IN.value2_p2]; difficultyP1 = [IN.diff1_p1 IN.diff2_p1]; difficultyP2 = [IN.diff1_p2 IN.diff2_p2]; valueP1_old = [IN.value1_p1_old ...
b693b7cfc7a263afa3a2bc2d78cd32fc597fff6ea1104053b31b9864f7a501a1
MATLAB
5,173
153
%To use after THexporttraces_xlsx.m in order to record maximum amplitudes %of the dff files. Also important for making and updating sheetlist %variable for legend/options box prompt='How many traces?'; blank=input(prompt); %decide how many traces you want to analyze (1-4) sheetlist=string(sheets); %makes sheetlist int...
94e1a6a66d38458604d1f7a4000f47648127c9ae46d9ca24c29a3e7fb28d3ea6
MATLAB
5,175
133
%chdata=load('C:\Users\DBHeyer\Documents\PhD\China\Djai\Recordings\mats\stim\180621_012.mat'); chdata=load('C:\Users\DBHeyer\Documents\PhD\China\Djai\Recordings\mats\stim\180705_002.mat'); %settings ch='Ch1'; secch='Ch2'; stimch='Ch3'; StringCh='Ch31'; CCStepkey='B'; stopkey='Z'; %sweeplength=10001.3425; %length of ea...
471ef67fce341ef0bc6cd36f2e665b94ebe75e5d0909b28885359884cf892dd5
MATLAB
5,179
117
function [figOut] = NWB_samplePAC_SU(nwbAll, all_units, paths) % - nwbAll: a cell array of all nwb files imported in NWB_SBCAT_import_main % operation: % - paths: Paths defined in NWB_SBCAT_import_main. The path of interest is % the code path, which is used to load the dataset of the trials selected % for the computat...
6bb157749c5e6ae47bf2a146d5357a7c6d4983fd1fac77a16ab41bc5cdc67ee3
MATLAB
5,188
145
% For sbj 12 and afterward function [mlActAuto_Unused, allCues] = getPrunedChns(s,snrThresh) sbjNum = s.name; rawDataFN = s.fName; movieList = s.movieList; %behData = s.resp; startT = s.startT; endT = s.endT; fs = 50; saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experime...
d262bf4754d127ca1e3d341d91337a6c92e362630f61100721a6f7f4c4374f1a
MATLAB
5,200
125
function [select] = select_channel_list(label, select, titlestr); % SELECT_CHANNEL_LIST presents a dialog for selecting multiple elements % from a cell array with strings, such as the labels of EEG channels. % The dialog presents two columns with an add and remove mechanism. % % select = select_channel_list(label, in...
710c85d5b6d571e1b8a87328d5f06037e58d1013380c7770f4f95a2025367210
MATLAB
5,204
153
function net = gtminit(net, options, data, samp_type, varargin) %GTMINIT Initialise the weights and latent sample in a GTM. % % Description % NET = GTMINIT(NET, OPTIONS, DATA, SAMPTYPE) takes a GTM NET and % generates a sample of latent data points and sets the centres (and % widths if appropriate) of NET.RBFNET. % % I...
77a268deddf3188f4b2b2edf0cb489c2e7be87f564248daeb701d2e0a2b892c6
MATLAB
5,206
143
IsMakeVideo = 0; if IsMakeVideo FolderPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\NaturalSceneVideo\Preprocessed\Blue\'; nClip = 11; MovieSize = nan(nClip, 3); SharedVar = nan(nClip, 1); clear RFctr_L RFctr_NL for i = 1:nClip FileName = sprintf('%s013...
6018acaafec8bf6e5aa568e0b92d88baffafe48de6d495153febdba44aeecdd5
MATLAB
5,208
162
% Add repts and CI. Used for publication % % Each array is channels x time x trial % This use cross-validation where GLM is computed for each training fold % and SS beta coefficients from training folds are used for test fold. % % Used for subset of channels % DiffTLen!!! % baselinePerf is classification accuracy for c...
47816ac5c24011781d49b3bf1ec561fdb3b61a2f009d54c5486f0bbc4cd5a8fd
MATLAB
5,209
127
function Y = VSH_cubic_integral(L,M,A) % L is the L value of the matrix % M is the M value of the matrix % A is the side of the cubic ROI - in metres atol = 1e-15; rtol = 1e-10; if isempty(L) L = [8 8]; end if isempty(M) M = [5 5]; end if isempty(A) A = [0.1 0.9]; %A = 0.1; end % if isempty(l...
b2b4eff97f709ea7b935160206f826e248f77c160733ba15adedc0687f9d20f8
MATLAB
5,211
129
%% Artifact rejection % Check if variable Exclusion_Info exists already. If yes, load it. if exist([output_dir output_specific 'Exclusion_Info.mat']) == 2 load([output_dir output_specific 'Exclusion_Info'],'Exclusion_Info'); end % Correct for DC offset, using the average of the whole epoch EEG = eeg_check...
96691a2d4e6fe2c618f00c4de785986c1640f2da2dfd53f4c449ba3e5df33e20
MATLAB
5,214
164
function files = FindFiles(varargin) % Syntax: % % [files, dirnameGroup] = FindFiles() % [files, dirnameGroup] = FindFiles(dirnameGroup) % [files, dirnameGroup] = FindFiles(dirnameGroup, fmt) % % Descrition: % % Find all files of format fmt, in the current folder. % % Examples: % % files = FindFiles...
0ec3da25b01c156ced1742966403ee1c759a47f29913ae162c427fe356aa495c
MATLAB
5,224
138
function [subj] = ebc_tutorial_adv_preprocess(subj, default_params, varargin) % Runs the pre-processing phase of the advanced EBC tutorial. % % [SUBJ] = EBC_TUTORIAL_ADV_PREPROCESS(SUBJ, DEFAULT_PARAMS, ...) % % Performs z-scoring, moving of the original pattern to HD, then % creates cross validation selectors, all re...
cd88711f14244a1df15b2abcc45bea67d4bb7d1c97bc8b8b2b416c6b1921599f
MATLAB
5,226
89
%Plots SPEP modulation on 3D model of subject's brain. %2024/02/26 function plot_group_spep_3d(fnames,subjectIDs,ref_method) %get mni template data: mni=fetch_mni_anat(fnames.root_dir); %fetch anat data: subject=fetch_subject_data(fnames.root_dir,{fnames.subjectID},'anat'); subject_nber=1...
5004c811c44ff05edfe013346c859247fc218dadbcb504706caf304891109d4d
MATLAB
5,231
197
clear all supPath = 'C:\noga\TD complex spike analysis\Data\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:5000; req_params.num_trials = 50; req_params.remove_question_m...