sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3419c0d02dc86978affef238956b4193ce5517f5beb8f213553bd99800f3c8eb
MATLAB
3,916
123
function [R,EX,EY,EZ,R2,EX2,EY2,EZ2] = ft_getpos(grad, fid, channels) % Compute the inputs to TSSS code from Fieldtrip representation of MEG % sensors and headshape. %_______________________________________________________________________ % Copyright (C) 2017 Vladimir Litvak based on MNE code by Matti Hamalainen % and...
fed6e92c5ea35d9e20cf69fa3469f26fe24e82d5b88c168522de920a11efa670
MATLAB
3,928
202
classdef BaseTransformer % % WIP in case we need to object oriented % % (C) Copyright 2022 BIDS-MATLAB developers properties input % cell output % cell data % structure verbose = false % logical overwrite = true % logical end methods function obj = BaseTransformer(varargin) ...
c78be1788c35e0345b91fa5432bf1a6e940f4762c9ed7aef7528f33ba77fca3b
MATLAB
3,936
168
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,optTol,progTol,method,... corrections,c1,c2,LS_init,cgSolve,qnUpdate,cgUpdate,initialHessType,... HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,... Damped,HvFunc,bbType,cycle,... HessianIter,outputFcn,useMex,useNegCurv,precFunc,... ...
99d4d682d9141f85d83da324e360398e8bc7fe195f2cd1f41faf3c02ee16939a
MATLAB
3,937
114
function h = plot_gaussian_ellipsoid(m, C, sdwidth, npts, axh) % PLOT_GAUSSIAN_ELLIPSOIDS plots 2-d and 3-d Gaussian distributions % % H = PLOT_GAUSSIAN_ELLIPSOIDS(M, C) plots the distribution specified by % mean M and covariance C. The distribution is plotted as an ellipse (in % 2-d) or an ellipsoid (in 3-d)....
baae7fbf4ef7701c33dc6f3322f218838d980e739b2739fca3229a691aa25ba0
MATLAB
3,938
56
%Estimates the significance and amplitude of flicker modulation for each channel and condition, and saves those estimates into tables. %2024/02/25 function evaluate_ent_degree_relpower(fnames) %create output folder if it does not exist if ~exist([fnames.analysis_folder,'/LFP/static_ent'],'dir') mkdir([...
c4e8c72cb874671e894f8ec2f7f73fe1be090a8096efc7c81f7934313942c6c7
MATLAB
3,939
104
function status = unitTest_BandpassFilt_LPF(datafmt, dirname, newval) global procStreamStyle global testidx global logger if isempty(procStreamStyle) procStreamStyle = datafmt; end if includes(procStreamStyle,'snirf') datafmt = 'snirf'; end if isempty(testidx) testidx = 0; end testidx = testidx+1; status ...
7cb3f78a42af4b0e99746ba0df93472986dfc76d19bcb35032e3e8f4fb5a4b6e
MATLAB
3,943
99
function cfg = create_cfg(BIDS_root, n_subs, n_runs) %MODULE_CFG Creates cfg.mat for this project % Detailed explanation goes here clear cfg cfg.global.tr_duration = 0.627; cfg.global.n_slices = 24; cfg.global.BIDS_root = BIDS_root; cfg.global.deriv_dir = fullfile(BIDS_root,'derivat...
cd6044dcf176c4160e4c6023b5765858d25bd208c23629a7dc5317aa08c180d0
MATLAB
3,947
83
%% Demo how to create a permutation design % % This demo shows how to calculate a permutation analysis. % % For this, we need the cfg of the normal design. % This can % - either be created new (not shown below, see e.g. the decoding_tutorial) % - or loaded from the cfg.mat of an already calculated analysis (thats % ...
1cbf735275126d838dd1dc9a43e54e492def1b12746b71008cbd13fdf3140787
MATLAB
3,950
112
%ACTOGRAM % % Descriptions tba % % $Author: Peng Li, Ph.D. % $Date: Jan 01, 2022 % $Modif.: Feb 27, 2026 % Enable invisible instance to allow report generator % % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % (C) Peng Li 20...
1f3e000bf774984233490417012feabfec42d919e8171ef7b02903f797ba16e4
MATLAB
3,953
143
function Q = MakeQfromS(S,bin,varargin) % Spike train binning % % USAGE: % Q = MakeQfromS(S, bin,options) % % INPUTS: % S - a cell array of ts objects % bin - a bin size (in the same time_units as S). % Bins are generated automatically and begin with first spike occurence % - an intervalSet obj...
10aee331f091eaa9962b5e392d5a642d5ee51402d2a63aef5aed0b8fc5e15d62
MATLAB
3,955
101
% reference https://www.mathworks.com/help/matlab/ref/animatedline.html#:~:text=Create%20an%20animation%20by%20adding,loop%20using%20the%20addpoints%20function.&text=an%20%3D%20animatedline(%20x%20%2C%20y%20)%20creates%20an%20animated%20line,x%20%2C%20y%20%2C%20and%20z%20. close all; % run options use_hopper_data = 0...
95a879bb6437ed223e8511506625fc891fff59c955a25d73ea1cf6c35fffe891
MATLAB
3,959
95
% This script is a template who want to get an interpretable weight map of their wholebrain % classifier (i.e. backtransformed pattern aka the "Haufe-method" (see % Haufe et al., 2014) and is particularly well suited for people who have % betas available from an SPM.mat. % If you don't have an SPM.mat available, t...
21dc7feb27cf9cc4cd45791fea119a07062d10dc82b2dd4e386dd4f297f1bd43
MATLAB
3,961
122
%This analysis code was used in: %Mares I, Ewing L, Papasavva E, Ducrocq E, Smith FW, Smith MLS (in press). %Face recognition ability is manifest in early dynamic decoding of face-orientation %selectivity – evidence from multi-variate pattern analysis of the neural %response. Cortex. %This code was originally cr...
1062cf0db27ccf41b3896ad34542e1104184736ec508e38d93fe8534a73e0cc7
MATLAB
3,963
136
function voi = bv_readvoi(fname) % voi = bv_readvoi(fname) % % :description % % Reads in a BrainVoyager VOI file. % % :inputs % % fname file to read, e.g. 'myvoi.voi' % % :outputs % % voi voi structure. List this function to see the field % names. % % :history % % 2004.04.16 ...
c4e2c8b9be3b1eeffc6f57dd93246f4bc04c9a9a2abffcc802f87fefd98ac8e4
MATLAB
3,963
97
%% Make Flow Figure Data function FlowFigureData(fileParams) %% Start FlowFigureData Script fprintf('\n\n- - - Starting FlowFigureData - - -\n\n'); %% File Parameters exportFolder = fileParams.exportFolder; thetaInDegrees = fileParams.thetaInDegrees; thetaInRadians = fileParams.thetaInRadians; fileExportFolder = [expo...
8689dabd08ea74ad1d47e7f24aa484eadad02ae1ce641b5a908d743c49935e3d
MATLAB
3,964
116
clear; close all; clc; %% FileIdentifier = 'BC'; PathName = uigetdir('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BC diversity morphology data\', 'Select the IPL profile folder'); FileNames = dir(fullfile(PathName, '*.csv')); FileIds = find(contains({FileNames.name},FileIdentifier)); % TypeDistinct...
049f8f4ec4f0ccf2ee227e1014fb14f59a4f9179c35ba653994bebc4bae1c949
MATLAB
3,965
103
function cf = train_liblinear(param,X,clabel) % Trains a linear support vector machine or logistic regression using % LIBLINEAR. For installation details and further information see % https://github.com/cjlin1/liblinear and % https://www.csie.ntu.edu.tw/~cjlin/liblinear/ % % Usage: % cf = train_liblinear(param,X,clabe...
0e8fd1966f5901207578fec057e8e8d02abeabf67b79702092603e42364b5eb1
MATLAB
3,966
102
clear all load('../data/opt.mat') role_order = {'p','o'}; for pair = 1:length(opt.participant_pair) clear player_continuous observer_continuous fprintf('EEG preprocessing for pair session %d: %s - %s \n',... pair,opt.participant_pair{pair,1},opt.participant_pair{pair,2}) pair_sessi...
cab0981dc55e2f588266b4aadee92fd0eac72bee893007c0dab7b48c5c68ae6f
MATLAB
3,967
94
% This script performs second level of preprocessing after ICA. This level % of preprocessing includes for instance removing artifacted ICA % components % Check if variable Exclusion_Info exists already. If yes, load it. if exist([output_dir 'Exclusion_Info.mat']) == 2 load([output_dir 'Exclusion_Info'],'Exc...
a3a1e06013084c3c3aacaf9ce3ce5c7d7124d31050e6d12fa5a9f493b03ae307
MATLAB
3,970
150
function [scratch] = train_bp_netlab(trainpats,traintargs,in_args,cv_args) % Creates a Netlab backpropagation network and trains it % % [SCRATCHPAD] = TRAIN_BP_NETLAB(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS) % % You need to call TEST_BP_NETLAB afterwards to assess how well this % generalizes to the test data. See the dis...
9b6dc9c9ff5d60c87f81c74de031c44bf5aae55ed04ba899f0edaf47e1e5373e
MATLAB
3,973
139
clear; clc [task_info, supPath ,~,task_DB_path] = ... loadDBAndSpecifyDataPaths('Vermis'); PROBABILITIES = [25 75]; OUTCOMES = [0 1]; DIRECTIONS = 0:45:315; COMP_WINDOW = 0:700; req_params.task = 'saccade_8_dir_75and25|pursuit_8_dir_75and25'; req_params.remove_question_marks = 1; req_params.grade = 7; req_params....
a07f71d6b6ca75411c88db223fb0f8f3687224f5358102493981d2c913089a2d
MATLAB
3,973
71
function [pre_stim_vals,post_stim_vals]=pre_post_time_comp_nopad_210511(table1,table2) % Tables 1 and 2 should be pre stim and post stim in that order %if conduction time isnt present in both, drop time and spikes etc for i=1:length(table1) [rwtb,~]=size(table1{i}); for j=1:rwtb time_similar_1...
5741737a441b5e423a907e9cdbba5852c61df3600d6f2ac897a961a7d83f0e29
MATLAB
3,975
95
%This script analyses data from the flickerneuro or flickerfreq task from begining to end. %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_subjectID...
f15c03c1774d13e7529d91c358385fd01b815ee8f25ec25d73f8c1dd74e2bf5a
MATLAB
3,976
121
function Flmr_sum = flm_dipole_script(S) %rq_depths = [0.04;0.07]; rq_depths = [0.04]; %radii = [0.10;0.12;0.15]; radii = 0.08; roi_rad = 0.02:0.02:0.08; Lin = 11; load dipoles.mat Q RQ; % Q is primary current and RQ is the position of each dipole for i = 1:length(rq_depths) for j = 1:size(RQ,2) ...
e946158ce2e3ee2466399a3ba4038a1ed79f40e67f876f13cc538b16ab3886ab
MATLAB
3,978
113
function mix = gmm(dim, ncentres, covar_type, ppca_dim) %GMM Creates a Gaussian mixture model with specified architecture. % % Description % MIX = GMM(DIM, NCENTRES, COVARTYPE) takes the dimension of the space % DIM, the number of centres in the mixture model and the type of the % mixture model, and returns a data str...
830f0aa136540ccaa4bec6d1a8d6b21f90ada2318b6b7e286328d061e80d1671
MATLAB
3,985
134
%% Wave Clus Output Plotting % load both the raw data and times files manually %this is for wells clc close all %% loading current_program=dbstack(); current_program=current_program.name; % load spike dyn from folder above current in dir spike_dyn_path=fullfile('..\','well_spike_dynamics_table*.mat'); dir_spike_dyn=di...
5301a08b251f1b032787429ad2663eebf002cb7482f62e9484e8c8556ee1fa23
MATLAB
3,986
102
function cifti_conn_pairwise_corr_exaversion(wb_command, pconn_dconn_template,pconn_or_dconn, subject_conn_conc, keep_conn_matrices) %pconn_dconn_template = template correlation matrix to compare data to %pconn_or_dconn = specify if your data are parcellated or dense %subject_conn_conc = conc file that has full path...
3a4abac52d17c92cae423bae48a818991f79ec5c4989eaa34ca755f656434609
MATLAB
3,990
110
% This script compares image quality between two models modelNameA = 's3://delazerdamatlab/Users/OCTHistologyLibrary/_MLModels/2020-11-10 Jessica with_history_buff/'; % Part of the model name modelNameB = 'paper 4 used in paper v2'; % Part of the model name to compare to - version in the paper isCorrectAspectRatio...
ed48c9d3dfe4409e7aa3a58b4a5754b166ec5bae46cbef72652ddf03813ddbf5
MATLAB
3,991
106
function cfg_adj = inherit_settings(cfg_adj,cfg_orig,varargin) % This function inherits specific settings from cfg to a subfield of cfg % (e.g. cfg.parameter_selection).It adds those fields that should be added, % but doesn't overwrite manually specified settings. % The logic behind this function: The user does n...
13abcc75a591bb82fb0e823b5ad9cc661d254749a502f736a5f6449ee01d1db4
MATLAB
3,995
112
%initialize [taskStruct, dispStruct] = initTask(); taskStruct.expStartTime = GetSecs(); taskStruct.totalEarnings = 0; taskStruct.trialTotal = 0; % note experiment start time fireEvent(taskStruct.LPT, taskStruct.eEXP_START); try % run the instructiona %runCardDrawInstructions(taskStruct, dispStruct); % ...
596247524484bbde87ab829f5189a76622bd1a2d01691d6d458fc0d3d4b0bb7a
MATLAB
3,995
120
function univ_pe_2nd() cfg = load('neurovar_cfg.mat').cfg; n_sub = 44; a_title = 'analysis_title'; res_dir_spe = fullfile(cfg.global.deriv_dir, strcat(a_title, '_2nd'), '_results_spe'); mkdir(res_dir_spe); res_dir_rpe = fullfile(cfg.global.deriv_dir, strcat(a_title, '_2nd'), '_results_rpe'); mkdir(res_dir_rpe); ...
64d205bf783ed11e1319791beeb089b9e5e5538c1e1283b27bc2fc4d80f351ba
MATLAB
3,997
130
%% scatter plot of cluster times close all clear up=load('times_A7_hi.mat'); down=load('times_A6_hi.mat'); sr=25000; timevec=[1/sr:1/sr:300]; up_1=up.cluster_class(up.cluster_class==1,2)./1e3; up_2=up.cluster_class(up.cluster_class==2,2)./1e3; down_1=down.cluster_class(down.cluster_class==1,2)./1e3; down_2=down.clu...
72fa4203d59883b9074af017079ef74eb83244a7d91e043d318108ebf1ba7f4d
MATLAB
3,998
78
% ----------------------------------------------------------------------- % % M U L T I P L E T E S T I N G % % ----------------------------------------------------------------------- % % Function 'fwer_sidak' computes the idák correction of Family-Wise Error% % Rate for m...
f47dcfde66af17554eed70562abf7fed57ca63a1917bfe1dcfadc71fa94d4599
MATLAB
4,002
117
function [subj results] = tutorial_easy_spm(varargin) % Tutorial script to accompany TUTORIAL_EASY.HTM % % [SUBJ RESULTS] = TUTORIAL_EASY_SPM(varargin) % % This is the sample script for the Haxby et al. (Science, 2001) 8- % categories study. See the accompanying TUTORIAL_EASY.HTM, the % MVPA manual (MANUAL.HTM) and th...
4d985420a52a8791bc3f1e1f49ac4f5ae46833642df6465dbc40290e40e507bd
MATLAB
4,003
101
function plotRespOverview(PSTHs,SortedStim,binEdges,tempRes_ms,W,WLabel,exampleNeurons,exampleNeuronsLabel) if nargin < 6; WLabel = '|W|';end if nargin < 7; exampleNeurons = [];end if nargin < 8; exampleNeuronsLabel = cellfun(@num2str, num2cell(1:length(exampleNeurons)), 'UniformOutput', false);end %% Response Overvi...
37b3d2a1dbbb52c906a86f5db1a0f20266dbcefd94500077c5ca95217e73d24b
MATLAB
4,009
110
%% ANTI-PHASE SYNCHRONY (HFOs, 745 Hz) clear rng(17) % 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 = 3000; % time span dt = 0.01; % COUPLING epsilon = 0.08; n = 2; N = sum(n); K = getK(n,epsilon); K...
a51a79bddb393f4497a88c52a39c5b65fe8f5e01136b466738f8dce3c576cf4a
MATLAB
4,010
144
function [minPos,fmin] = polyinterp(points,doPlot,xminBound,xmaxBound) % function [minPos] = polyinterp(points,doPlot,xminBound,xmaxBound) % % Minimum of interpolating polynomial based on function and derivative % values % % It can also be used for extrapolation if {xmin,xmax} are outside % the domain of the po...
6c6651216e55239c4ff0e7f8a6b8b14e39f11790526a601cbc7b4335c44914ea
MATLAB
4,012
113
% This script is a demo showing some simple three-class decoding on % simulated toy data. fpath = fileparts(fileparts(mfilename('fullpath'))); addpath(fpath) clear variables dbstop if error % if something goes wrong %% Set the output directory where data will be saved cfg = decoding_defaults; % cfg.resul...
9ad58e5b32ef185f1f80506c8812a3b47a372aa77fbfa8a1c1f6401731caaaa8
MATLAB
4,012
157
function output = model_postCAT(x,data) % Likelihood function for Q-learning on experiment postCAT v.2 with % parameters (1)learning rate, (2)inverse temperature, (3) % perseveration and (4)credit assignment % % USAGE: lik = model_postCAT(x,data) % % INPUTS: % x - parameters: % ...
a5198a364cd8b58a70434e3382ae960b54dd6465d54be7a4cf435b6dc3773e3c
MATLAB
4,017
132
clear [task_info,supPath,MaestroPath] = ... loadDBAndSpecifyDataPaths('Vermis'); load('sessionMap.mat') CAL_CLASSIFIER = true; CAL_OMEGA = false; K_FOLD = 10; bin_sz = 50; req_params.grade = 7; req_params.cell_type = {'PC ss','PC cs', 'CRB','SNR', 'BG msn'}; req_params.task = 'pursuit_8_dir_75and25|saccade_8_dir...
59956be6986f6e851c8f3270f896c195f71042e63939ee22756292b59c6f86db
MATLAB
4,019
142
function [noisypat noisyinfo] = noisify_regressors(regs,nTiles,noisiness,noise_type,signal_coeffs_order,do_plot) % Tile and add noise to regs matrix to create a synthetic pattern % % [NOISYPAT NOISYINFO] = NOISIFY_REGRESSORS( ... % REGS,NTILES,NOISINESS,NOISE_TYPE,SIGNAL_COEFFS_ORDER,DO_PLOT) % % This takes in a re...
12bf87d879b47eef6a715c633645c75e0686aa07162cf4ae32f5b14bcd426015
MATLAB
4,024
163
%% FF Fs = 1000; % Sampling frequency 1000 T = 1/Fs; % Sampling period L = 300000; % Length of signal 300000 t = (0:L-1)*T; % Time vector f = Fs*(0:(L/2))/L; region=["EC-DG","DG-CA3","CA3-CA1","CA1-EC"]; regLabel1ff=[];regLabel1fb=[]; set(0,'defaultAxesFontSize',16) set(0,'defau...
211813ce94bdf277422660c0d84b86b58db67c2dc90a2ee10ef9cc7cf1690b83
MATLAB
4,024
106
function [h, hdata] = glmhess(net, x, t, hdata) %GLMHESS Evaluate the Hessian matrix for a generalised linear model. % % Description % H = GLMHESS(NET, X, T) takes a GLM network data structure NET, a % matrix X of input values, and a matrix T of target values and returns % the full Hessian matrix H corresponding to t...
2292404d94f0061a20571898f72e7774128b81fdfa4584bcbf1ee731d5297c8e
MATLAB
4,024
124
function [para, verbose, success] = optiCalib(accIn, varargin) %OPTICALIB optimize calibration parameters for auto-calibrate 3-D %accelerometer signals % % INPUTS % ACCIN: 3-D accelerometer data, unit g, N by 3 matrix % % optional % MAXITER maximum number of interations, defau...
432c17e227c0d7a50f1ec55111b5d85302a76c0172834c08514f5beef1b56ed3
MATLAB
4,030
167
% % Computation of SVD in a way that is quicker and uses less memory % than the svd that comes with matlab, by using PCA of XX' where % X has fewer rows than columns % % In: % - data matrix X - #examples x #features % - optional (defaults to all components or all the variance): % - 'keepNumberComponents',<# of compon...
c94d7af33385aef9b4a7a65110f7c6d735eed1592f1182ad5198cb801901d4f0
MATLAB
4,030
82
#import <UnityAds/UnityMonetization.h> #import "UnityAdsUtilities.h" #import <UnityAds/UnityServices.h> #import "UnityAdsPurchasingWrapper.h" /** * Callback invoked into C# when a decision state has changed. */ typedef void (*UnityMonetizationPlacementContentStateChangedCallback)(const char *placementId, const void ...
46e374dee6e7d68985acfebb96ca3656ee05742344ed072b1c5de5772a32b000
MATLAB
4,031
115
% plot performance as bar chart for each channel saveDir = 'C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment03'; saveDir2 = 'C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment03'; load([saveDir filesep 'intermediateOutputs.mat']); lo...
f8e5a7c09e6efbfc0978e92302757c11626b4a737799c4816e498e481f7c9235
MATLAB
4,034
133
function [u,v,h, fitScore] = fdlnEstimateUVHSinglePlane (fdln,a,b) %Uses Fiducial Line structure of identified markers to identify u,v,h assuming a single plane approiximation %INPUTS: % fdln - array of identified Fiducial Line structures (see % fdlnIsLineIdentified for explanaition, of what is 'identified'...
07e0dd86760eae9aa53acf4d62d2aeffcae3ec164975709a72d00e0fa269be2f
MATLAB
4,041
119
function [h, p, ci, stats, n, stderr1, stderr2]=total_ttest_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'}, table1....
f0a771873a8c4dbf28193fa6fea983cee581a69eb3a8a104856b223813565e3f
MATLAB
4,042
123
clear; close all; clc; %% Load Excel Experimental Document % FilNam = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\Recording_Document\BCTypeDendriteAxonData.xlsx'; FilNam = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BipolarCellTerminal\BCTypeDendriteAxonData.xlsx'; [DocNum, DocStr] = xlsrea...
970a1e2d0cbcf790cbff88b387170fab08a2567b12b87e8d0d8eb2ee6aa36c65
MATLAB
4,047
124
function cuboidal_integral_test % This function creates a cuboid in spherical co-ordinates and then % plots in cartesian co-ordinates. The cube is divided into 4 pyramids. % Each rectangle has a top, middle and bottom component as per the figure. % The script also uses a quadrature based method to verify the volume (...
983f6525f38fe6c74c0ff833ba8b276374a34b0aba595f545abbb0a61ea88811
MATLAB
4,047
109
%% TRANSIENT COLLECTIVE ANTI-PHASE BEHAVIOR % SETTING clear rng(13) % 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, ep...
d98954953848b8f37d294bb07c0ffe02da24c6314eb57fa5f82c8db28bb378b6
MATLAB
4,049
93
%{ Copyright (C) 2023 N. Suhas Jagannathan This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed i...
a57d5d887dc1d948da1719a6fa8a7d85cabb8ce507af5330cde0a17588568863
MATLAB
4,052
104
function [deformed, displacement] = poly_affine_transformation(... im, transformationMatrices,weightFunctions,varargin) % POLY_AFFINE_TRANSFORMATION Fuses multiple affine transformations using a log-euclidean framework % % [deformed displacement] = poly_affine_transformation(... % im,transformationMatrices,weight...
23259fe278bcb5355df3c92e34bf7b0f0a7d270f286cdf29788ce95352b5790c
MATLAB
4,055
121
function decoding_write_similarity(resname,contrasts,overwrite) % This function can be used to write similarity searchlight results that % have been stored in a .mat file of results generated by The Decoding % Toolbox. All results are written separately to images starting from % beta_0001. In addition, contrasts betwe...
60791c8df6b3843d6e03c0fc6085b36822ca80a955e339efdcc9ec456328303e
MATLAB
4,055
128
function [returnVar,msg] = Process_RemoveMedianHighFq(fbasename,nbChan,varargin) % USAGE: % Process_RemoveMedianHighFq(fname,nbChan,refchan,options) % This function creates a new dat file including only data from one electrode group (as defined in Neuroscope). % It can also substract the median of high pas...
092a40fa42a260fedb5bb398ee97c8f686d1a6fe8bb23a0c1a42949577463bbe
MATLAB
4,057
135
%% -------------------------------------------------------------------- % Initial setup %---------------------------------------------------------------------- addpath('/.../VisualImagery_paper/experiment_ptb') % This experiment is implemented via Psychtoolbox-3. Instructions on how to % donwloa...
69b2908550131feadeecf19e55af1044b810c7f2772c90a2dd78a8bf412e3bde
MATLAB
4,062
113
function [ratioPercieved,ratioAdjusted] = Calc_Shape_Distortion(slant,flag) % %Determine the shape of a rectangle in the retinal image when the rectangle is slanted a given %amount. This will allow us to predict the expected shape distortion for a %given change in binocular disparity. %This function calculates t...
e8c176e1bc3ac4956ff46af66f52de7838fe7c689ea935b30278169a62246aad
MATLAB
4,062
96
function [update] = estimate_update_field(... currentScale) % ESTIMATE_UPDATE_FIELD Estimates the update field for current scale and iteration % % [update] = estimate_update_field(currentScale) % % Data used is contained in the data struct registration. % See also REGISTRATION_EXECUTE % % INPUT ARGUMENTS % currentS...
edfc731925e1bb4c3e0df49101a01902b0d846ce09127cb378f54715f8961fee
MATLAB
4,065
116
function setup_image_registration_repository() % SETUP_IMAGE_REGISTRATION_REPOSITORY Call this function to setup and compile necessary files % % setup_image_registration_repository % % INPUT ARGUEMNTS % N/A % % OPTIONAL INPUT ARGUEMNTS % N/A % % OUTPUT ARGUEMNTS % N/A % Copyright (c) 2014 Daniel Forsberg % danne.fors...
83d0c5e4a02466145dbc69d0ddd08f771a7334bdeb9417fd7738554ff22dc6e0
MATLAB
4,067
116
% Regression unit test % % Model: kernel ridge rng(42) tol = 10e-10; mf = mfilename; %% providing kernel matrix directly VS calculating it from scratch should give same result % Create spiral data N = 500; nrevolutions = 2; % how often each class spins around the zero point nclasses = 1; scale = 0.001; prop = [...
53f65127ee6850cfdcc74e9aa6a056b5f72c3094687b72df0db771efdf0ecd9f
MATLAB
4,073
116
% This script will set up ML by opening an instance, copying etc. on aws % To launch ml instance in aws, we will be following instructions by: % https://aws.amazon.com/blogs/machine-learning/get-started-with-deep-learning-using-the-aws-deep-learning-ami/ %% Inputs % We can start ML instance from a dataset (clea...
3f48e2d86c0841eca38900080bb477bd572fa51973362b92a05ea302ad322da4
MATLAB
4,076
141
clear [task_info, supPath ,~,task_DB_path] = ... loadDBAndSpecifyDataPaths('Vermis'); req_params.grade = 7; req_params.cell_type = 'PC ss|CRB'; req_params.task = 'speed_2_dir_0,50,100'; req_params.ID = 4000:6000; req_params.num_trials = 50; req_params.remove_question_marks = 1; raster_params.align_to = 'rewar...
a09603dbef5a1b01934dd96a9369136a826d9f60f33bd4dcf40617ec4f18dc2c
MATLAB
4,077
146
function tmass_stats = cluster_t_mass(perm_data, tail) % function tmass_stats = cluster_t_mass(perm_data, tail) % % Performs permutation-based cluster t-mass analysis. % This approach determines clusters of subsequent time points with % above-chance reconstruction accuracy based on t-tests. It then creates a % null-d...
33ae346ee701cb3b237f5f7a6625b8883dcef8c826db9902aeafc5ebac0931bd
MATLAB
4,082
110
Condition_Name = cond_labels; Channels = cluster_labels; %% 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_all_PT_Can = zeros([size(tf_data_1) l...
ffe0f68358921cc67c6111543399af337336874a349ff76b150ac011a02f1c14
MATLAB
4,083
125
function [outImage, displacement] = affine_transformation(inImage, transformMatrix, varargin) % AFFINE_TRANSFORMATION Applies an affine transform to the provided image % % [outImage, displacement] = affine_transformation(inImage, transformMatrix) % % Rotationcenter is in the center of the data % % INPUT ARGUMENTS % inI...
dfbcfa125015d4f79bc7f900f0dd9d4bbccccc230868fe7c51031248571ddf30
MATLAB
4,085
135
function [net, options, errlog] = gtmem(net, t, options) %GTMEM EM algorithm for Generative Topographic Mapping. % % Description % [NET, OPTIONS, ERRLOG] = GTMEM(NET, T, OPTIONS) uses the Expectation % Maximization algorithm to estimate the parameters of a GTM defined by % a data structure NET. The matrix T represents ...
173da6e5150c5ddeb0a1ada3513ef5a3373d0df188c1ab21dd9d776c25769789
MATLAB
4,086
137
%% 7a. Find impulse for closed loop model function F = getImpulse(K, I, option_dark_only) % if ~exist('option_dark_only','var') option_dark_only = 0; end F = []; F.dt = K.dt; % Predictive target signal includes position -- can't calculate impulse % response correctly (?), so just pass on the info for now F.PT_ve...
67f2f6862ad52ff8ff6a1c6d554edf4c8545f2aecf05d980dff4b1f75639b807
MATLAB
4,087
111
% plot raw, raw bandpassed under 0.5 Hz, raw bandpassed under 3 Hz, and raw % median filtered. Explore other filtering options, linear and nonlinear filters. % plot delta optical density unfiltered, bandpassed filtered under 0.5 % Hz, under 3 Hz, median filtered, and gaussian-filter. % Butterworth, filter order 3. %...
a8c79992aa3d566fbfdbb71abb1c0cadb56e0c7bece7310ef438c0d07958bd09
MATLAB
4,088
132
function [new_vects] = wavelet_scramble_multi(orig_vects,wavelet_name,lvls,nScramble) % [NEW_VECTS] = WAVELET_SCRAMBLE_MULTI(ORIG_VECTS,WAVELET_NAME,LVLS,NSCRAMBLE) % % Example: [new_vects] = wavelet_scramble_multi(orig_vects,'db4',5,10000) % % This function takes a timeseries or set of timeseries as % input and outpu...
ca1b5d4bb6b33245b15ff3e584aab99b2ba98aaf471df0fb2265a632171dc61f
MATLAB
4,088
109
function white=WhiteIndex(windowPtrOrScreenNumber) % color=WhiteIndex(windowPtrOrScreenNumber) % Returns the intensity value to produce white at the current screen depth, % assuming a standard color lookup table for that depth. E.g. % % white=WhiteIndex(w); % Screen(w,'FillRect',white); % % windowPtrOrScreenNumber must...
2883cb46a20cd358f9b1f60a821d993d54cec34dcfb3755765c614618c08aca7
MATLAB
4,092
113
function [L,weights] = CrossValidationCrossCorrPrediction_Cells(qPre,qPost,sPost,binT,ep) % [L,params] = CrossValidationCrossCorrPrediction_Cells(qPre,qPost,sPost,ep) % % computes the loglikelihood prediction of an ensemble of target spike trains given another ensemble of (predictor) spike trains % The prediction is ...
29843ba33ba28c2b020f58c4d2ccedf509a62e9e6e2cdfdfa647ce050cab3a67
MATLAB
4,094
119
function [h, p, stats, n, stderr1, stderr2]=total_wilcox_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'}, table1.Pro...
69cf5712eb244bc3af9117c00c5be8e71ccede4337570cbb50b1022269450ee5
MATLAB
4,099
145
function [subj] = filter_runs(subj, patname, selname, filt, varargin) % Filter each run of a pattern using a given moving average filter. % % [SUBJ] = FILTER_RUNS(SUBJ, PATNAME, SELNAME, FILTER, ...) % % WARNING: This function is deprecated as of version 0.3 of the EBC % extension. A more general function is apply_to...
9b9ca002eaf8e749a4d2e5b47dd4218b6d269525c7e8118440aadfc9a57d93af
MATLAB
4,100
108
function [pport,pptio]= initializeLPT(pport,addr) % [pport]= initializeLPT(pport,addr) % % This function initializes access to LPT port and returns a struct with two functions, % get and put, which respectively read and put to selected register. % % On windows systems parallel port access uses the io32 o...
6428e07aa2bf9fd0a1a941a36d12bb187e4be77b9fd2c091eac1c84f515a492c
MATLAB
4,103
156
% This file is part of the Matlab Toolbox for Dimensionality Reduction v0.7.2b. % The toolbox can be obtained from http://homepage.tudelft.nl/19j49 % You are free to use, change, or redistribute this code in any way you % want for non-commercial purposes. However, it is appreciated if you % maintain the name of th...
d64ad59b55512f7c24980e3687046d68c9bd6d795614f0fc313065e1e884d87b
MATLAB
4,106
133
function fdln = fdlnIdentifyLinesByStackInterpolation(fdln,vLinePositions,hLinePositions,fdlnStack) %This function tries to identify fiducial line structure based on other %slides in the stack that are identified and can be used for interpolation %INPUTS: % fdln - fiducial line structure array % vLinePositions...
caa690a38ec6ddc1e9e41f8d4b51b83aac0bddd75dbf2c95178d97f1a95c0d9f
MATLAB
4,109
83
DataPathBeh = '.\Data\Behavior\'; DataPathSIM = '.\Data\PCA_SIM\'; OutPath = '.\Data\PCA_SIM\'; addpath(genpath('.\functions\')) %% load results from behavior behResults = load([DataPathBeh,'salicylateResults.mat'],'mice', 'dP_lat','uMF','uMD','uInt','RespLatTable'); RespLatTable = behResults.RespLatTable;% RespL...
7077b8a507d7bbc52698ec4b4c8b83442757180bc3643b4e6cf6073f51f8aebb
MATLAB
4,110
98
function brainspan_analysis_multiply(PLSweighted_genelist,input_expression_matrix,input_gene_rows,input_sample_columns,output_path) [C,IA,IB]=intersect(cell2table(input_gene_rows.gene_symbol),PLSweighted_genelist(:,1)); overlap_expression_matrix=input_expression_matrix(IA,2:end); overlap_PLSweighted = PLSweigh...
5c000ddce7680ee71cb9606cb49450fb568b5852fd5db4119971a8cc503315bd
MATLAB
4,112
110
%This script analyzes PLR for a single experiment and generates a sigmoidal %fit and curve. It then saves the values at each illuminance and the EC50 %from the curve fit. clear; clc; close all; %%Load Parsed files [fileName, pathName] = uigetfile('.mat', 'Load parsed file'); %Load first file to get parameters ...
4d9ca72b65fb43a9164018031ca03b9b7914d048cadfd5796d6af836cd9cc958
MATLAB
4,113
50
%----------------------------------------------------------------------- % Job saved on 19-May-2023 21:06:31 by cfg_util (rev $Rev: 8183 $) % spm SPM - SPM12 (12.6) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- matlabbatch{1}.spm.tools.beamforming.data.dir = {'...
5b51bf4b75f443f2fe75ac2054630a1b674986582e742095c57a3f45b7465f2b
MATLAB
4,121
137
function plot_split_moving(cueMI, oppMI, sessionDist, iWindow, iMonkey, yl, split_sessions, iSplit, window, trial_type, sum_metric, loc_flag) %% Plots V4 f-MI cued vs opp moving window plot (onset) cols = [0,0,1;0,0,1;1,0.5,0;1,0.5,0]; cols = [cols;cols]; cols(9:10,:) = [0,0,1;1,0.5,0]; cols_other = [1,0.5,0;1,0.5,0...
f11ff8a508dcf9cca6a5064146dbc51a8fa17dd74882e7f6bac01fbfeba801a7
MATLAB
4,121
154
% CALCULATES SPECTRAL ESTIMATES PER RAT % Loads cell_block data % Calculate power and coherence estimates % Saves time-frequency data % % Authors: Danilo Benette Marques and Rafael Naime Ruggiero %Define subject ratoName = 'R47_HG'; segName = '30s_dividido'; grupoName = 'Grupo A'; tic %Reads variable...
c6df8c6812fc72d39830772097d4f74a96d4be6f0f797382e2c607f83c0c89a6
MATLAB
4,122
149
function [Inorm, H, E] = normalizeStaining(I, HE0) % Normalize the staining appearance of images originating from H&E stained % sections. % % Input: % I - RGB input image, to be normalized; % HE0 - HE vector used to calculate concentrations of each dye; % If HE0 not defined, HE vectors...
4631502c38a6dc41cfa84683e61f739a5bce43d7ef8bf146a1a3f48fdb9d2fc5
MATLAB
4,123
118
function [ history ] = bundle(varargin) % Bundles a bunch of workspace variables/expressions into a structure. % % Usage: % % To bundle a workspace variable, call bundle with that % variable as an argument. For example: % % b = bundle(foo, bar) % % will create a structure b with fields 'foo' an...
927c70f4aa7de10e945aaaee98fcf27e1f7b5b0f22d515c9a4a302e67bf5e897
MATLAB
4,125
147
function [r_est, m_est, k_est, MLL, LF] = bhvr_ML(y, z, mu, kr, m) % _ % Maximum Likelihood Estimation for a von Mises Mixture Model % FORMAT [r_est, m_est, k_est, MLL] = ME_vMMM_ML(y, z, mu, kr, m) % % y - an N x 1 vector of response errors (domain: -pi <= y_i <= +pi) % z - an N x 1 vector of swap errors (d...
83b548ad322ec6b0a2ea5cf0ff42aff57ef881972b9524848552820868e8936f
MATLAB
4,128
95
function all_combinations = param_string_number(cfg,default_params,parameters,all_value_combinations) % Subfunction with the format: % INPUT: % cfg: configuration script % default_params: which parameters have been passed as default (format % depending on the format chosen, in this case string) % pa...
4330e0603c465a2910dd37a57a0a8e1ef5d5124a00b002042868d3682ffc88b9
MATLAB
4,132
76
%% For Fig. 1C top: plot event count per frame across an entire FOV % % 1. Load 'AQuA_CytoGCaMP_ReceptorAgonistBathApp_Fig1.mat' workspace % 2. Run'Fig1_PreppingDataStruct.m': % Section A: experiment_type = 'BathApp'; method_AgonistEntry = 'MaxCurve' % Section B: Run as is % 3. Run the following code (...
db7974b4e08f0a2f3482ab7680873411ab59489fa7a4fbe1934f20ee452e25c1
MATLAB
4,137
172
clear [task_info,supPath,~,task_DB_path] = loadDBAndSpecifyDataPaths('Vermis'); EPOCH = 'targetMovementOnset'; DIRECTIONS = 0:45:315; req_params = reqParamsEffectSize("saccade"); %req_params.ID = [4797]; lines = findLinesInDB (task_info, req_params); cells = findPathsToCells (supPath,task_info,lines); cellType = c...
c29686a36a0e09366ce763ec0ee7db6be1211ba14394e3e51d90fdab7b343c5a
MATLAB
4,142
105
% Analysis scripts % addpath(genpath('/.../WM_VI_EVC/code/analysis/')); % addpath(genpath('/.../WM_VI_EVC/code/revisions/')); % Toolboxes % 1. SPM12 % https://www.fil.ion.ucl.ac.uk/spm/software/download/ % addpath('/.../spm12/'); %% Set Parameters clear variables %%% Create structure with key analysis parameters ...
18bb437e83a309752d98c512be13debfcac3594b76bf78f7f423cd10e9c23597
MATLAB
4,143
98
% % This script generates custom movies from CARLsim simulation results. % % Author: Nate Sutton, 2022 % % References: % https://www.mathworks.com/matlabcentral/answers/154659-how-to-create-animation-of-matlab-plotting-points-on-a-graph % https://www.mathworks.com/matlabcentral/answers/220094-how-do-i-make-a-video-of...
339a15d2e31fee7c692d54e7f1d4c2e1ccbb22083647dfa16915aec149c348b7
MATLAB
4,143
124
function [best_theta_est, p_val, cTab, theta_est, angles_inv, LLF, theta_init] = ... est_param_mADC_L2(monkey, RF, sessions, beh_dat, L2, mb_lim) %% Function to estimate parameters on pooled across sessions rand_init = 1:5:3000; onebyN_flag = 1; num_of_iters = 10; %% Code for both poole...
63f403b5d2f730a4b760c948c9bba57e2da5d592bfece7e76d3e6cc638d7334b
MATLAB
4,152
143
function [errs warns] = unit_plot_deviations_from_condmean() % [ERRS WARNS] = UNIT_PLOT_DEVIATIONS_FROM_CONDMEAN() errs = {}; warns = {}; errs = basic_case(errs); [errs warns] = alert_unit_errors(errs,warns); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [errs] = basic_case(errs); [subj ...
3e4b0fdc717de57a05227847a5b6782387783a21c18f26eaab00a39df44f1e1a
MATLAB
4,153
143
clear; clc [task_info, supPath ,~,task_DB_path] = ... loadDBAndSpecifyDataPaths('Vermis'); req_params = reqParamsEffectSize("both"); raster_params.time_before = 0; raster_params.time_after = 800; raster_params.smoothing_margins = 0; ts = -raster_params.time_before:raster_params.time_after; lines = findLinesInDB...
ae4cb59b4bf52ab22b7ce97260d99f69629798bcdd5a3cfb783624bc75618075
MATLAB
4,156
134
%% Frequency in bins clear clc % parent_dir="D:\Brewer lab data\HFS\No Stim\Wells_5SD_500maxSD"; parent_dir="D:\Brewer lab data\HFS\HFS Stim\Wells_5SD_500maxSD"; cd(parent_dir) % spike_dyn=load('well_spike_dynamics_table_nostim.mat'); % spike_dyn=spike_dyn.well_spike_dynamics_table; folders_in_dir=dir; is_dir=[folder...
00c8d34635622da332ac08e6bbadf4381619837bdff4140e2d39ab1d0bd9da1c
MATLAB
4,158
152
function [f,mdl,ds] = calcswitch(model,BEHdata,rescale,doplot,doregress,wincrit) f = []; mdl = []; if ~exist('rescale','var') rescale = 0; end if ~exist('doplot','var') doplot = 1; end if ~exist('doregress','var') doregress = 1; end if ~exist('wincrit','var') wincrit = [50 50]; end wincritt = winc...
2ab296b4050719a414d3f7227dfffc129fd25aabb7807eef396b267472804704
MATLAB
4,158
114
function [displacementField, certainty] = demons3d(moving, fixed, varargin) % DEMONS3D Estimates a displacement field using the original demons scheme % % [displacementField, certainty] = demons2d(moving, fixed) % % INPUT ARGUMENTS % moving - Moving iamge % fixed - Fixed image % % OPTIONAL INPUT ...
52fd992853304ec11c57d1ded07ff123f11e05cb7fbe13602f35f51513feb4d8
MATLAB
4,159
122
function [interferogram, apodization,prof] = yOCTLoadInterfFromFile_ThorlabsData(varargin) %Interface implementation of yOCTLoadInterfFromFile. See help yOCTLoadInterfFromFile % OUTPUTS: % - interferogram - interferogram data, apodization corrected. % Dimensions order (lambda,x,y,AScanAvg,BScanAvg). % ...
dbdfbe0ea6a5a07eccfe110cfd5a806cc409cac2cf61cbaaf0b0c6cc71f39109
MATLAB
4,159
119
classdef DropoutLayerClass < nnet.cnn.layer.Layer & nnet.internal.cnn.layer.Externalizable % DropoutLayer Dropout layer % % To create a dropout layer, use dropoutLayer % % A layer which randomly drops neurons during training. This can be % useful to prevent over-fitting. % ...
3d3b57f115e803f8511628033edd08ea26153e6a2d0ff8b723cb7e77bd4d04af
MATLAB
4,164
146
function [EV, EVr] = ReactRmatrices(filebase, cell_list, epochs_start, epochs_end, restrict_times) % ReactRmatrices % % computes the cell-pair correlation matrices R for sleep 1 sleep 2 and % maze and the explained variance. The R matrices are "flattened" stored % as column vectors (RpairC_s1, RpairC_s2, RpairC_m) cor...