sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
11f5fc70bb7144da067eb35f02960056bed2c1efb347619c7423d8c8db4d5544 | MATLAB | 12,094 | 254 | function rotatedUnitVector = rotVecAroundArbAxis(unitVec2Rotate,rotationAxisUnitVec,theta)
%% Purpose:
%
% This routine will allow a unit vector, unitVec2Rotate, to be rotated
% around an axis defined by the RotationAxisUnitVec. This is performed by
% first rotating the unit vector around it's own cartesian axis (... |
34c94a117105b4f5706b2b438359e1a996bd57ead906bf1cccb8900b650cb89e | MATLAB | 12,100 | 300 | classdef NormalizedDerivedFeatures < dspace_features.AbstractDerivedFeatures
% These coordinates are computed from the parent coordinates by element-wise
% normalization.
%
% Depending on the parent-coordinates dimension can be fixed or variable.
%
% Normalization Modes
% -----------... |
76c2759c074441ef48acfff39f461e2c3f1863caf5aa3f8dd991807de82eba48 | MATLAB | 12,105 | 296 |
clear all
close all
folderList = [{'week2'},{'div19'},{'week4'}];
populationList = [{'NS'},{'8020'}, {'5050'}];
cd('/Volumes/Elements/spring2022/final/')
load('idx_cell.mat')
SpikeFeature = {};
SpikeShapePop = {};
TotCountSpike = {};
FeaturePopulation = {};
AmplitudePopulation = {};
for ff = 1: length(folderList)
... |
63e1552d166b965c403f0e7f9dc7f0301845114ea3e25769d1f58391d2197243 | MATLAB | 12,106 | 306 | function res = saveastiff(data, path, options)
% options.color
% : true or FALSE
% : If this is true, third dimension should be 3 and the data is saved as a color image.
% options.compress
% : 'no', 'lzw', 'jpeg' or 'adobe'.
% Compression type.
% 'no' : Uncompressed(Default)
% 'lzw' : lossles... |
e22724f49aa4dcbd609cfe7529d738de90f54e445570d2b6ab077d6e3af77fb8 | MATLAB | 12,109 | 386 | % TrioEEGBehMicrosaccades2
% check for corrleations between microsaccade number / drift speed and the
% 3 behavioural metrics
% and maybe also with CNV
clc;clear all; close all;
%% correlate with behaviour
% load up beh
load('TrioEEGBehAnalysis.mat', 'vars','varNames'); %[pp cond4 drug tr]
%% load up ready2, which h... |
321673d71d06bbed7c7ec335ea92693627a6d1945a3aeefe7473b324fe286985 | MATLAB | 12,112 | 341 | function [source] = ft_datatype_source(source, varargin)
% FT_DATATYPE_SOURCE describes the FieldTrip MATLAB structure for data that is
% represented at the source level. This is typically obtained with a beamformer of
% minimum-norm source reconstruction using FT_SOURCEANALYSIS.
%
% An example of a source structure o... |
87a0a9adf96dacdbb2d8a2ae67fbe3073900c4d7244d5974e24bc8abf3b6e8a7 | MATLAB | 12,114 | 244 | % CalculatePawVelocity.m
% Sarah West
% 7/22/22
% Calculates paw velocity from DeepLabCut position extractions saved as
% Matlab matrices. Runs with RunAnalysis.
% Inputs: parameters.data -- matrix of extracted DLC data.
% parameters.columns_to_use -- structure with fields for each body
% part, with va... |
696bcf2130668e8a54dd3d30940c222f266a300fec03eac40661f16f1f94a3ee | MATLAB | 12,119 | 331 | % HIFIE3_BASE Dispatch for HIFIE3 and HIFIE3X.
function F = hifie3_base(A,x,occ,rank_or_tol,idfun,pxyfun,opts)
% set default parameters
if nargin < 6, pxyfun = []; end
if nargin < 7, opts = []; end
if ~isfield(opts,'lvlmax'), opts.lvlmax = Inf; end
if ~isfield(opts,'ext'), opts.ext = []; end
if ~isfield(... |
941a2a41f2492d027e963c06618dfad1a8f5b8865f66f7514d7ec9e6b8541e38 | MATLAB | 12,121 | 325 |
% breakxaxes splits data in an axes so that data is in a left and right pane.
%
% breakXAxes(splitXLim) splitXLim is a 2 element vector containing a range
% of x values from splitXLim(1) to splitXLim(2) to remove from the axes.
% They must be within the current xLimis of the axes.
%
% breakXAxes(splitXL... |
81e06f67634d696179f01280cf538a7c03a7ff5ae6c57ece0672d51d4f72dc04 | MATLAB | 12,128 | 340 | function tests = test_VBA_random
% Unit Tests for VBA_random
tests = functiontests (localfunctions);
% -------------------------------------------------------------------------
function test_arbitrary (testCase)
K = 3;
p = rand (K, 1);
p = p / sum (p);
vals_1 = 'abc';
vals_k = ['ab'; 'cd'; 'ef'... |
48760926aeb92ad51122934dd10d2f0706dbe0c5b642a0a91d5e8bfcd7b5d3c8 | MATLAB | 12,129 | 346 | function t = subsasgn(t,s,rhs)
%SUBSASGN Subscripted assignment for sparse tensor.
%
% We can assign elements to a sptensor in three ways.
%
% Case 1: X(R1,R2,...,RN) = Y, in which case we replace the
% rectangular subtensor (or single element) specified by the ranges
% R1,...,RN with Y. The right-hand-side can... |
50d98fa593fbe281960d55b79dd9a46d7c9760e5535e091a51fb0f1c3b8375b5 | MATLAB | 12,133 | 265 | % Calculate a reference "rigid body" for the relative positions of the head
% coils, to deal with head coils possibly falling off, or moving, and to
% later calculate movement amplitude based on whole head volume, not simply
% at coil locations. Also plot inter-coil distance deviation from start
% and stable interval ... |
7a4af4c363d855e9961d8d925fe53f4e92a455fcb37b01881debe7eadd13de21 | MATLAB | 12,135 | 374 | % This script separates the images for each freqband
addpath C:\code\spm12
addpath C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Neuromodulation - PROJECT ECoG Atlas Connectomics (1)\functions;
addpath C:\code\wjn_toolbox
spm('defaults','eeg')
%% Load Table
clear all
%%
load('E:\ECo... |
89ab711adec1f333ed345b1d4706ccab5b39187ec928398d055a318b0a77e198 | MATLAB | 12,143 | 368 | %% =====================================================================
% This code produces supplementary simulation results and figures for the
% manuscript "A Computational Framework for Understanding the Impact of
% Prior Experiences on Pain Perception and Neuropathic Pain" by authors
% Malin Ramne (Chalmers Un... |
cfb7e1ea7fbcfb89884179aa0ce8be0c25626276070bdc0821f619e717ee2f49 | MATLAB | 12,143 | 297 | classdef radialEdgeDetector < surfaceDetection.surfaceDetector
% Surface detection based on thresholded radial derivative with pre-
% and post processing to get a cleaner result
%
% First reduces the background, then computes cylindrical radial Gaus-
% sian derivative. Instead of finding the maxima... |
d6ae39d71edb613ded7bb60885db60bc0a2f4fd12336cae5b480a3f4cef7325f | MATLAB | 12,150 | 236 | % WITHIN FIELD ANALYSIS
% Code to extract area under the curve (AUC) for each place field, and to
% detect place cells with multiple fields
% INPUT:
% method: 'wcorr'(default) or 'spearman'.
function within_field_analysis(method)
load('X:\BendorLab\Drobo\Neural and Behavioural Data\Rate remapping\Data\folders_to... |
064279b61b67b16e41efb74a6c2e934ebc9a8feaab8f872e63a9d69d7553e8a6 | MATLAB | 12,159 | 369 | function PlotPopulationERAs(config,varargin)
%%
if strcmp(mfilename,'') || nargin==0
opts=Analyze.Libet.opts_BasicLinearModel;
else
opts=feval(config,varargin{:});
end
if ~exist(opts.ERADir,'dir'); mkdir(opts.ERADir); end
% Get necessary fields from opts and stuff.
PanelCondNames = opts.ERAPanelC... |
1bfcb3ee288f66fd40a171bcc67a6360e300e9810f9ba8e323e8a1bcb01a720e | MATLAB | 12,159 | 378 | function CorrMatrixAction(Labels,DecodeLabels,OutDir,Tag,varargin)
% Plots confusion matrix (decode analysis) for decoding each (relevant)
% condition.
% [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh',0.001);
[~,Pmethod] = Utilities.ProcVarargin(varargin,'Pmethod','fdr');
[~,Phase] = Utilities.ProcVar... |
a5a24294973d21762e0d531b4c75f918149c440aa26e7ebf3ac8969c6aacd365 | MATLAB | 12,159 | 299 | function CBIG_preproc_QC_greyplot( fmri_file, FD_file, DV_file, output, varargin )
% CBIG_preproc_QC_greyplot( fmri_file, gm_mask, FD_file, DV_file, output, varargin )
%
% Inputs:
% - fmri_file:
% The filename of fmri image (full path).
% E.g. '<path-to-image>/Sub0001_Ses1_bld002_rest_skip4_stc_mc_resi... |
87251c8a83549178bcaf9aab0639050abe0f090d174b6a843647815d1714a83f | MATLAB | 12,167 | 464 | function [dips,c,res_out,c_theo,a,k,astart]=dipole_fit_cs(c,forwpar,ndip,xtype,astart)
% usage: [dips,c,res_out,c_theo,a,k]=dipole_fit_cs(c,forwpar,ndip,xtype,astart)
%fits a dipole model to the measured covariance matrix c
% (In general c is a complex cross-spectrum.)
% The fit is done with a random initial guess. Yo... |
4bfa34380d643e123918f61f04c692f58dfe93b7a6bf47f39bf8aaab49b9ee63 | MATLAB | 12,169 | 381 | netfile = 'mnist_custom-spiraldatalin4.h5multislm_240105180920.h5';
wnorms = [0.35 0.35 0.35];
info = h5info(netfile);
net0b = h5read(netfile,['/' info.Datasets(1).Name])*wnorms(1);
net1b = h5read(netfile,['/' info.Datasets(2).Name])*wnorms(2);
net2b = abs(h5read(netfile,['/' info.Datasets(3).Name])*wnorms(3));
... |
58003f182f790b75187418ed81ff36a795420120e53131c1b3f99fe1485d6374 | MATLAB | 12,178 | 259 | function [] = Twave_personalisation_POMs_ToRORd_not_converged(nb_models, celltype, stimAmp, stimulus_function_str, result_dir)
% Population of models generation for T-wave personalisation
% Adapted from scriptDemonstration_2_ParameterComparison.m:
% TODO: rename all endo_ variables to not say endo_
%% S... |
397c21acf667efbdc62601c82e27c1ed1014504a9534fbea6a1256b9e051ca1c | MATLAB | 12,179 | 259 | function model = getOpticalMediaProperties(model,simType)
G = model.G;
mP_fH = G.mediaPropertiesFunc(G.mediaPropParams);
[uniqueMedia,~,M_trim] = unique(G.M_raw);
M_trim = reshape(M_trim,model.G.nx,model.G.ny,model.G.nz);
mP_fHtrim = mP_fH(uniqueMedia);
nM = numel(mP_fHtrim);
if numel(unique({mP_fHtrim.na... |
a3f05e85dcd6314685fab192e37125bfe3a60d5452b4b7ebf53823cd5443b96d | MATLAB | 12,182 | 412 | function LAN = lan_epoch(LAN, cfg)
% v.0.5
%
% 13.08.2014 fix Bug in the segmegtation of contiuos data for new zero
% format
% 06.08.2014 fix new time thridt columns and tf segmentations
% 01.04.2014
% 07.01.2013
if nargin == 1, cfg= []; end
condition = getcfg(cfg,'condition',2);
tf = getcfg(cfg,'freq',false... |
1cf18bb7a7028abaa615faeedd5d9c32f885e9ad6bc6f70ae66e165019780018 | MATLAB | 12,185 | 506 | function [LAN] = lan_check(LAN,op,place)
% v.1.1.9
% <*LAN)<|
%
% if op= 1 delete incorrected and no-accepted trials
% if op is a string that can contain
% ~V : no muestran ningun aviso (default: V muestra los avisos)
% ~D : no borra incorrecto ni no aceptados (default)
% D : borr... |
6dd9217795835101fac82b953723d3b137336ab1d35a2380adfb8572b9aaa732 | MATLAB | 12,207 | 205 | %% Gr5aStimImaging
%% Script to analyze and record in struct array for Gr5a stim or other similar experiments
% This works with folder arrangement as in gr5a or behavior experiments,
% superfolder/ genotype folder / fly 1 / trial1 /
subFolders = dir(pwd);
realSubFolders = subFolders([subFolders.isdir]')... |
5be15fcb12d6aa80e3d8e25586d534575aaa8ce81d514fde8efbf4ef0d55516f | MATLAB | 12,212 | 326 | function [varargout] = ft_headmovement(cfg)
% FT_HEADMOVEMENT creates a raw data structure, or cell-array of datastructures
% containing the HLC-coil data, which have a grad structure that has the
% head position information incorporated.
%
% Use as
% data = ft_headmovement(cfg)
%
% where the configuration should co... |
7ff0d1c60e8bb47dfd0a8ba8cbf00e6d5758ebbcb22a4543e9cee078b707b331 | MATLAB | 12,214 | 302 | %% computeSDO_populateSDOArray
% Given supplied point-process and time series data sets, compute the
% stochastic dynamic operator for every supplied combination.
%
% Hardfork update to actually pass in the xtDataCell and ppDataCell classes
% directly; making the evaluation more straightforward and function-calls
% cl... |
0798e84b6c035e76b28cb73bc0447fd17fcd3fd69ed2a09f30d1f44ccdcff63a | MATLAB | 12,221 | 292 | function [J,data] = jacobian_stnd_FD(mesh,varargin)
% JACOBIAN_STND_FD Calculates spatial distributions of sensitivity of
% field registerd on the mesh boundary to changes of optical properties
% per mesh node. This function is specialized to be called for NIRFAST
% meshes of 'stnd' type (single wavelength).It de... |
430fa61ddafd2b0bf1fc707b166f122f18f5e150f0cdbc8f17d2af6cb462b08c | MATLAB | 12,223 | 331 | function index = mp4_read_index(filename)
% Read a seek index for an ISO base-media file (.mp4/.mov/.m4v) by traversing
% its container metadata, without decoding any frames. Returns a struct with:
%
% nframes - number of frames (samples) in the first video track
% timescale - media timescale, in... |
df543787168de7b79773f4e5a273adbed4355d2c7211c3636ff1e6d17260c312 | MATLAB | 12,230 | 334 | %% Check the output of NNMF
for t=1:num_groups
clear actual_index;
cluster_map = zeros(16,64);
actual_index = big_list_indexes{t};
avg_gamma_raster(t,:,:)= mean(trials_aligned_STD(:,:,actual_index),3);
for k=1:length(good_chan)
chan = good_chan(k);
cluster_map(mod_elecX(chan),... |
df17a80bce55304fd253d8512e0d8c195de2874ab881b9945e9eae1db9ac8da7 | MATLAB | 12,238 | 207 | function PARAMS = process_Prototype( subjectName, subjectID, scanNum, scanNumAnat, protoRun )
% (c) Coraline Rinn Iordan 09/2017, 10/2017, 02/2018, 04/2018
%
% Prototype run has 341 TRs total -- 335 TRs after preprocessing ; used: 49 samples @ 1 TRs / sample = 49 TRs
if nargin < 4, error( 'Must provide subject name, s... |
e1efc5bfd8bdd14a06febb809c0377cc9ea00e6eafba7d921c79a90fff2f92ee | MATLAB | 12,244 | 304 | function [coord_snapped] = warp_dykstra2012(cfg, elec, surf)
% WARP_DYKSTRA2012 projects the ECoG grid / strip onto a cortex hull
% using the algorithm described in Dykstra et al. (2012,
% Neuroimage) in which the distance from original positions and the
% deformation of the grid are minimized. This function relies on... |
1764c24fd5abbc3d1d3e210fed7ed70d4946bd0db820407250b797d509ef7f88 | MATLAB | 12,248 | 346 | % preprocessing.m
% Sarah Wests
% 8/24/21
% This is happening all in the same code to reduce the amount of data being
% saved in intermediate processing steps. THIS CODE DOES:
% 1. Reads the data tiffs in as matrics.
% 2. Separates data into blue and violet channels.
% 3. Registers within-stack/across stacks within... |
493886bb086dcc8378173c5083d2b4c5410338e6d93c181d4a2d128c12b7a3d7 | MATLAB | 12,252 | 345 | function [source] = ft_datatype_source(source, varargin)
% FT_DATATYPE_SOURCE describes the FieldTrip MATLAB structure for data that is
% represented at the source level. This is typically obtained with a beamformer of
% minimum-norm source reconstruction using FT_SOURCEANALYSIS.
%
% An example of a source structure o... |
bdb7e86f67e93d6261ed9adbdbdd1fa1b06b4f37a1ff45ac16ac8c951958b643 | MATLAB | 12,256 | 304 | function net = init_rnn(layer_size, g_by_layer, layer_type, objfun, varargin)
% layer_size = [dim_in dim_rnn dim_out]. Input, recurrent, and output
% layer are denoted by 'u', 'r', and 'z', respectively. The corresponding
% weight matrices are denoted by Wru, Wrr, and Wzr.
nlayers = 3;
assert(length(layer_size) == nlay... |
319ce8f78466fd1fe23b153fd751ea1b7bb1ddbf078248121fbeec84de2171bd | MATLAB | 12,257 | 298 | % This version of puncta extraction uses the solution written by Zachary
% Chiang in the Payne, Reginato and Chiang 2020 In Situ Genome Sequencing
% The original code can be accessed here:
% https://github.com/zchiang/in_situ_genome_sequencing_processing
loadParameters;
% The core idea is instead of amplifying puncta... |
167951177cb52d37034b06571488b16f58e2b4ad9ded9c9adcdae0da779b578b | MATLAB | 12,258 | 285 | function CBIG_ASDf_check_example_results(output_dir, log_file)
% CBIG_ASDf_check_example_results(output_dir, log_file)
%
% This function compares the output after you run the example code with the
% reference output to ensure that you have properly downloaded codes in
% Tang2020_ASDFactors and the example code works fi... |
0a56d97ffecbd02406ee6d31ff57adc212e2cea11ff7539e7c5ebd4aed318ddc | MATLAB | 12,261 | 452 | function H = hatchfill(A,STYL,ANGLE,SPACING,FACECOL)
%% HATCHFILL Hatching and speckling of patch objects
%% HATCHFILL(A) fills the patch(es) with handle(s) A.
%% A can be a vector of handles or a single handle.
%% If A is a vector, then all objects of A should
%% be part of the same group for predictable resul... |
a374caf8e2876eb587072275e3f5cd1c2ebd2951b530b0eabd520b141d5f8962 | MATLAB | 12,268 | 320 | function varargout = DPABI_T1ImgDefacer(varargin)
% DPABI_T1ImgDefacer MATLAB code for DPABI_T1ImgDefacer.fig
% DPABI_T1ImgDefacer, by itself, creates a new DPABI_T1ImgDefacer or raises the existing
% singleton*.
%
% H = DPABI_T1ImgDefacer returns the handle to a new DPABI_T1ImgDefacer or the handle to
%... |
b6ec2ea3dd7a3938f21c75b3bb439cdb0981be3fca74ffb976b5b79cc6985483 | MATLAB | 12,282 | 266 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Thalamic spindles and Up states coordinate cortical and hippocampal
% co-ripples in humans
%
% Dickey et al. 2024
%
% Compute and compare probabilities of co-occurring cortical ripples
% ("co-ripples") for the following conditions:
% (... |
bd52615e2c744bbd62fdfba088d3373b3bb1c02fa5bb59877f7dab039c9eaeb0 | MATLAB | 12,291 | 309 |
% demo_flashed_gratings
% add repository path to MATLAB path
addpath(genpath('..\subunit_grid_model'))
%%
% set experiment folder
expfolder = '20201112_252MEA_mouse_left_half_dorsal';
% load data from selected experiment
expdata = load(fullfile('..\subunit_grid_model', expfolder, 'expdata.mat'));
% grating flash... |
74e64ed62ce2bf835dc85b96117fa5e250244eb3d451092cb9d6ba8f583a9154 | MATLAB | 12,293 | 399 | function compute3Dfrom2D_KB(savefile,frontviewmatfile,sideviewmatfile,kinematfile,...
frontviewtrkfile,sideviewtrkfile)
fprintf('Running compute3Dfrom2D_KB with inputs:\n');
fprintf('Front tracked points: %s\n',frontviewmatfile);
fprintf('Side tracked points: %s\n',sideviewmatfile);
fprintf('Calibration info: %s\n',... |
6f6fb0848d88ca1a3f24b700d47dc9a789893bf90225a897a3822c1c9cdc0495 | MATLAB | 12,297 | 320 | function varargout = DPABI_T1ImgAverager(varargin)
% DPABI_T1ImgAverager MATLAB code for DPABI_T1ImgAverager.fig
% DPABI_T1ImgAverager, by itself, creates a new DPABI_T1ImgAverager or raises the existing
% singleton*.
%
% H = DPABI_T1ImgAverager returns the handle to a new DPABI_T1ImgAverager or the hand... |
6fb561beb9cb126e68b422ca31634e33b3131a2471c1f61e4339c4b22411c989 | MATLAB | 12,303 | 239 |
RecordingNum=2
[OS,dc,compName,MatlabVersion,MatlabVersionYear,ScreenSize]=WhereAmIRunning(0);
SaveName=Recording(RecordingNum).SaveName;
StackSaveName=Recording(RecordingNum).StackSaveName;
ImageSetSaveName=Recording(RecordingNum).ImageSetSaveName;
ModalitySuffix=Record... |
c5f650f07a30a75b8b560c2cf6618d5492d8e5374604e8c552a6d024cfd4374f | MATLAB | 12,305 | 230 | function [cfg] = ft_topoplotTFR(cfg, varargin)
% FT_TOPOPLOTTFR plots the topographic distribution over the head
% of a 3-dimensional data representations such as time-frequency
% representation of the power or coherence spectrum.
%
% Use as
% ft_topoplotTFR(cfg, freq)
%
% The input freq structrure should contain a ... |
1dc085d1e91ffe518a5b44fd98ced568b3eabcd39932b674cd4c0b271b958b83 | MATLAB | 12,307 | 599 | %load data: contact lead author
%%
r1=[25:28];
nr1=setdiff([1:1:42],r1);
r2=[49:52];
nr2=setdiff([1:1:66],r2);
percentMouse=[];
percentMouseS=[];
for mouse=1:6;
df2 = cueDfofs{mouse, 1}';
df1 = cueDfofs{mouse, 2}';
rdf1 = df1(:, r1); rdf1 = nanmean(rdf1, 2);
nrdf1 = df1(:, nr1); nrdf1 = nanmean(nrdf1, 2... |
2e32989e88313b4573b2937495601b34cdaee46246d59a192426b8cea934d218 | MATLAB | 12,312 | 332 | function [Data] = tom_mrcread_tmp(varargin)
%TOM_MRCREAD reads MRC format file
%
% tom_mrcread(varargin)
%
% i=tom_mrcread
% i=tom_mrcread('Proj.mrc');
% i=tom_mrcread('Proj.mrc',Endian);
%
% Reads a 2D or 3D MRC format file. A MRC format contains a 1024 Bytes
% header and the raw data. If there is no input... |
a7462881b5f8eb9fdfd355c68ba0566edb95a0dfe97a34969d0845949c702842 | MATLAB | 12,320 | 318 | function concatenate_dats(basepath,varargin)
%
%
% [concatenate_dats - Concatenate raw .dat files found in a session folder
% for intan type recordings]
%
% [ALGORITHM OUTLINE: looks for .dat files in a folder (or in subfolders) to
% concatenate together. The concatenation happens via system commands
% ("cat" comma... |
13ff435e69057a340d58bcf5fc5661de22ce2f724fabbd9baf3704e40d3da30d | MATLAB | 12,322 | 408 | %% callAfilter (V2)
% A list of generic filtering methods to smooth timeseries data. Contains
% filters which operate in either the time or frequency domain. Some of
% these are redundant w/ the standard DSP toolbox, but are included for a
% commonality of utility
%
% Upgrade to ffxt from filtfilt to reduce ringing art... |
ce41b9dce0244c0c7a67c496a12af92b3d88c89885051adcccfd70656d21da2b | MATLAB | 12,333 | 329 | function X = palm_miscread(filename,varargin)
% Read various scalar data formats based on the file extension.
%
% X = palm_miscread(filename,useniiclass,tmppath,precision,mz3surf);
%
% filename : File to be read.
% useniiclass : True/False. For NIFTI files, use the NIFTI class
% when reading them. It r... |
9e8aeaeda3d0fc020d284bbbb86200481da086ac656b8467eed4cb5bc7099c14 | MATLAB | 12,337 | 422 | function LAN = net_syn_lan(LAN, par)
% V.0.0.0.
% 10.12.2009
%
%
%
% Calculate -> syncrony between electrodes througth hilbert transforms
% example:
% LAN = syn_hilbert_lan(LAN, par);
%
% parameters:
%-------------------------------------
% par{1} freq ; LAN.phase.cfg.net_freq
% par{2} time ; L... |
1add1bad442768809625037197a557058f669ffbbdb6010c3afbe2c8d6df7268 | MATLAB | 12,342 | 430 | function QRS=nqrsdetect(S,fs)
% nqrsdetect - detection of QRS-complexes
%
% QRS=nqrsdetect(S,fs);
%
% INPUT
% S ecg signal data
% fs sample rate
%
% OUTPUT
% QRS fiducial points of qrs complexes
%
%
% see also: QRSDETECT
%
% Copyright (C) 2006 by Rupert Ortner
%
%% This program is free software; ... |
d57b13014a2ce80ca9a964e584e2fb3c81a9577b41e84da682ab9ce255f287e0 | MATLAB | 12,353 | 299 | function [data] = femdata_spec_TR_moments(mesh, varargin)
% FEMDATA_SPEC_TR_MOMENTS Returns spatial distributions and boundary values
% of statistical moments or Mellin transforms of time-resolved data for
% the 'spectral' FEM mesh in NIRFAST format. This function generates
% sparse matrices representing the FEM ... |
111d7ae56a13804734878685b99a14a9e98461cfe9a43aff3b89a30694f4b933 | MATLAB | 12,371 | 372 | function [SleepScoreMetrics,StatePlotMaterials] = ClusterStates_GetMetrics(...
basePath,SleepScoreLFP,EMG,overwrite,varargin)
%StateID(LFP,thLFP,EMG,sf_LFP,sf_EMG,figloc,WSEpisodes)
% Detailed explanation goes here
%
%This function calucates the metrics for state scoring (EMG, Slow Wave
%Power, Theta). It uses Sl... |
24f1ae8890463d6e5b6a7df170fa0870530e5c6c304eb5ac73fd7b5de3838a28 | MATLAB | 12,378 | 413 | % Demonstrate classification/decision tree on 2d 3class iris data
% From http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/classdemo.html
requireStatsToolbox
% "Resubstitution error" is the training set error
%{
meas =
5.1000 3.5000 1.4000 0.2000
... |
56c3121196e9551a8c17ac5f6e7e9537d623fc141b76a7fe6e911a254d922a5f | MATLAB | 12,397 | 273 | function [fig, ax, properties] = ShowSubjectImplant(SubjectID, varargin)
% Get the channel map - will also error if invalid SubjectID
ChannelMap = LoadSubjectChannelMap(SubjectID);
% Set defaults
ArrayColors = SubjectColors(SubjectID);
SubjectLabelColor = SubjectColors(SubjectID);
RegionLabelCol... |
d00fbe76659e202bed705c7e14feeed19a8160813cda62aab7eea9b91ab9a1bd | MATLAB | 12,403 | 341 | function File = nc_GetFullPath(File, Style)
% GetFullPath - Get absolute canonical path of a file or folder
% Absolute path names are safer than relative paths, when e.g. a GUI or TIMER
% callback changes the current directory. Only canonical paths without "." and
% ".." can be recognized uniquely.
% Long path names (>... |
62645ec224231af52b896f8ca62b46b7a47ba82fca5896d96e85410d1716e600 | MATLAB | 12,407 | 301 | classdef fastCylinderDetector < surfaceDetection.surfaceDetector
% Detect surface by maximal cylindrical radial derivative
%---------------------------------------------------------------------
% license
%---------------------------------------------------------------------
% Copyright 2015 Ids... |
c88850f5f0a06978d24cd026ab306c61c896e51477325cc78b4aebc1661724ea | MATLAB | 12,417 | 320 | function figure_spinalSEP_digits(condition, subjects)
% set path
savepath_ga = getenv('GADIR');
% condition info
srmr_nr = 2;
cond_info = get_conditionInfo(condition, srmr_nr);
cond_name = cond_info.cond_name;
nerve = cond_info.nerve;
if nerve == 2
fname = [savepath_ga 'amplitudeAndLatency_allSubjects.mat'];
... |
23a23280a24f9a69cb057c20a201a8667f176e0e2f1493a66654756b20a3921e | MATLAB | 12,420 | 323 | function M = fixedrankembeddedfactory(m, n, k)
% Manifold struct to optimize fixed-rank matrices w/ an embedded geometry.
%
% function M = fixedrankembeddedfactory(m, n, k)
%
% Manifold of m-by-n real matrices of fixed rank k. This follows the
% embedded geometry described in Bart Vandereycken's 2013 paper:
% "L... |
d7e6328b8666a5adecd6f41186046e001c1fc1ffa563d4318abc7f8d0e4a2862 | MATLAB | 12,422 | 231 | function [cfg] = ft_topoplotTFR(cfg, varargin)
% FT_TOPOPLOTTFR plots the topographic distribution over the head
% of a 3-dimensional data representations such as time-frequency
% representation of the power or coherence spectrum.
%
% Use as
% ft_topoplotTFR(cfg, freq)
%
% The input freq structrure should contain a ... |
61b1d31df075a1000716fd5cb9a956b16af38709741ea88dfd3ff690c91465fc | MATLAB | 12,424 | 268 | %{
Copyright (c) 2025 Axion BioSystems, Inc.
Contact: support@axion-biosystems.com
All Rights Reserved
%}
classdef ContinuousDataSet < DataSet
properties (GetAccess = public, SetAccess = private)
DataSetNames;
Duration;
end
methods
function obj = ContinuousDataSet(varar... |
5cc3c13fc12df8dd04e05131c08a6e84d5eb6ae913c1f4977854ff1b7e3d9eae | MATLAB | 12,426 | 377 | function makeSSVEPStim(run)
%% run setup
% run = 3;
saveStim = 1;
saveFigs = 1;
%% file i/o
stimDir = 'stimuli';
stimFile = sprintf('taPilot%d', run);
%% screen setup
displayName = 'meg_lcd';
d = loadDisplayParams(displayName);
pixelsPerDegree = 1/d.pixelSize;
screenWidth = d.numPixels(1); % (px)
screenHeight = d.nu... |
71179b54f16502abcb8fcc790f88339971b88ef1e973f01404402b18f96e25c2 | MATLAB | 12,439 | 373 | function [x y pos trials map mapping] = getBehavEvents_with_Z(pos,bins)
if pos(1,1) == 0 & size(pos,2) < 6
%% old code for LED tracking
pos = [pos(:,2:5),pos(:,1)];
% assumes colomns 1/2 and 3/4 match
scatter(pos(:,1),pos(:,2),'.r')
hold on
scatter(pos(:,3),pos(:,4),'.b')
axis([0 500 0... |
2c1b67b69376438540225cea9f3a111c30430ab5f56f909fed2038a88740eb44 | MATLAB | 12,443 | 438 | function [varargout] = y_rdir(rootdir,varargin)
% RDIR - Recursive directory listing
%
% D = rdir(ROOT)
% D = rdir(ROOT, TEST)
% D = rdir(ROOT, TEST, RMPATH)
% D = rdir(ROOT, TEST, 1)
% D = rdir(ROOT, '', ...)
% [D, P] = rdir(...)
% rdir(...)
%
%
% *Inputs*
%
% * ROOT
%
% rdir(ROOT) lists the sp... |
53e6922e14279af173015233ede0280c0755821f37102935073e8f87ed6b7c89 | MATLAB | 12,444 | 366 | function crossfreq = ft_crossfrequencyanalysis(cfg, freqlow, freqhigh)
% FT_CROSSFREQUENCYANALYSIS performs cross-frequency analysis
%
% Use as
% crossfreq = ft_crossfrequencyanalysis(cfg, freq)
% crossfreq = ft_crossfrequencyanalysis(cfg, freqlo, freqhi)
%
% The input data should be organised in a structure as ob... |
3d5c70c0915e615583ca72cd544296c5b0ef65a3b5e18122d5b5d89c11814adf | MATLAB | 12,448 | 251 | % MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
%
% Description:
% This script loads data from specified Excel sheets including musculoskeletal data,
% extracting muscle origin and i... |
b08cd8f4bc308ff22a950de9a415f25b5ab74c7bfb90ac6ea1a357a1119d7b3f | MATLAB | 12,452 | 369 | %% Non parametric Cluster-based permutation testing with Fieldtrip
% Test differences in HEP between LA and HA conditions
% Fieldtrip initialization
addpath(genpath('C:\Users\Antonin\Documents\MATLAB\fieldtrip-master\'));
warning('off', 'MATLAB:rmpath:DirNotFound');
rmpath(genpath('C:\Users\Antonin\Documents\MATLAB\sp... |
400db2ed3208dd41bbd34b345add774b78e1a9d1683362ef4338bc72ec0b19d5 | MATLAB | 12,458 | 358 | function CorrMatrix(Labels,DecodeLabels,OutDir,Tag,varargin)
% Plots confusion matrix (decode analysis) for decoding each (relevant)
% condition.
% [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh',0.001);
[~,Pmethod] = Utilities.ProcVarargin(varargin,'Pmethod','fdr');
[~,Phase] = Utilities.ProcVarargin(... |
b11a468874dddc7b26bf985078f6e067dfd122f86610cd2b66e34597dbe59766 | MATLAB | 12,467 | 515 | function COR2tableR(COR,cfg)
% <*LAN)<]
% v.0.5
%
% COR2TABLER write a table for R in a .txt file (one file per electrode)
% COR2TABLER(COR,cfg)
% cfg.where carpeta
% cfg.filename nombre del archivo
% cfg.electrode indice del electrodo
% cfg.format = 'txt', 'mat... |
28332a5011ca74c54d8dedf5b9e05bf48cb8be634fa63fc5923e4d85f5dc59fe | MATLAB | 12,475 | 345 | %% Identify motion sensitive neurons based on passive motion viewing task
thFRvis = 1;
load(fullfile(saveLoc, ['spk_S' num2str(1)]), 'par')
fi = 120; filtView = ones(1, fi)/fi;
t_vis = find(par.tsl >= 0 & par.tsl <= 0.08);
t_vis2 = find(par.tsl >= 0.05 & par.tsl <= 0.15);
t_ev = find(par.tsl >= 0.15 & par.... |
424b38c2b81e2781be6d9944cdbfa94d18faba987a08b899ef65f9a3cb055ba4 | MATLAB | 12,483 | 345 | classdef TempoPanel < handle
properties
panelType = ''
title = ''
titleColor = [0.75 0.75 0.75]
isHidden = false
end
properties (Transient)
controller
panel
axes
end
properties (Transient, Access = private)
... |
06500684124e539b2a629198991486c35540f880b07d9df7a417422013194ef4 | MATLAB | 12,485 | 310 | function CrossDecodeAnalysis(AllTrialData,Labels,DecodeLabels,TimeWindow,OutDir,Tag,varargin)
% Train on dim 1 to classify dim 2, test on how well it generalizes.
% e.g. train on nancy to diff bp, test how well bp diff'd in Tyson.
[~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh','fdr');
% [~,NIter] = Util... |
79d273b259771131beff3b91111f05132ea3f2733f7c539e3bde47d6f5078845 | MATLAB | 12,487 | 269 | function [pool] = HFO_Initial_Detector_DemoVersion(file,config,montage,converterConfig_file)
% [pool] = HFO_Initial_Detector(filename,montage,dataType,config)
% This Function is creating initial pool of HFOs using Amplitude threshold
% detction
if nargin ==3
converterConfig_file = [];
elseif nargin==2
... |
a0eea003eae5a57a2e55e13d7423df87492fd9cf6d26ef2658b01bea455d6642 | MATLAB | 12,503 | 308 | function [e,egrad]=affine_registration_error(par,scale,I1,I2,type,O_trans,Spacing,MaskI1,MaskI2,Points1,Points2,PStrength,mode)
% This function affine_registration_error, uses affine transfomation of the
% 3D input volume and calculates the registration error after transformation.
%
% [e,egrad]=affine_registration_... |
6e3073b75e6d733d1c6b99f7afb7d820b37fb737b70e3ac91f333c4d377ff54f | MATLAB | 12,504 | 324 | function lantoolbox(LAN)
%
% <*LAN)<]
% MAIN GUI
%
% v.0.0.3
% Pablo Billke
% 14.08.2015 add .set importation
% 9.03.2012
% 6.03.2012
global xLAN
global nameLAN
if (nargin == 0)
xLAN =[];
nameLAN='xLAN';
else
xLAN = LAN;
nameLAN = inputname(1);
end
%- temp in b... |
740b3f136f2bfe72eac5f728f4511bc71111ab496ab16f69d9ddcb8fe2cae676 | MATLAB | 12,512 | 191 | % Running a GLM analysis in Brainvoyager
% Each person has one regressor, including all of this person's name
% appearances during the task
%% Starting brainvoyager from Matlab
bvqx = actxserver('BrainVoyager.BrainVoyagerScriptAccess.1');
%% Defining working directories
subjects_analysis_dir = 'F:\Social_... |
d96b20b0996449bca6fdcbf600355f0fc74239a1828bc8967332d36a4deca041 | MATLAB | 12,514 | 177 | %% Description
% Here we demonstrate how to define beams using sourceType = 1, 4 or 5. The
% geometry is only air, which has negligible scattering and absorption. The
% farFieldRes input will be further illustrated in example 7.
%
% This example will execute five different simulations. Press any key with
% the command ... |
5c586d23eab59b2ef9fadd73e820c4ae03a706324c8d978efb97ee23660735e3 | MATLAB | 12,516 | 355 | function bz_MakeXMLFromProbeMaps(probemaplist, basepath,basename,plugorder,defaults)
%MakeXMLFromProbeMaps - Generate a .xml file to accompany .dat files for a
%recording in the neuroscope/klusters/ndmanager system. Uses a library of
%probe map layouts.
%
% USAGE
%
% MakeXMLFromProbeMaps(basepath,basename,ProbeFil... |
c3bc38f015af6e493f952818b5f94d49e7826370d2fc3406dc7b896f5fcff181 | MATLAB | 12,517 | 411 | function LAN = lan_sync_net(LAN,cfg)
% v.0.0.3.5
% LAN provisory function for syncrony network
%
%
% cfg.
% cfg.freq_method = 'Wavelet'
% cfg.algoritm = 'PLV'
% cfg.across ='trials'
% ='time'
% cfg.step = [ n ] % step to calculated syncrony across trail
% windows to calculate syn... |
3d0d398c7a7419eb06dd6ed0f732816f91a4e634422b90c01a7ab14718c24143 | MATLAB | 12,520 | 342 | function [ ] = makeGroupContrastMovie( save_path, control, clinical, varargin )
%MAKEGROUPCONTRASTMOVIE Make differences connectivity matrix movie
%
% makeGroupContrastMovie(save_path, control, clinical)
% makeGroupContrastMovie(save_path, control, clinical, 'ParameterName', _ParameterValue_)
%
% This function makes a... |
81df037c25a70ce2e8e67ae42c30ad1ec501f8435cf354c94df77b323dbabba5 | MATLAB | 12,521 | 397 | classdef LabelCoreSeqMAModel < LabelCoreModel
% Multi-animal sequential labeling model
%
% Labeling states: Accepted/Browse and Label.
%
% During Browse, existing targets/labels (if any) are shown. Selection of
% a primary/focus target can occur eg via targets table. When this
% occurs, non-primary targets are grayed. ... |
8dd431bc25ad3dfe32ed2fc4c262fd086f558495accd20561e52288bf5352e31 | MATLAB | 12,524 | 290 | % pipeline_motorized_treadmill_behavior.m
% Sarah West
% 11/16/21
% Use "create_mice_all.m" and "create_conditions_names.m" before using this.
%% Initial setup
% Put all needed parameters in a structure called "parameters", which you
% can then easily feed into your functions.
clear all;
% Output Directories
% C... |
1bbf7101cba9ee06601918e16fed987ddbd18ad660e0921e771345c888c2cff4 | MATLAB | 12,527 | 402 |
clear all ;clc;close all;
%%
fps=30;
trail=[];
date='0810';EN=[22 23 24];mouse='2';%2 4
% trail=[trail;loadtrail(date,EN,fps)];
date='0810';EN=[32 33 34];mouse='4';%2 4
% trail=[trail;loadtrail(date,EN,fps)];
date='0811';EN=[45 47 48]; mouse='7';%7 3 2
% trail=[trail;loadtrail(date,EN,fps)];
date='0811';EN=... |
d307983bad8f74a10ad6046803fd99d887d77f6ff03280412fcd0e3bcb5b3159 | MATLAB | 12,538 | 366 | function crossfreq = ft_crossfrequencyanalysis(cfg, freqlow, freqhigh)
% FT_CROSSFREQUENCYANALYSIS performs cross-frequency analysis
%
% Use as
% crossfreq = ft_crossfrequencyanalysis(cfg, freq)
% crossfreq = ft_crossfrequencyanalysis(cfg, freqlo, freqhi)
%
% The input data should be organised in a structure as ob... |
a00ce54f102f9760f56ceeabfe2999ef5cc356df0d43a76c1b655db16c8c9065 | MATLAB | 12,548 | 261 | function [ subjstructs, M ] = projectElectrodes( M, subjstructs, normway, interstype, intersval)
%PROJECTELECTRODES Project electrode grids onto a brain model.
%
% Projects the electrode grids (for every subject they are specified by
% a structure and the field of these structures builds subjstructs) onto
% ... |
1db79902223e25ce483c879841c99a4e6beed1871f39138f415ccdb947c76f12 | MATLAB | 12,550 | 296 | function [out] = read_ced_son(datafile,varargin)
% READ_CED_SON
%
% [OUT] = read_ced_son(DATAFILE,VARARGIN);
%
% Reads a analog and event data from a CED SON file
% (SON files are created by Spike2 software). Currently, only
% analog channels and event data can be read.
%
% Optional parameter Default
% 'read... |
184d48228ac3eeebfbe897ad155041bf1465009d787aa8cc54cbb4beb39191f7 | MATLAB | 12,552 | 413 | function [ovar] = humanbiz(hdata, varargin)
%humanbiz Analysis of behavioral data in compelled tasks
%
% [ovar] = humanbiz(hdata, varargin)
%
% Analyzes a matrix "hdata" with behavioral responses from the CS
% task, compelled antisaccade task, and others, to produce a standard
% set of outputs.
%
% Input... |
da782e6ba538ae9da6a764afb5c3601bc40cb14d9e8c471061cb0c1e5afe84cc | MATLAB | 12,556 | 278 | function [ROISignals] = y_ExtractROISignal(AllVolume, ROIDef, OutputName, MaskData, IsMultipleLabel, ROISelectedIndex, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header, CUTNUMBER)
% [ROISignals] = y_ExtractROISignal(AllVolume, ROIDef, OutputName, MaskData, IsMultipleLabel, RO... |
597ed64afe26b11473997311ef17b3ee8ae264e2e49d59a5ac33085f264ced18 | MATLAB | 12,557 | 439 | function col=cmap3(name,n)
% cmap3 -- create colormap
%
% [Input]
% -name:colorname
% -german
% -italy
% -french
% -cameroon
% -dango
% -green
% -pink
% -blue
% -
% -
%
%
%
%
%
%
% Created By Tomoyasu Horikawa horikawa-t@atr.jp 20... |
862ef98fbaf7055d41a50b30850f12462738e3894757b250b8c2c1ffddf75b27 | MATLAB | 12,557 | 434 | function col=cmap4(name,on)
% cmap3 -- create colormap
%
% [Input]
% -name:colorname
% -german
% -italy
% -french
% -cameroon
% -dango
% -green
% -pink
% -blue
% -
% -
%
% -on: reflect color for map
%
%
%
%
% Created By Tomoyasu Horikawa horikawa-t@a... |
a6ba058f59205f973d83786190311c0074fa7535f998c8e638e3be2a8f8eede0 | MATLAB | 12,563 | 299 | close all; clc
clear all; clc
% Analysis of photometry signals collected with Neurophotometrics FP3002
% Structure of raw data matrix:
% column 1: Frame counter
% column 2: Timestamp
% column 3: LED state
% column 4: Stimulation
% column 5: Output 0
% column 6: Output 1
% ... |
fe9422535d7637961f68323bbf65b3a132a3dc297ab2e1266a1798362c2602fb | MATLAB | 12,571 | 336 | function [pnt, ori, lab] = channelposition(sens)
% CHANNELPOSITION computes the channel positions and orientations from the
% coils or electrodes
%
% Use as
% [pos, ori, lab] = channelposition(sens)
% where sens is an electrode or gradiometer array.
%
% See also FT_DATATYPE_SENS
% Copyright (C) 2009-2012, Robert Oo... |
3ed2bae7ee46fcafc2530eacb83bdb6e2a3b3377d699fd35545e0d96e430a50f | MATLAB | 12,596 | 311 | classdef ilastikDetector < surfaceDetection.surfaceDetector
% Segmentation based on prediction maps from ilastik.
%
%
% options: channel : channel of the stack to use
% sigma : width of the Gaussian
% ssfactor : sub-sampling factor used in the ilastik
% cla... |
bac7ad7439f6b048fa40ebaa7ae007e36b4ec71b7265a64000ae70d45bb0eb70 | MATLAB | 12,598 | 291 | function varargout = h_spineAnalysis2GUI3(varargin)
% H_SPINEANALYSIS2GUI3 M-file for h_spineAnalysis2GUI3.fig
% H_SPINEANALYSIS2GUI3, by itself, creates a new H_SPINEANALYSIS2GUI3 or raises the existing
% singleton*.
%
% H = H_SPINEANALYSIS2GUI3 returns the handle to a new H_SPINEANALYSIS2GUI3 or the ha... |
01d3e76a0940b25439cf1e6fec8dd75d39afa821bd02764467dc4a8b4c3c1da9 | MATLAB | 12,609 | 287 | %% Simulations part 1: Sensitivity to different types of features
%
% Main script to run simulations to test which type of feature differences
% kernels are able to recover (state means or transition probabilities)
%
% Uses simulate_statemeans, simulate_transprobs, and
% simulate_transprobs_nostates
%
% Depe... |
76d74df755d5122b2d1e3dac5130f5ddf3ecec626e620b2ca1d6efa158e1f713 | MATLAB | 12,651 | 331 | % DELCODE-SAME, Table "demographics"
% _
% original paper: Soch*, Richter* et al., HBM, 2021
% Table 1: Demographics of young and older subjects
%
% DELCODE paper: Soch et al., medRxiv, 2023
% Table 1: Demographic information of participant groups
%
% written by Joram Soch <Joram.Soch@DZNE.de>, 26/09/2022, 15:05 (V... |
d25ea9d6e74df5d174cdc9a7ac2dd23c11486ca823da85a2a92ebcc1c6b83026 | MATLAB | 12,662 | 343 | %__________________________________________________________________________
% violin.m - Simple violin plot using matlab default kernel density estimation
%
% Updates:
% v2: extended for accepting also cells of different length
% v3:
% - changed varargin to parameter - value list
% - specification of x-axis vals... |
54ecdb2ba478bb427a3082bbf59042f644eb05a54a790c27dbda3b33674ac379 | MATLAB | 12,673 | 388 | function M = fixedrankfactory_3factors_preconditioned(m, n, k)
% Manifold of m-by-n matrices of rank k with three factor quotient geometry.
%
% function M = fixedrankfactory_3factors_preconditioned(m, n, k)
%
% This geometry is tuned to least squares problems such as low-rank matrix
% completion with ell-2 loss.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.