sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
0f935e5ec120bbe42b75d28cca96a0e7e2a570290c9987971a906306c2d910a7 | MATLAB | 4,618 | 129 | function this = gifti(varargin)
% GIfTI Geometry file format class
% Geometry format under the Neuroimaging Informatics Technology Initiative
% (NIfTI):
% http://www.nitrc.org/projects/gifti/
% http://nifti.nimh.nih.gov/
%_____________________________________________________________... |
79e744dd80c8b14bfbbdd3ee4aabc1d6369e2ee2c753ad6afcb4647926e91dbb | MATLAB | 4,618 | 128 | function [pnt, tri] = msphere(N)
% MSPHERE returns a triangulated sphere with approximately M vertices
% that are nicely distributed over the sphere. The vertices are aligned
% along equally spaced horizontal contours according to an algorithm of
% Dave Russel.
%
% Use as
% [pnt, tri] = msphere(M)
%
% See also SPHER... |
c14bf6fa49036a26adc568c94b75208aa4bc7e4c8058242a7adab3da355c9d02 | MATLAB | 4,619 | 121 | classdef GTSetGenerator < handle
% GTSetGenerator holds a "GT set specification" and can generate a GT set
% per that specification.
%
% A GT Set Specification is a description of how to generate a random GT
% set: use so-and-so-movies, generate so many frames in a certain manner,
% etc.
%
% A GT Set is... |
126d1e5e794b60f7b65157a9698021bddb748a485767de846a979fc757183746 | MATLAB | 4,620 | 123 |
% Load data
load(fullfile(saveLoc, 'cosine_sim'), 'cosine_sim')
load(fullfile(saveLoc, 'resCorr_wiTrial'), 'all_zrMean');
load(fullfile(saveLoc, 'cosine_sim_randperm'), 'cosine_sim_randperm') % cosine_sim_randperm(sess, d1, d2, :)
load(fullfile(saveLoc, 'resCorr_wiTrial_rand_gauss'), 'par_sess', 'filtW50b', 'rz... |
5bdef0dfbf13b40ae6502606e00dfef73bff66325706a0e214d3d635cef127f9 | MATLAB | 4,620 | 176 | function meshplot_electrode(Elec,Color,cfg)
% <*LAN)<] toolbox
% v.0.3
%
% meshplot_electrode
% meshplot_electrode(cfg)
% meshplot_electrode(Elec,Color)
% meshplot_electrode(Elec,Color,cfg)
%
% plot a surface of the brain and add electrodes
%
% Elec or cfg.Elec = Position of the electrodes
% in... |
739ce148c3a1362a40825f4ed7e52406e4ac50a29b43746c00982372b385484b | MATLAB | 4,620 | 158 | function CutDatFragment(fname,timeperiod,RenameOriginalsAsOrig)
% Creating a new dat file from a fragment of an original dat file
% INPUTs
% fname: filepath/name of original dat
% timeperiod: start and stop of file fragment to keep, in seconds
% RenameOriginalsAsOrig: [optional] - specifies naming convention for new vs... |
55bd1dbefc775cdfcb1c4c7c793f2e5cf14665dc9ca8c7c9c14710d136a74236 | MATLAB | 4,621 | 232 | clear
clc
close all
%%% extended data fig 5 a-g
%%%% ext data figure that compares choice axis across rats
load('data/combined_kernels_per_context.mat')
%%% (generated by combine_neural_kernels_per_context.m)
data1=data_all_trials_loc;
data2=data_all_trials_freq;
resolution=glm.res*100;
data1.centers=-1:reso... |
644c31e0f5aeea5296017c4a3802c971766f6877464ca999123602661e4a56c7 | MATLAB | 4,621 | 149 | function varargout = ghostscript(cmd)
%GHOSTSCRIPT Calls a local GhostScript executable with the input command
%
% Example:
% [status result] = ghostscript(cmd)
%
% Attempts to locate a ghostscript executable, finally asking the user to
% specify the directory ghostcript was installed into. The resulting path... |
0a263acea40f31314a978656c1c763574a16a2988fdc509ba89ccedd8add2b87 | MATLAB | 4,622 | 156 | function rez = datashift2(rez, do_correction)
if getOr(rez.ops, 'nblocks', 1)==0
rez.iorig = 1:rez.temp.Nbatch;
return;
end
ops = rez.ops;
% The min and max of the y and x ranges of the channels
ymin = min(rez.yc);
ymax = max(rez.yc);
xmin = min(rez.xc);
xmax = max(rez.xc);
% Determine the average vertical... |
3de5fb4655471a74b1a4fb9f3cda5a97a8bafc54237b050db4f11c0de43444f2 | MATLAB | 4,623 | 98 | function model = getThermalMediaProperties(model)
% Returns the reduced medium matrix, using only numbers from 1 up to the number of used media, and
% the known media properties (optical, thermal and/or fluorescence) at the specified wavelength.
%
% See also mediaPropertiesLibrary
%%%%%
% Copyright... |
a4238511b899edb172f00ba32c2e45ce6ecba616ebf43e4f93d3b7a0ee27acc1 | MATLAB | 4,623 | 123 | function behav = meg_behavior(behav)
%% key
% blockNames = {'blank','fast-left'}; % fast-left
% attBlockNames = {'no-att','att-right'}; % att-right
% targetBlockNames = {'no-targ','pres-pres','pres-abs','abs-pres','abs-abs'};
% cueBlockNames = {'no-cue','1-1','1-2','2-1','2-2','3-1','3-2'}; % 2-1 = cueT2,postcueT1
%%... |
d479d6860bf2995ef1f6df5041b71b0163483fffb790a9b3acd7056e3b8f71cc | MATLAB | 4,623 | 132 | function [trl, event] = ft_trialfun_brainvision_segmented(cfg)
% FT_TRIALFUN_BRAINVISION_SEGMENTED creates trials for a Brain Vision Analyzer
% dataset that was segmented in the BVA software.
%
% Use as
% cfg = [];
% cfg.dataset = 'filename.vhdr';
% cfg.trialfun = 'ft_trialfun_brainvision_segmented';
... |
4b447ce301fb486dbf27eacded43226e6885ef1ccab0d7fa792b34d1de0aabfa | MATLAB | 4,624 | 125 | function [LEC_PET] = LEC_PET_atlas(PET_scan,MRI_atlas)
save_imgs = 0;
%% Slices
% Column 1 - left
regions = cell(10,2);
regions{1,1} = [61 31;65 26;69 24;75 22;78 31;73 33;69 35]; %slice=75
regions{2,1} = [61 31;65 26;69 24;75 22;78 31;73 33;69 35]; %slice=76
regions{3,1} = [61 31;65 26;69 24;75 22;77 29;72 31;... |
7e49bf8db6ad01d09ab18a998e67429fcd499e95d8796617c38074ba474a0f6b | MATLAB | 4,624 | 156 | function [tfr,dgr,gam]=tfrgabor(sig,N,q,h,trace)
%TFRGABOR Gabor representation of a signal.
% [TFR,DGR,GAM]=TFRGABOR(SIG,N,Q,H,TRACE) computes the Gabor
% representation of signal X, for a given synthesis window H, on a
% rectangular grid of size (N,M) in the time-frequency plane. M and N
% must be such that
% N1 ... |
cc57a9320c321dc0b2faa443a505b292619123dbb1aa1605e6e89d44ac0d1f8c | MATLAB | 4,628 | 132 | function [trl, event] = ft_trialfun_brainvision_segmented(cfg)
% FT_TRIALFUN_BRAINVISION_SEGMENTED creates trials for a Brain Vision Analyzer
% dataset that was segmented in the BVA software.
%
% Use as
% cfg = [];
% cfg.dataset = '<datasetname>.vhdr';
% cfg.trialfun = 'ft_trialfun_brainvision_segment... |
e3ed2c198b817ef2bc97f0dba6c2513fc393d740ddf1dbf7111db2e2a5d7692d | MATLAB | 4,630 | 142 | function pairsOut=View_Clear_Brain_ROI_Corr_fc2(Anat,IM,M,dataOut,fc,Pmax,params)
%
% This function draws ROIs on the brain and connecting rods colored by sign
% of correlation values in C. This can be the fc correlation itself if that
% is passed, or it can be the correlation of brain fc with behavior if that
% matr... |
eca68f218f7e94a22921c1b938cd05ad312d5612790ab5d37b5591edb3442427 | MATLAB | 4,630 | 135 | function pairsOut=View_Clear_Brain_ROI_Corr2a_mw(Anat,IM,M,dataOut,fc,Pmax,params)
%
% This function draws ROIs on the brain and connecting rods colored by sign
% of correlation values in C. This can be the fc correlation itself if that
% is passed, or it can be the correlation of brain fc with behavior if that
... |
4995391f93850da7877322fc04c4770a30fb89c6106ba6beb5d5e4ea49566197 | MATLAB | 4,634 | 135 | function pairsOut=View_Clear_Brain_ROI_Corr2a_simple(Anat,IM,M,dataOut,fc,Pmax,params)
%
% This function draws ROIs on the brain and connecting rods colored by sign
% of correlation values in C. This can be the fc correlation itself if that
% is passed, or it can be the correlation of brain fc with behavior if tha... |
9e2c7c4623bc337d2ba7670e3bcad1fb5b87363d15800ef4005b4db9b7a9818d | MATLAB | 4,634 | 112 | function [trl, eventslist] = trialfun_MSIT_correct(cfg)
% SEARCHTASKTRIALFUN is the function that filters and organizes trials by
% the designated markers. This function is called by:
% main > fcp_1_taskepoching > ft_definetrial
%
% INPUTS:
% cfg.dataset - path to CTF dataset
% cfg.trialdef.t0marker... |
396f9d917245852ae4aebe0b96e47e61b22bec7f39c5031b2cadf1c5fda5d248 | MATLAB | 4,635 | 162 | %% Example of the laplace approximation for logistic regression
% Based on code written by Mark Girolami
%%
% This file is from pmtk3.googlecode.com
clear all
setSeed(0);
fs = 14;
%% We generate data from two Gaussians:
% x|C=1 ~ gauss([1,5], I)
% x|C=0 ~ gauss([-5,1], 1.1I)
N=30;
D=2;
mu1=[ones(N,1) 5*ones(N,1)];
m... |
b33850032b4a89b492172c90c5a048df71063cd6cfc876736e445d8eb304efad | MATLAB | 4,636 | 157 | function [yo,fo,to] = specgram(varargin)
%SPECGRAM Spectrogram using a Short-Time Fourier Transform (STFT).
% SPECGRAM has been replaced by SPECTROGRAM. SPECGRAM still works but
% may be removed in the future. Use SPECTROGRAM instead. Type help
% SPECTROGRAM for details.
%
% See also PERIODOGRAM, SPECTRU... |
e4b50e71d0782a5028a90176ff2a5c0eec5bdf827aa47c1faf6b19248aed0357 | MATLAB | 4,639 | 111 | function [Aout] = jbm_processdatamatrix(rawDataMatrix)
Aout.rawData = rawDataMatrix;
identifiedCorrectionsDataMatrix = jbm_datafilter(rawDataMatrix,'Identify Corrections');
Aout.identifiedCorrectionsData = identifiedCorrectionsDataMatrix;
correctedDataMatrix = jbm_datafilter(identifiedCorrectionsDataMatrix,'Exe... |
bc9de45d2b69dfa7ef652adc13b1248a75c576c66beaa0881221edf66c9840a5 | MATLAB | 4,640 | 119 | % Address the basic question, when x is the salient category, what
% percentage of units are tuned to x.
function PlotAnalysisThroughTimeLFP(config,varargin)
if strcmp(mfilename,'') || nargin==0
opts=Analyze.Libet.Config_BasicLinearModel;
else
opts=feval(config,varargin{:});
end
%%
BaseDir=opts... |
cfc2fe88769ec3d100ed305530eb12db419d1af3df115b2a1db857cdc41fb4af | MATLAB | 4,640 | 133 | % Author: Birgit Nierula
% nierula@cbs.mpg.de
function bs_prepro_loop1(isubject, icondition, srmr_nr)
%% combines selected EEG and ESG channels to one data structure
%% set variables
subject_id = sprintf('sub-%03i', isubject);
load_eegpath = [getenv('EEGDIR') subject_id '/'];
load_esgpath = [getenv('ESGDIR') subject... |
dddc45e8ec240cf145c6f927315f59df39804a322c895ca69b40f8138dcbacc4 | MATLAB | 4,642 | 127 | % Purpose: Convert fsaverage6 SNR maps to .mat matrices, avg over sessions
% and within networks
% Inputs: LH and RH step2 .shape.gii output, individual parc output
% (matched)
% Outputs: subject-avg SNR .mat, .csv file containing network-avg SNR for each subject
%
% Note: This requires the use of the gifti package (pa... |
a11a154db38a08db40239102be953b4931ec4f8cc6a56d26bfba0772a8a57e53 | MATLAB | 4,643 | 114 | function ICs_to_keep = RELAXJr_Spatial_Info_eyes(blinks,eye_electrodes,topog,chanlocs,n)
% function discs_to_keep = Spatial_Info_discs(EEG)
%
% figures out if eye stuff rejected by adjust should be kept
% - keeps them if there's too much spread
%define variables
ICs_to_keep = [];
arb_dist = 5.5;
arb_zval =... |
baa7ae2c4ab64a7f139eab36da87586ed4f96514ad6913102bb2a20b32ba1918 | MATLAB | 4,643 | 115 | function [y_resid_perfold] = CBIG_crossvalid_regress_covariates_from_y( ...
y_in, regressors, sub_fold, outdir, outstem)
% [y_resid_perfold] = CBIG_crossvalid_regress_covariates_from_y( ...
% y_in, regressors, sub_fold, outdir, outstem)
%
% This function regress the "regressors" from the target variables "y_i... |
f238ac03c7ec229cd59a987cc344627ea9d6da616d189f97e39ec21d2a833b1f | MATLAB | 4,644 | 132 | function [tfr,t,f] = tfrridbn(x,t,N,g,h,trace);
%TFRRIDBN Reduced Interference Distribution with a binomial kernel.
% [TFR,T,F]=TFRRIDBN(X,T,N,G,H,TRACE) Reduced Interference
% Distribution with a kernel based on the binomial coefficients.
% TFRRIDBN computes either the distribution of a discrete-time... |
a7ea952255e33b3df2867f17adee22b178f45a6f0d14e3b2fb23efc6d276cf2f | MATLAB | 4,645 | 124 | %{
Copyright (c) 2025 Axion BioSystems, Inc.
Contact: support@axion-biosystems.com
All Rights Reserved
%}
classdef WellInformation < Tag
%WELLINFORMATION Class that describes the platemap data for a single well
properties(GetAccess = public, SetAccess = private)
% location bytes that are cu... |
247daa22b9c1ff1ce004d5dffbd94dc33a1263effaa41c9542ebf510e8c36a8b | MATLAB | 4,646 | 108 | function ConsiderFileList=AnalyzeDirectory(inputfolder,channel,DoCheck,outputfolder)
%Return a list of all *.mat files in the directory. It will ignore
%subdirectories and the files therein. It will check that all files for the
%given channel have the same parameters (ledon, ledoff, ledactive, fs)
%
%Input: 'input... |
f859072ef4f85f8d041d4b36a0d74ee06ea748ac8175f601c5d7d9e0ce40ec57 | MATLAB | 4,646 | 129 | function spm_make_standalone(outdir, gateway, contentsver)
% Compile SPM as a standalone executable using the MATLAB Compiler
% https://www.mathworks.com/products/compiler.html
%
% This will generate a standalone application, which can be run outside
% MATLAB, and therefore does not require a MATLAB licence.
%
% On W... |
80a4e62035a844c4af49d31c3f3a1c452a9fcb69c782a6bb8c9280fe9072189f | MATLAB | 4,649 | 141 | function [tfr,t,f] = tfrcw(x,t,N,g,h,sigma,trace);
%TFRCW Choi-Williams time-frequency distribution.
% [TFR,T,F]=TFRCW(X,T,N,G,H,SIGMA,TRACE) computes the Choi-Williams
% distribution of a discrete-time signal X, or the
% cross Choi-Williams representation between two signals.
%
% X : signal if auto-CW, or [X1,... |
ad6cf2fadf32e0e05cdb4b665ce1b663918e93e64d44eacbddf83dc6b8c41dfe | MATLAB | 4,649 | 152 | function varargout = movCrop(varargin)
% MOVCROP MATLAB code for movCrop.fig
% MOVCROP, by itself, creates a new MOVCROP or raises the existing
% singleton*.
%
% H = MOVCROP returns the handle to a new MOVCROP or the handle to
% the existing singleton*.
%
% MOVCROP('CALLBACK',hObject,eventData,... |
66ef11c3eb17da7862e695c57a8321fa234330e2de6bb92c00b5e5bc4778b086 | MATLAB | 4,650 | 145 | % data = createdata_perfile(moviename,matname,annname)
%
% inputs:
% moviename: name of movie file
% matname: name of matfile in which tracks are stored
% annname: name of annotation file in which parameters are written
%
% outputs:
% data: array of structures of size 1 x nflies
% data(i) has the following fields:
% ... |
afb98aa2fb505e9460cadcfbe8feba1a637decff44d692be0512cc8a8817ab93 | MATLAB | 4,652 | 152 | function dgm = dgmFitStruct(X, varargin)
%% Fit structure and parameters of a DGM
%
% X is an N*D matrix of binary (0/1) values
%
% We use the L1MB+local search algorithm to find the structure
% This uses L1-penalized logistic regression to fit the model.
% See http://www.cs.ubc.ca/~murphyk/Software/DAGlearn/index.html... |
d5fb4deddf281c5c5370764b5cc9270dcd083044c37069af17b75304ca92c550 | MATLAB | 4,654 | 129 | %% bootstrap_tsdata_to_mvgc
%
% Calculate sampling distribution for conditional time-domain MVGC from time
% series data, based on a nonparametric bootstrap
%
% <matlab:open('bootstrap_tsdata_to_mvgc.m') code>
%
%% Syntax
%
% FB = bootstrap_tsdata_to_mvgc(U,x,y,p,nsamps,acmaxlags,acdectol)
%
%% Arguments
%
% See al... |
bc8c89c6d0ebefb0ced6f7f8851e923b596f3ba9d7a91bb08582bafb35aa70bf | MATLAB | 4,661 | 116 | classdef FlySongImporter < FeaturesImporter
properties
end
methods(Static)
function n = typeName()
n = 'Fly Song';
end
function ft = possibleFeatureTypes()
ft = {'Sine Song', 'Pulse'};
end
function init... |
be663bfd90ec93993482913adbd2ac4a2b18c36160f97f95984a982769868bce | MATLAB | 4,661 | 302 | function PLOT34_FT_fourier(LAN,EjeF,EjeX)
bs = 60;
h2=figure;
if ~isfield(LAN, 'freq_m')
freq = LAN.freq;
LAN = mean_freq(LAN,3);
end
AA = LAN.freq_m;
[fil3 col3 tri3] = size(AA);
for e=1:34
% NORMALIZATION %
for frec3 = 1:fil3
MeanMatTF2 = mean(squeeze(AA(frec3,1:bs,e))');%*o... |
5c5f88812a6e8fe184c3c9bda1687b9af7922cd79a2320d8238c9e4c293f1222 | MATLAB | 4,662 | 103 | function EEG = DS_NaNbadData(EEG,PARAM,EEGperiods)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% NaN data during bad data events and stages outside NREM
%
% Part of detect_spindles toolbox:
%
% Authors: Stephane Sockeel, PhD, University of Montreal
% Stuart Fogel, PhD, Univ... |
46f52b4f7df5ccc5084b600e599e918002c0701afcbf53e6edc8ae96a8b7657a | MATLAB | 4,663 | 160 | % this script displays the voltage trace from the .wcp file from a patched cell
% it only imports the first two (V and I) traces (along with camera)
% applies a gaussian filter to data
% returns dummy data for all the required variables that are not relevant (img_ps, img_pe (image
% puff starts and ends on) etc.
% it ... |
a2042280e83335fb81edadd61acf8d2e6dc20673b64f56a6b50118291dfb6f16 | MATLAB | 4,663 | 103 | function corrdiff_FIR(stat_path,sots_path,exp_folder,N,TR,q_level,ground_truth)
% ========================================================================
% Ruslan Masharipov, October, 2023
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
tic
load(sots_... |
59669722223340868ae31d7ae614185ecabf7fc3fc3b9e89920e1c8b1bbb84dd | MATLAB | 4,664 | 114 | function all_PSD=extract_PSD(varargin)
% calculates PSD for selected channels
% INPUT:
% - vector of channels
% - no input: all channels will have their PSD calculated
% - use sleep states or not
% e.g: extract_PSD(channels,sleep) or extract_PSD(channels,[])
% LOADS:
% - position data
% - sleep state (based... |
9331fb802681f98d2511d7e83f9411747d0f93ef0a7ec458da4cf17ab488cc1e | MATLAB | 4,664 | 126 | function jbm_synapseAnalysisEngine(handles)
global jbm;
global h_img3;
PRESENT = 1;
NOT_PRESENT = 0;
SPINE_PRESENT = 2;
LOW_CONFIDENCE = 3;
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
selectedInstance = currentInd;
instances = fieldnames(h_img3);
iscommon = find(... |
925aa44a6d87f81857890d41f209dafc30936afc02b94956fe5e194a42471154 | MATLAB | 4,665 | 96 | function [U] = h3ddir(zk,srcinfo,targ,pgt)
% H3DDIR Direct (slow) 3D Helmholtz kernel sums (reference for HFMM3D).
%
% U = h3ddir(zk,srcinfo,targ,pgt)
%
% Helmholtz direct evaluation in R^3: evaluate all pairwise particle
% interactions with targets. This is the slow O(N^2) direct code used
% as a reference for t... |
45135f11a852fdbef6670633ead8bac6599af21fac611e31476740015d2b07ea | MATLAB | 4,666 | 157 | function [model, loglikHist] = mixGaussMissingFitEm(data, K, varargin)
% Fit a mixture of Gaussians where the data may have NaN entries
% Set doMAP = 1 to do MAP estimation (default)
% Set diagCov = 1 to use and diagonal covariances (does not currently save
% space)
%PMTKauthor Kevin Murphy
%PMTKmodified Hannes Bretsch... |
37c77168ddabcaa492288f51336660e84fa8b589ea3c6c3823f2559d9d8121dd | MATLAB | 4,667 | 108 | % TSINITEXPERIMENT Create a new Experiment structure named "Experiment".
% TSINITEXPERIMENT(NAME,IDNUM,SUBJECTS,SPECIES,LAB) creates a global
% experiment structure called "Experiment" that contains the provided
% information. NAME is the name of the experiment in String format.
% IDNUM is the id number of the... |
6451dc2f2d4ec4e57e086c6616b471ade0212cc6e740613076d0f06210e1ae6d | MATLAB | 4,668 | 80 | function PassiveReward(MATPATH, FIGPATH, params)
%% Parameter setting
params.processFcn = @NoveltySU.preprocess.PassiveProcess_reward;
temp = string(strsplit(MATPATH, "\"));
% dateStr = temp(end - 1);
protStr = temp(end - 2);
temp = string(strsplit(temp(end-1), "_"));
rewardTime = double(... |
e392a7ee24241d542f9d8f74a3c6f97e942038c21013dd934dc923277d62b65b | MATLAB | 4,668 | 122 | function [coord_snapped] = warp_hermes2010(cfg, elec, surf)
% WARP_HERMES2010 projects the ECoG grid / strip onto a cortex hull
% using the algorithm described in Hermes et al. (2010,
% J Neurosci methods) in which electrodes are projected onto the pial
% surface using the orthogonal local norm vector to the grid. To ... |
2e29dd47448dfbb3e601fbd0e52945d0b4375e23087642ae7b11646c1fca3529 | MATLAB | 4,669 | 130 | function [ferns,hsPr] = fernsClfAddTrainingData( data, hs, new_data_idx, ferns )
% Compute cross-validation error of random ferns classifier
%
% See "Fast Keypoint Recognition in Ten Lines of Code" by Mustafa Ozuysal,
% Pascal Fua and Vincent Lepetit, CVPR07.
%
% Dimensions:
% M - number ferns
% S - fern dept... |
497d242e573ea1cb1a517dc9ac9842293c8bf8bd8802b3e6158c29d2e64ce96d | MATLAB | 4,669 | 127 | function [posterior,suffStat] = VBA_VarParam(y,posterior,suffStat,dim,u,options)
% VB update of the precision hyperparameters
% function [posterior,suffStat] = VBA_VBVarParam(y,posterior,suffStat,dim,u,options)
%
% This function computes the natural parameters of the Gamma variational
% posterior pdf of the variance pa... |
32832a034e9cb7cd4d586222d3b088cf0cf38f716f95b1aba62f9ce3cc62505f | MATLAB | 4,670 | 168 | % doflip = choose_orientations(spinex,spiney,[movement_weight=.5,[min_segment_length=5]])
%
% chooses whether to flip or not flip the spine in order to minimize:
% \sum_t cost(s_t|s_{t-1})
% cost(s_t|s_{t-1}) = movement_weight*||spine_t(s_t)-spine_{t-1}(s_{t-1})|| +
% (1-movement_weight)*< segmentdi... |
95cf98ffc0aa2b9c83c325bf4840b483fe5236b1af753cc373be3e83e6b77235 | MATLAB | 4,670 | 158 | function fixResult = TrioEEGBehGetFixations(result, useParFor)
% function result = TrioEEGBehGetFixations(result, useParFor)
% Loops through array of result structures, getting fixation data for each,
% saving a file for each
%
% Inputs: result = result structure array (from TrioEEGBehProcess
% useParFor:... |
9a25e2f81fa0223a4fa536577a9468ea45d63371fd58647b6918135de2b1b424 | MATLAB | 4,670 | 99 | %ExtractFromTargets Extract various values from array of neuralynx video tracker led/diode/bright spot bitfields ("targets" or "points").
% [x,y,color,valid_targets] = ExtractFromTargets( nlx_targets ), for M-by-N matrix nlx_targets.
% nlx_targets is composed of M number nlx records by N max targets per record.
% ... |
ebc538653e901d68de7ccfd8a79ce4e2478839767949c865caabedfe3cb22699 | MATLAB | 4,671 | 122 | function [coord_snapped] = warp_hermes2010(cfg, elec, surf)
% WARP_HERMES2010 projects the ECoG grid / strip onto a cortex hull
% using the algorithm described in Hermes et al. (2010,
% J Neurosci methods) in which electrodes are projected onto the pial
% surface using the orthogonal local norm vector to the grid. To ... |
3e97615954cf5710f512f213395b24c0f7ba360719b5158c4617bbc35a583208 | MATLAB | 4,676 | 154 | function [stats,st] = lme_fit_FS(X,Zcols,y,ni,e)
% [stats,st] = lme_fit_FS(X,Zcols,y,ni,e)
%
% Linear mixed-effects estimation by the Fisher scoring algorithm.
%
% Input
% X: Ordered design Matrix (according to time for each subject).
% Zcols: Vector with the indices of the colums of X that will be considered
% as rand... |
234b923ab39bc738ade0191bbefa673f1499d0d3d07fb92f001beb63c990cc09 | MATLAB | 4,677 | 157 | function AlignReview(spkDat, dt, varargin)
% convert waveform data from int16 to double-precision floating point
spkDat.waves = double(spkDat.waves);
maxScale = 1;
sameScale = false;
convertToVolt = true;
nSampTarget = 100;
clustList = setdiff(unique(spkDat.id), 0);
dtRange = unique(dt);
Fs = spkDat.Fs;
wvFs = Fs * s... |
b13e9fa07482a91acaa4b4bf387f9d4042331d26cd613f2db7b9c3f2cffa4080 | MATLAB | 4,677 | 119 | % pop_visualizeMARAfeatures() - Display features that MARA's decision
% for artifact rejection is based on
%
% Usage:
% >> pop_visualizeMARAfeatures(gcompreject, MARAinfo);
%
% Inputs:
% gcompreject - array <1 x nIC> containing 1 if component was rejected
% ... |
97d7569467518a0834ddcfb0359269a8e8a8093bc6406e9485f82791065c94ca | MATLAB | 4,678 | 126 | function [stepsize, newx, newkey, lsstats] = ...
linesearch_hint(problem, x, d, f0, df0, options, storedb, key)
% Armijo line-search based on the line-search hint in the problem structure.
%
% function [stepsize, newx, newkey, lsstats] =
% linesearch_hint(problem, x, d, f0, df0, options, s... |
39d54c773813dfb9bec81b9327738b7cefbc5c720c1aeac9565a35edb66608ca | MATLAB | 4,679 | 156 | % demo operant learning with dynamic learning rate
% This demo simulates a "volatile learner" experiencing feedback to her
% chosen actions. The pseudo learning rate then changes as a function of
% (estimated) environmental volatility. We then fit the behavioural
% response with a stochastic variant of the Q-learning m... |
d71a0287da0dfc5f3ea374430b4258a09f179d1549c7305deb77b1ce134b8b8a | MATLAB | 4,679 | 149 | classdef UndoManager < handle
properties (Access=private)
undoStack
undoIndex
end
events
UndoStackChanged
end
methods
function obj = UndoManager()
obj.undoStack = {};
obj.undoIndex = 0;
end
... |
a1bedd49756902ae0cd0318316c669d405dc7d473a13927cf564560c5f6a8e99 | MATLAB | 4,681 | 90 | function meeg = spm_cfg_eeg
% SPM M/EEG Configuration file for MATLABBATCH
%__________________________________________________________________________
% Copyright (C) 2008-2014 Wellcome Trust Centre for Neuroimaging
% $Id: spm_cfg_eeg.m 7745 2019-12-03 14:55:56Z gareth $
%---------------------------------------------... |
18019515a63a56af1b80d9ad588a212d48753e7355f781e826581b77074fa154 | MATLAB | 4,682 | 156 | function general_behavior_file_SNlab(varargin)
% adapted from AYA lab general_behavior_file.m LB 03/22
% Outputs
p=inputParser;
addParameter(p,'basepath',pwd); % single or many basepaths in cell array or uses pwd
addParameter(p,'force_overwrite',false); % overwrite previously saved data (will remove custom fields)
add... |
41dd5684e95661e8615c9fab48e64e8e17c914d1b895c8e0d773bda6bd052f18 | MATLAB | 4,683 | 174 | function [t,amps,data,aux] = read_intan_data(filename)
% [t,amps,data,aux] = read_intan_data
%
% Opens file selection GUI to select and then read data from an Intan
% amplifier data file (*.int).
%
% t = time vector (in seconds)
% amps = vector listing active amplifier channels
% data = matrix of electrode-referred a... |
69bf33c19215bfd7bcae13882abcad1adc95018911ff8b22fb8c30fdace3d2e7 | MATLAB | 4,684 | 138 | %% pxTools_getLikelihood
% Distribution-wise metric for predicted/observed state distributions.
% Calculate the likelihood metric. (L(H|x) = p(x|H);
% --> We assume each distribution is independent
% ASSUME: Input predicted and observed probability distributions are column
% vectors; equivalent sizes
%
% 'nPo... |
dc8cdfb6ac5b577a48d324b3a4c468fc938bd233c2622047790168ff68c6ac47 | MATLAB | 4,687 | 112 | function [s, cfg] = ft_statfun_correlationT(cfg, dat, design)
% FT_STATFUN_CORRELATIONT calculates correlation coefficient T-statistics on the
% biological data in dat (the dependent variable), using the information on the
% independent variable (predictor) in design. The correlation coefficients are stored
% in the r... |
b6b98deb77743d9c73912da7ec73b05b7a5475e7251efd6e280f705a490f5ba7 | MATLAB | 4,689 | 128 | function [] = randnetPlaceFields(modelParam, network, opS_PF, opV_PF, opGin_PF, linfields, varargin)
% plots.randnetPlaceFields(modelParam, network, opS_PF, opV_PF, opGin_PF, linfields, ithEnv=1, ithTrial=1)
%
% Plot results from place field simulations of randnet
%
% Inputs:
% - modelParam: the model parameter struc... |
43f844122c60cf58282477c2778fe6dfe337fd0b896e97555cbcba5329a160e3 | MATLAB | 4,691 | 129 | function result=psignifitCore(data,options)
% this is the Core processing of psignifit, call the frontend psignifit!
%function result=psignifitCore(data,options)
% Data nx3 matrix with values [x, percCorrect, NTrials]
%
% sigmoid should be a handle to a function, which accepts
% X,parameters as inputs and gives back a ... |
4ca9042a1a6a07d243db485a9d2dfff25e32fc2648f909aee260abb76246d1b3 | MATLAB | 4,691 | 101 | %
%
% B01_raster_psth_encoding_BAligned_BSep_NWB( nwbData, timestampsOfCell, channelid, cellNr, brainAreaOfCell, bin_width_raster, bin_width_fr, plot_flag)
%
%History
%12/2/21: This file is forked from original B01_raster_psth_encoding_BAligned_BSep.m by JZ.
%
function [] = B01_raster_psth_encoding_SAligned_BSep_NWB(... |
39197a65855f937ba9b10d0413b1c6a6e5e8e310595a96dfeb2d1bff72c4a212 | MATLAB | 4,692 | 131 | clear P t
% This script performs mesh refinement in a selected domain using
% barycentric triangle subdivision (1:4). The input mesh must be 2 manifold
% Copyright SNM 2012-2018
% The Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General
% Hospital & ECE Dept., Worcester Polytechnic Inst.... |
d8402b24ac66070af5d8191ecbc15f51b235a1036ee38ecca4e7828a1668d0e4 | MATLAB | 4,692 | 135 | %% Modified version of netlab's demev1
% We changed the plotting style slightly
% and got rid of the annoying pause statements, so the script can be run
% without user intervention
%%
% This file is from pmtk3.googlecode.com
disp('This demonstration illustrates the application of Bayesian')
disp('re-estimation to de... |
fd9992606b3e125b5c3caebcce799863d2c679901bf863ee7e7f370901216222 | MATLAB | 4,692 | 212 | function [resp11,resp12,c,slope_val,d_shap] = plot_pulse_response(model,fixed_points,fp_linsys)
n_units=length(model.wO);
facto=0.9; %model_tau = 100ms
% number of time points
maxt=50;
xtime=linspace(0,0.65,maxt);
%%% output of the network computed at fixed points in context 1
output1=fp_linsys.o1;
%%% output... |
18d13961c1a8079d5fe2123d0573a95fac51bded8a4341fd7bd92821fece6b49 | MATLAB | 4,695 | 238 | function RT = rt_read_presentation(cfg)
% v.0.0.1.4
% <*LAN)<|
%
% cfg.filename = 'nombredearchivo.log'
% %%% si se decea evaluar respuestas correctas
% cfg.delim = [est, resp,resp,resp;
% est, resp,resp,-99] %% matriz con estimulos
% %... |
2653e1000d3cba7fc46423843da7e9d4bb47908965195600da9b4b93d3979f0e | MATLAB | 4,695 | 137 | function behav = behavior(behav)
%% key
% blockNames = {'blank','fast-left'}; % fast-left
% attBlockNames = {'no-att','att-right'}; % att-right
% targetBlockNames = {'no-targ','pres-pres','pres-abs','abs-pres','abs-abs'};
% cueBlockNames = {'no-cue','1-1','1-2','2-1','2-2'}; % 2-1 = cueT2,postcueT1
%% organize data
n... |
e97f04ac302598bb6212da38fec111bb056a2a3f2a11dd9de2fb974733171451 | MATLAB | 4,695 | 121 | % FindDifferenceBetweenPeriods.m
% Sarah West
% 2/3/22
function [] = FindDifferenceBetweenPeriods(parameters)
% Say where data is being saved
disp(['Data saved in ' parameters.dir_out_base{1}]);
% Make colormap for difference plots.
mymap=flipud(cbrewer('div', 'RdBu', 256, 'linear'));
% Load ... |
eb475853db4be708c7ec60d8149f33cd64a83087cf329d8f7824e8073443ab47 | MATLAB | 4,696 | 80 | clear
close all
clc
%% Load atlas
% path to MRI template - must include hdr and img files
atlas = niftiread('/Users/jstrohl/Documents/20230908 Pipelines for neural data analysis/Dependencies/ATLAS-MICE 2/2011-10-30_MRI-template3.hdr', ...
'/Users/jstrohl/Documents/20230908 Pipelines for neural data analysis/D... |
7ff20d83afa410208f9e7413fcbeac8c57967920c8f05d25e58563efdc18ed16 | MATLAB | 4,698 | 118 | function calc_FADE_SAME_scores(stud_dir, subj_file, GLM_name, ref_dirs, ref_maps, con_vecs, contrasts, scores, res_suff)
% _
% This script calculates (i) FADE and SAMe score for (ii) novelty and
% memory contrast from (iii) AiA and yFADE subjects using (iv) cross-
% validated reference maps.
%
% written by Joram Soch ... |
af00ae74afe813af74203bfcffd1e16635a4ed2e9201dae68869b7abea52bf2c | MATLAB | 4,700 | 167 | function [o]=permutedbrunnermunzel(x,y,niter)
% only perform 2-sided test
% if niter = 0, it will perform exact test using all combinations (nCr),
% if the # of combinations > 25_Choose_11, please use random sampling,
% e.g., set niter = 100000 for 100000 iterations;
% or use the approximate test: approxbrunnermun... |
dfb98d12e654f10faf4a885b534f289a54d6e28d9b58aabd0e73039484f498eb | MATLAB | 4,701 | 160 | % h = myscatter(x,y,scale,color,[ncolors],[cm],['filled'],marker,...)
%
% MYSCATTER Scatter/bubble plot.
% MYSCATTER(X,Y,S,C) displays colored circles at the locations specified
% by the vectors X and Y (which must be the same size). This function
% is similar to the SCATTER function. Instead of plotting ... |
6d9dbb6d7a79eb0379d4fd00e9966b92d3d7facd341b84aa8e385eba8a7e66d1 | MATLAB | 4,702 | 156 | function [tfr,rtfr,hat] = tfrrsp(x,t,N,h,trace);
%TFRRSP Reassigned Spectrogram.
% [TFR,RTFR,HAT] = TFRRSP(X,T,N,H,TRACE)
% computes the spectrogram and its reassigned version.
%
% X : analysed signal.
% T : the time instant(s) (default : 1:length(X)).
% N : number of frequency bins (default : length... |
96d0ac4e2634640076ff6f52a425eb3e43ca0a50534d3479d4f83463b0fc6ec3 | MATLAB | 4,703 | 186 | %%% INPUT THE IMAGE FILE NAME:
if ~exist('fc')|~exist('cc')|~exist('kc')|~exist('alpha_c'),
fprintf(1,'No intrinsic camera parameters available.\n');
return;
end;
dir;
fprintf(1,'\n');
disp('Computation of the extrinsic parameters from an image of a pattern');
disp('The intrinsic camera parameters are assumed ... |
135abbe847453de30841dc4511bd504179e591d16b6a4072148fcbc5f0809a61 | MATLAB | 4,705 | 93 | function [cfg,flag] = runUROMT(cfg)
% This function runs the urOMT algorithm.
%% %%%%%%%%%%%%%%
if ~exist(cfg.out_dir,'dir')
mkdir(cfg.out_dir)
end
reInitializeU = 1;
fname=sprintf('%s/record.txt',cfg.out_dir);
if ~exist(sprintf('%s/record.txt',cfg.out_dir),'file')
csvwrite_with_headers(fname,[0 0 0 0 0 0 0... |
5dc262fb1c58d774276a95044d8e3b09cd38e3f191112a7ef8466b754efe7b6c | MATLAB | 4,705 | 117 | function [] = y_bandpass(ADataDir, ...
ASamplePeriod, ALowPass_HighCutoff, AHighPass_LowCutoff, ...
AAddMeanBack, ...
AMaskFilename,...
CUTNUMBER)
%Ideal Band pass filter
%Algorithm re-written to call y_IdealFilter by YAN Chao-Gan
% FORMAT y_bandpass(ADataDir, ...
% ASamplePeriod, ALowPass_H... |
3e0703e8b9c03fd94f89a6eb116efb7a610631e5e53bee659a00b5a78c84d2b6 | MATLAB | 4,706 | 153 | function [cfg] = ft_multiplotCC(cfg, data)
% FT_MULTIPLOTCC visualises the coherence between channels by using
% multiple topoplots. The topoplot at a given channel location shows the
% coherence of that channel with all other channels.
%
% Use as
% ft_multiplotCC(cfg, data)
%
% See also FT_PREPARE_LAYOUT, FT_TOPOPL... |
90d757facc84660a58840b10f68872dfef16eeb7c3e22d6859221ba303e9d1d7 | MATLAB | 4,707 | 187 | function [sac, radius, msdx, msdy, stddev, maddev] = microsacc_plugin(x,vel,VFAC,MINDUR,blink_data)
%(x,vel,VFAC,MINDUR,MSDX,MSDY,blink_data)
%-------------------------------------------------------------------
%
% FUNCTION microsacc.m
% Detection of monocular candidates for microsaccades;
% Please cite: Engbert, R.... |
bb95635af813ddf99d8fb88df0422af90eb87e15ddbd9b55d48b194a60c7d526 | MATLAB | 4,707 | 146 | % This demo evaluates group-level BMS when asking whether different
% conditions induce different models. More precisely, the code uses MCMC
% simulations to obtain distribution of Eps, BORs and protected EPs, given
% fixed frequency profiles of tuple families f= and f~=.
% See function VBA_groupBMCbtw.m
clear all
clo... |
39799f95d3b33266a61ddb2cc534b79a1a118dea65ed2d0b310cb1a297ab8664 | MATLAB | 4,710 | 155 | rows = 8068;
respCell = cell(1,rows);
class = cell(1,rows);
offsetTime = 1;
delayed = cell(1,rows);
inhib = cell(1,rows);
Xenergy = zeros(1,rows);
XISI = zeros(1,rows);
XPulses = zeros(1,rows);
respCounter = 0;
psth = zeros(1,200);
for ck = 1:8068
if INSDataTable{ck,24} == 1
curResp = INSDataTable{... |
70a7350292e2116c240f86bad0e4368f90ae8a4d30f70162ff2d1044cb6d4068 | MATLAB | 4,711 | 115 | function [im, timestamp] = mp4_seek_read_frame(readerobj, index, f)
% Read frame f (1-based) from an already-open VideoReader, using the seek index
% from mp4_read_index for fast, frame-accurate random access.
%
% MATLAB's read(readerobj, f) decodes every frame from the start of the file to
% reach frame f, so its cost... |
fb1e533283ec342471a0e7a2272444be9779a9cb4336dd5a9ba291a1acad1504 | MATLAB | 4,711 | 177 | close all, clear all, clc
addpath C:\code\wjn_toolbox
addpath C:\code\spm12
addpath(genpath('C:\code\leaddbs'))
spm('defaults','eeg')
addpath C:\Code\wjn_toolbox-master
% T = readtable('ECoG Coordinates Bipolar.csv');
% T = readtable('C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Ne... |
cb781634536ae715d60169527c1ef6c424a2f07f4ac66687bf26e435dab0f4fa | MATLAB | 4,712 | 116 | % Function which computes the communication subspace between two areas,
% based on Semedo et al (2019)
% INPUTS:
% activity1 : source activity, should be of dimension
% (# observations)x(# variables)
% activity2 : target activity, should be of dimension
% ... |
07856ca90040dd8815bbd4e4730f564229f50ae113665540d2df55536daa823f | MATLAB | 4,713 | 150 | function quantized = quantizePMTK(vars, varargin)
% Quantize continuous variables
% PMTKneedsStatsToolbox grpstats
% The main purpose of this function is to quantize continuous variables for
% the use in mutual information calculations. In Y=QUANTIZE(X), rows in X
% represent different samples, and columns represent di... |
ef107f52e6a8ccb436a7b4f3e1b130b305d869bebdf4deaec2a6d4a9b96fec1a | MATLAB | 4,714 | 103 | %% This file runs and saves the data for the results in Figure 1
% Parameters D, beta are held constant and Delta is randomly chosen.
%% Machine and simulation parameters
N = 1000; % Number of simulations
NDirs = 64;
SNR = [5, 10, 20]; % Signal-to-Noise Ratio
Sigma = 1./(sqrt(NDirs)*SNR); % St Dev of noise
num... |
b2f5c8bc752e951cfe5c1e501628df31b5730ef95c89be4e26de39aba110d1cc | MATLAB | 4,715 | 75 | function [EC] = meshneighborints_En(P, t, normals, Area, Center, RnumberE, ineighborE, numThreads)
% Accurate integration for electric field on neighbor facets using the solid angle approach
% Copyright WAW/SNM 2020-2021
N = size(t, 1);
integralxc = zeros(RnumberE, N); % center-point Ex integrals... |
bbd911a48931477b88cf266f25b1bbca3a014a3aeca586dd9b97163a80451355 | MATLAB | 4,715 | 102 | format compact;
Int_main_folders = ''; % main working directory
ShortNames = {'R1_6hr','R1_24hr','R1_72hr','R2_72hr','R2_24hr','R2_6hr'};
Int_Results_folders = {}; % folders to save the results
Int_RawImage_folders = {'Folder1', 'Folder2', 'Folder3', 'Folder4', 'Folder5', 'Folder6'}; % Raw Tiff image folders
for... |
d90453d4b1cba0c16b8d1f99241038be9d0ccb18d88f38e6db7f09c81c22a3a5 | MATLAB | 4,716 | 99 | function [calc_corr_max_run_jobs,affine_max_run_jobs,affine_max_pool_size] = concurrency_size_in_registerWithCorrespondencesCUDAInParallel(cond)
loadParameters;
num_rounds = params.NUM_ROUNDS - 1;
if ~isfield(params,'CALC_CORR_MAX_RUN_JOBS') || ~isfield(params,'AFFINE_MAX_RUN_JOBS')
% TODO: consi... |
b47236c970b22809c61d50d7e16108127a95402a66bccc242a13b187ef805323 | MATLAB | 4,721 | 135 | % Second-kind integral equation on the unit cube, Laplace single-layer.
%
% This is basically the 3D analogue of IE_SQUARE.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - OCC: tree occupancy parameter (default: OCC = 1024... |
8e0638971aa7251ab1d881f4b6510b3de2b86ae31b2f20b1deb3bc7132ad7617 | MATLAB | 4,722 | 157 | function varargout = seqlogoPmtk(p, ssCorr)
%% A replacement function for the bioinformatics seqlogo function
% Unlike seqlogo, this only supports nucleotides, i.e. ACGT, not amino acids
%% Input
%
% p - an nsequences-by-npositions character array of with chars
% A,C,T,G, or a profile matrix of the s... |
e10f328dd54cbf8b22c5a8b52e45e43abc47d7a8c3d94efc845921ac20cb34e0 | MATLAB | 4,722 | 142 | %KTENSOR Class for Kruskal tensors (decomposed).
%
%KTENSOR Methods:
% arrange - Arranges the rank-1 components of a ktensor.
% datadisp - Special display of a ktensor.
% disp - Command window display for a ktensor.
% display - Command window display for a ktensor.
% double - Conve... |
3cbadb8a02b707c6519e70ce882b26235b9d6d71d768c9b0e0c555a783abf444 | MATLAB | 4,725 | 174 | function toTrackOut = parseToTrackJSON(jsonfile,lObj)
jsonData = jsondecode(fileread(jsonfile));
assert(isfield(jsonData,'toTrack'));
res = jsonData.toTrack;
if iscell(res),
toTrack = res{1};
for i = 2:numel(res),
toTrack = structappend(toTrack,res{i});
end
elseif isstruct(res),
toTrack = res;
end
nviews... |
8288c4c5fa72db341133e3cbdbb7ef80de600fdaf6c7a8805534c2dcd4942fcd | MATLAB | 4,725 | 131 | %% Try to reproduce table 18.1 from "Elements of statistical learning" 2nd edn p656
% PMTKauthor Hannes Bretschneider
% PMTKreallySlow
%% Load data
% This file is from pmtk3.googlecode.com
loadData('14cancer') % Xtrain is 144*16063, Xtest is 54*16063
ytrain = colvec(ytrain);
ytest = colvec(ytest);
% on p654, they sa... |
219653e85a1241a9f740160d15da7490260cd0b220569d3786fde0c7af23e866 | MATLAB | 4,727 | 134 | function browse_simpleFFT(cfg, data)
% BROWSE_SIMPLEFFT is a helper function for FT_DATABROWSER that shows a
% simple FFT of the data.
%
% Included are a button to switch between log and non-log space, and a
% selection button to deselect channels, for the purpose of zooming in on
% bad channels.
%
% See also BROWSE_M... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.