sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
fe130bb102c3619d8fdff38664e6e035cf5d125cae3f3895c371f95e7639f40d | MATLAB | 5,383 | 163 | function M = symfixedrankYYfactory(n, k)
% Manifold of n-by-n symmetric positive semidefinite matrices of rank k.
%
% function M = symfixedrankYYfactory(n, k)
%
% A point X on the manifold is parameterized as YY^T where Y is a matrix of
% size nxk. As such, X is symmetric, positive semidefinite. We restrict to
% full-r... |
5b2466648b2541dba620bcc1a350fd053d59ae216a3140dc121767d96254015a | MATLAB | 5,386 | 130 | function [MRSCont] = osp_LoadDATA(MRSCont)
%% [MRSCont] = osp_LoadSDAT(MRSCont)
% Reads Philips DATA/LIST files it is adapted from Gannet.
%
% Author:
% Dr.Helge Zoellner (Johns Hopkins University, 2020-10-02)
% hzoelln2@jhmi.edu
%
% Credits:
% This code uses the function
% loadRawKspac... |
d72b56942f6f3745d1bfee8347021f2e159629507e3d8467ce7808e4120a0e73 | MATLAB | 5,390 | 132 | function out = SY_PPtest(y, lags, model, testStatistic)
% SY_PPtest Phillips-Peron unit root test.
%
% Uses the pptest code from Matlab's Econometrics Toolbox.
%
% ---INPUTS:
% y, the input time series
%
% lags, a vector of lags
%
% model, a specified model:
% 'ar': autoregressive
% 'ard':... |
70300c2b1e62409478375f69046ea6a550b0d2a0bbe9ea0a966109649ec9f65a | MATLAB | 5,392 | 155 | function Batch_Reject_by_Threshold_Callback(hObject, eventdata, handles)
% hObject handle to Batch_Reject_by_Threshold (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Set the current call in the settings figure
if ~(isf... |
c49979bca2b19d9d92614910a4d5092e0d7f84db076b42c61176c5fb3b54b630 | MATLAB | 5,393 | 156 | % coreg_p.m
% dr. Peter Van Schuerbbeek, UZ Brussel (VUB), 2020.
%
% USAGE:
% [vol_mask] = coreg_nifti(in, vol_image, maskFile);
%
% DESCRIPTION:
% Creates a SPM volume containing a voxel mask with the same dimensions
% as the SPM volume containing a structural image. The voxel mask will be
% created with the geometry ... |
84621ba0323f1143aff4c76612bf0c6105a9e8659eccd9747860af035a98f08c | MATLAB | 5,394 | 136 | function ITIbyBlock = ITIbyBlock_males(m_ratlist, RatBehaviorData)
%Create variables
nback = 7;
prctile_cutoff = 98;
mrats = length(m_ratlist);
%create functions
block_avg = @(x, blocks) arrayfun(@(y) mean(x(blocks==y), 'omitnan'), 1:3);
block_err = @(x, blocks) arrayfun(@(y)...
std(x(blocks==y), 'omitnan')./sqrt... |
1a1ce02c5b15ff4b330af9a3f3070b13e5965bb95a1642a6bb68e8d864a72b13 | MATLAB | 5,395 | 119 | %% TestQSMMatrix - Tier 3 real-dataset QSM method regression matrix
%
% Runs the one-stop SEPIA pipeline on a real dataset (path supplied via
% sepiatest.get_real_dataset(), never hardcoded) once per QSM
% dipole-inversion method in methodQSMName (sepia_universal_variables.m),
% holding phase unwrapping ('None') and ba... |
6d3541acdd75e19c4bf24f9801e3d242452a4514dad3c86a2c47fc224bfd0563 | MATLAB | 5,396 | 210 | function [ps, fe] = tapas_ti_estimate(y, u, ptheta, htheta, pars)
%% Estimates the posterior probability of the parameters using MCMC combined
% with path sampling.
%
% Input
% y Saccade data.
% u Experimental input.
% ptheta Priors of the model
% htheta Kernel transformation.
% pars Paramete... |
287470d8fd0bfbeebae7db93f87807908b14f4d0321f409e97a9a42fce47ceef | MATLAB | 5,397 | 148 | function plot_learning_performance
close all
clear all
clc
% Plot the learning performance of control and APP-KI mice.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
load('behavior_learning_performance.mat');
correct_rate_control = learning_performance.control.learning_curve;
correct_rate... |
cdccb91dbbe9118a9d5bcb45f3b4f2f55956fb2709b261ea40e036657d8103ad | MATLAB | 5,397 | 131 | function fileArray = tapas_uniqc_get_filenames(cellOrString)
% Returns a cell of filenames given a regular expression, folder name, or
% file prefix.
%
% fileArray = tapas_uniqc_get_filenames(cellOrString)
%
%
% NOTE: if a cell of file names is given, a cell of the existing ones is
% returned; if a single file name i... |
17f9048e6a6b8c5d0706799cc545ef82dc3530251b08f6e1fdee2be41ed9d65e | MATLAB | 5,398 | 104 | %-----------------------------------------------------------------------
% Job saved on 14-Nov-2023 15:39:17 by cfg_util (rev $Rev: 7345 $)
% spm SPM - SPM12 (7771)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
%% load libraries, I think
run('set_library_paths.... |
4cd789d049f9badf98b56a508ecebad5b19e23d2527d8a443175782f7b6abb49 | MATLAB | 5,400 | 135 | function out = FC_LocalSimple(y, forecastMeth, trainLength)
% FC_LocalSimple Simple local time-series forecasting.
%
% Simple predictors using the past trainLength values of the time series to
% predict its next value.
%
% ---INPUTS:
% y, the input time series
%
% forecastMeth, the forecasting method:
% (i)... |
af547bc8a68b7809604ec7ba448c2c7461b8b3c077574bfa221a902a773ba411 | MATLAB | 5,407 | 125 | function [data, settings, ver] = readHD5(F)
% F: Key structure or full filename including path (for example '/path/Patchfile10.h5')
%
% data: all variables extracted from file
% settings: settings telegraphs from NPI amp
% ver: file version
if isstruct(F)
f = [fetch1(rf.Session & F,'file_base') num2str(fetch1(rf... |
3ed8849e791242681d5b4241c40ff40d76699046f5478901359d9ea22614cff3 | MATLAB | 5,410 | 159 | function low_rank_tensor_completion_embedded()
% Given partial observation of a low rank tensor (possibly including noise),
% attempts to complete it.
%
% function low_rank_tensor_completion_embedded()
%
% NOTE: Tensor Toolbox version 2.6 or higher is required for this factory:
% see https://www.tensortoolbox.org/ or h... |
5ceb2036a65f4202de072192ac8c9ea15aa2c2c598d81ec5446bc05c107a4cda | MATLAB | 5,410 | 157 | % QQDIAGRAM - Empirical quantile-quantile diagram.
%
% Description:
% The quantiles (percentiles) of the input distribution Y are plotted (Y-axis)
% against the corresponding quantiles of the input distribution X.
% If only X is given, the corresponding quantiles are plotted (Y... |
672f7a97ce13275a613427a3fedfc88f2c7d8fe1d9a9ab87f6001bf19deda1ce | MATLAB | 5,415 | 123 | %% h = sepia_handle_panel_clearswi(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other handl... |
405e43531bda59582e1cb9df2a3b80b914136d1688f838dfa15e255a1385a8a0 | MATLAB | 5,417 | 111 | function [] = save_data()
%% save_data saves data as an xlsx file
global info
global vals
info.analysis_selection = info.analysis_selection(~contains(info.analysis_selection, 'No Plots')); %Remove 'No plots' cell if present
if any(contains(info.analysis_selection, 'Final location relative to odor'))
info.analysi... |
ad2e1817dd02facf7ba300a0edc7a1742ac99f62e1e40c79f14d492d815089f2 | MATLAB | 5,417 | 116 | classdef MrUnitTest < matlab.unittest.TestCase
% Implements unit testing for all MrClasses
%
% EXAMPLE
% MrUnitTest
%
% See also
% Author: Saskia Bollmann
% Created: 2017-07-07
% Copyright (C) 2017 Institute for Biomedical Engineering
% University o... |
7d22ab1c2dd8d3eec6ae3a9951fd5f25df30323768a46116942562cf0712e950 | MATLAB | 5,418 | 135 | %% Analyze the results from Morris screening
clear; clc; close all;
%%
% For plotting, it can be useful to put all the parameter variable names
% here
Names = {'f11','f12','f13','f14','f21','f22','f23','f24', 'f31','f32','f33','f34' 'fs11','fs12','fs13','fs14','fs21','fs22','fs23','fs24', 'fs31','fs32','fs33','fs3... |
e2284a640570ea05a7ad642b84c22cdc4ed814319893146d6e89e52a21ad9fe2 | MATLAB | 5,418 | 157 | %% h = sepia_handle_panel_swismwi_dataIO(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global ... |
fb904029ba4a3ee29201d2af0369956bc969c0678a680c9378fad571fa2f2a72 | MATLAB | 5,420 | 167 | %% load rsa dataset
%% smooth and baseline correct
time = -3000 : 2 : 6000;
time(end) = [];
coh_corr = {similarity_over_coherences(:).coh_sig};
data_coh = cell2mat(coh_corr');
Bin = 50;
UnityVector= ones(1, Bin)/Bin;
for i = 1:size(data_coh,1)
SmoothedSignals_coh(i,:) = movmean(data_coh(i,:),B... |
67f3934c678023749a31161cf173d1129442c66db68d5f137e42de42b9d98cc0 | MATLAB | 5,425 | 188 | function [err] = TellAfni (cs, opt)
%
% [err] = TellAfni (cs, opt)
%
%Purpose:
% Drive AFNI
%
%
%Input Parameters:
% cs: An Nx1 vector of communication command structures
% It is obtained using NewCs structure
% opt: An optional options structure
% .QuitOnErr (0/[1]): Return from function if any of... |
b14e7c003a7037fdc1cb7549aaf7bc3c0f42d127b3c62c51690bba6c0f1b5a51 | MATLAB | 5,425 | 184 | % io_writeniimrs.m
% Georg Oeltzschner, Johns Hopkins University 2021.
% Adapted by
% Chris Davies-Jenkins, Johns Hopkins University 2022.
%
% USAGE:
% nii = io_writeniimrs(in, outfile, UserNames);
%
% DESCRIPTION:
% Takes MRS data in matlab structure format and writes it to a NIfTI-MRS
% file.
% See the specification... |
4c093bb3e362d35d1f1748ba9a48b5e047cbed65bea1863b67f25e6a3d7ad973 | MATLAB | 5,429 | 163 | function runSuppFigures(varargin)
% RUNALLFIGURES Generate all figures for the normalization paper
%
% Purpose:
% Main script to generate all publication figures with proper error
% handling and progress reporting.
%
% Inputs (optional):
% 'figures' - Array of figure numbers to generate (default: 1:6)
% 'parall... |
406bfd9c1b49518f030b1adc691e6f1ce1d23a767b3f3db6833bd71c85d3239e | MATLAB | 5,430 | 186 | function [u,OUT] = density_pdf(n,iterations,radius_mm,varargin)
%function [u,OUT] = density_pdf(n,iterations,radius_mm,[output filename],[mask_file],[opt] RESUME)
%
% given a brain mask and n coordinate points, this function computes
% a null hypothesis probability density function based on the number
% of iterations ... |
8d3d53a046f818edb9cf200d1728f13851abfb3ff3ae4140c944cb80e04aa414 | MATLAB | 5,433 | 168 | clc
clear all
clc
%% load rsa dataset
%% smooth and baseline correct
time = -3000 : 2 : 6000;
time(end) = [];
% load('Final_RSA_Outputs_delayed_bc.mat');
cond_corr = {similarity_over_conditions(:).cond_sig};
data_cond = cell2mat(cond_corr');
Bin = 50;
for i = 1:size(data_cond,1)
S... |
13b1b5f8d7ce90d40ac67b94082227c2301248c60ce066c19c0a259ce9f503e5 | MATLAB | 5,438 | 153 | function res = hlp_superimposedata(varargin)
% Merge multiple partially populated data structures into one fully populated one.
% Result = hlp_superimposedata(Data1, Data2, Data3, ...)
%
% The function is applicable when you have cell arrays or structs/struct arrays with non-overlapping
% patterns of non-empty entries,... |
2da4955391a3903eaac6e0b88dd5786b91c7fa2b4f0f603b0cb3e7d1b23c3fcc | MATLAB | 5,441 | 140 | function [y, iter, lambda, status] = minimize_cubic_newton(H, g, sigma, options)
% Minimize a cubicly regularized quadratic via Newton root finding.
%
% [y, iter, lambda, status] = minimize_cubic_newton(H, g, sigma, options)
%
% Inputs: a symmetric matrix H of size n, a nonzero vector g of length n,
% a positive real s... |
3194a81a80efa9689bd0241e78c63798d4d837a2a88de8f766085aaf512bcc69 | MATLAB | 5,442 | 189 | %% Part 3: Population dynamics
close all
clear all
load('Z:\CLOOSE_benchmark_tests\Volume_bci\DF_062424_NDNF_06_000_006.mat');
load('Z:\CLOOSE_benchmark_tests\Volume_bci\ROI_plane_062424_NDNF_06_000_006.mat')
load('Z:\CLOOSE_benchmark_tests\Volume_bci\ROIS_062424_NDNF_06_000_006.mat')
oneTrial_length = 435;
targetA... |
fc579893bd5347efc115c6972babae32d24cb0bd5a4b2c97f679126de4bb8cca | MATLAB | 5,442 | 106 | % STD_READERSP - load ERSP measures for data channels or for all
% components of a specified cluster. This function is
% also being used to read ITC and ERPimage data.
% Usage:
% >> [STUDY, erspdata, times, freqs, erspbase] = ...
% std_readersp(STUDY, ALLEEG, var... |
4b7a4e5e1c77fad26b2045fa5a2def40d8cfa1631c50d09cbcc7cd22abeb3517 | MATLAB | 5,444 | 263 | function cmap = get_clut2b2()
cmap = [0 1 13
0 2 20
0 3 27
0 3 33
0 3 39
0 4 45
0 5 51
0 6 57
0 9 63
0 9 69
0 10 75
0 12 81
0 12 87
0 13 93
0 13 99
0 14 105
0 15 111
0 15 117
0 18 123
0 21 128.9960938
0 24 134.9960938
0 26 140.9960938
0 29 146.9960938
0 32 152.9960938
0 35 158.9960938
0 38 164... |
5e448cbc416a0c6edf2899793ae8ea3cedc7ccd32447c3ca3877cda39a188eb3 | MATLAB | 5,444 | 129 | classdef MrAffineTransformation < MrCopyData
% Stores affine transformation for an image. Is disregarded during
% display.
% The order of the transformations follows the SPM convention: T*R*Z*S
% with T = translation, R = rotation, Z = Zoom (scaling), S = Shear
%
% Assumes that matrix always r... |
c1f40d71b7f3e3863db4ad4c4f1e0bd953d1f3f7158881b1d66c9fb9e35a51ff | MATLAB | 5,445 | 174 | function [f,p,ci,stats,tbl,dist] = permuranova1(x,varargin)
%PERMURANOVA1 Permutation-based one-way repeated-measures ANOVA and Friedman test.
% F = PERMURANOVA1(X) performs a balanced permutation-based one-way
% repeated-measures analysis of variance (ANOVA) for comparing the means
% of two or more columns of... |
aa7e8713a1020f4c2e32f21db50bf3578ad1beafe2e083e47d3cb3d98e1ec6ba | MATLAB | 5,447 | 162 | classdef nnsimplenn < nntest
properties
net;
x;
class;
end
methods (TestClassSetup)
function initNet(test, device)
test.net.layers = {} ;
test.net.layers{end+1} = struct('type', 'conv', ...
'weights', {{test.randn(5,5,1,20)/test.range, test.zeros(1, 20)}}, ...
'stride... |
b6d1a4c8bfab079d76f869ed9bb1394ca05752d9553a1575c14c8ddb42777a5d | MATLAB | 5,450 | 117 | function plot_spontaneous_activity_level
close all
clear all
clc
% Analyze spontaneous activity levels of individual neurons.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
low_thresh = -0.0275;
% Control.
load('activity_iti_control.mat')
% Initialize.
mean_mean_activity_iti_control_ani... |
8a87c8a1b9172644a04166880021a3f7371d7ab754e537248e125365274414a2 | MATLAB | 5,451 | 109 | function [u_hat,resMS,Sw_hat,beta_hat,shrinkage,trRR]=noiseNormalizeBeta(Y,SPM,varargin)
% function [u_hat,Sw_hat,resMS,beta_hat]=rsa_noiseNormalizeBeta(Y,SPM,varargin)
% Estimates beta coefficiencts beta_hat and residuals from raw time series Y
% Estimates the true activity patterns u_hat by applying noise normalizati... |
2a1e46eb0711df3d47fef59418c412ec643dabe930f7fc6219764025103c6b53 | MATLAB | 5,452 | 146 | function fear_evtTrigReactChamber_optShift(basename,varargin)
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
param.binSize=0.02;
param.halfWindow=5;
param.targetHC=3;
param.varName='evtTrigReactChamber_optShift';
param.saveFile=[basic... |
0029487bfffbd4b2041f4fba48299db9655cc16899ed27a0a635aa434dc63e6c | MATLAB | 5,454 | 175 | function [X,ndx] = natsortrows(X,col,xpr,varargin)
% Natural-order sort of the rows of a cell array of strings, with customizable numeric format.
%
% (c) 2016 Stephen Cobeldick
%
% Sort the rows of a cell array of strings, sorting the strings by both character
% order and the values of any numeric substrings that... |
21a5d7c31815ecb0b73166b8ddd69e3478f67c99668e18d4196b55a62b8abf79 | MATLAB | 5,454 | 124 | function M = diffusionTermTensor3D(D)
% This function discretizes a 3D diffusion term in the form
% \grad . (D \grad \phi) = M \phi
%
% Author: Aina Frau-Pascual, adapting code from diffusionTerm2D.m
% for its use with tensors
% extract data from the mesh structure
Nx = D.domain.dims(1);
Ny = D.domain.dims(2);
Nz = ... |
f80c2ab15314f6b166cb8cc6310ee68c7c1310c87e29713e1f78a5a14105ea28 | MATLAB | 5,455 | 141 | clear all
close all
clc
exp_root = 'C:\Users\User\Documents\fMRI_EXP\';
more_code = fullfile(exp_root, 'cells_data_muller');
data_folder = fullfile(more_code, 'wetransfer_neil-s-data_2023-09-25_1057');
addpath(genpath(more_code));
addpath(genpath(data_folder));
load('grid_animal4.mat')
env1_data = squeeze(cells_arra... |
e5b445c10f28d7237b2b19e9f920a80391a86eac3560470d339034cfd38a7614 | MATLAB | 5,456 | 152 | function events = LoadEvents(filename,opt)
%LoadEvents - Read events from file.
%
% USAGE
%
% events = LoadEvents(filename)
%
% filename event file name
% <options> optional list of property-value pairs (see table below)
%
% ======================================================================... |
3dcadf1c7d5990e03f4e66ef10ea30c48d2f5cc9cff1d69eb20681952fd6e5f7 | MATLAB | 5,458 | 125 | function L = defineSearchlight(Structures,Mask,varargin)
% function L = rsa.defineSearchlight(S,M)
%
% INPUTS
% Structures: Nx1 cell array containing the structures over which to
% estimate the searchlights. Structures can either be
% volumetric regions or surfaces. Voxel c... |
3cdd42c8cd80dc5300680f508753c41b4ac567bd8382b2b47832acccc31a51d4 | MATLAB | 5,463 | 192 | function [rgbMatrix, rangeOverlay, rangeImage] = tapas_uniqc_add_overlay(...
imageMatrix, overlayMatrix, overlayColorMap, ...
overlayThreshold, overlayAlpha, displayRange, verbose)
% Overlays image with and overlay in given colormap, output is RGB (colormap-independent)
%
% rgbMatrix = tapas_uniqc_add_overlay... |
a65348039a24691d48e6a809b9b2812ffa628e75599ac9ae0605d249e1b126ef | MATLAB | 5,463 | 135 | function [maps,data,stats] = RippleStats(filtered,ripples,varargin)
%RippleStats - Compute descriptive stats for ripples (100~200Hz oscillations).
%
% USAGE
%
% [maps,data,stats] = RippleStats(filtered,ripples,<options>)
%
% filtered ripple-band filtered <a href="matlab:help samples">samples</a> (one chan... |
bd96408ee142f53713bcb0bfebe0e18998bef57bbcb08a0b64350735fd606a73 | MATLAB | 5,464 | 99 | function [post nlZ dnlZ alpha] = infLaplace(hyp, mean, cov, lik, x, y, opt)
% Laplace approximation to the posterior Gaussian process.
%
% Compute a parametrization of the posterior, the negative log marginal
% likelihood and its derivatives w.r.t. the hyperparameters. The function takes
% a specified covariance funct... |
6d98f4bf983821483170d2f22fc70f53c593afb74d5c1f8eba1241883915eb39 | MATLAB | 5,465 | 195 | function [cl1,cl2,dmt,dmt2,d1,d2,mask,mask2] = density_diff(XYZ,u,XYZ2,u2,varargin)
% function [cl1,cl2,dmt,dmt2,d1,d2,mask,mask2] = density_diff(XYZ,u,XYZ2,u2,[radius_mm],[first outfile name],[2nd outfile name])
%
% function gets density from a list of XYZ coordinates
% in one condition of a meta-analysis
% and makes... |
4b24fd23dabc8ea99d3733c5b1d64452157ebdc2f1301e4f421736365994a662 | MATLAB | 5,471 | 150 | classdef nnbilinearsampler < nntest
properties (TestParameter)
% input/output sizes:
ih = {8 16}
iw = {4 8 16}
oh = {8}
ow = {4 8}
method_type = {'cuda', 'cudnn'}
multiple_grids = {true false}
end
methods (Test)
function check_der_x(test, ih, iw, oh, ow, multiple_grids)
if ... |
88d95c143f9b0a5ea16320807007fbd68099762b4b7f819f0c6b414c20811448 | MATLAB | 5,472 | 141 | function ProcessBinary(inputName,outputName,nChannels,f,varargin)
%ProcessBinary - Process binary data file.
%
% Process binary data file, e.g. filter LFP file. This function loads the
% binary file segment by segment, calls a user-supplied function to process
% each data segment, and optionally saves the result to a ... |
153b5f874166e560fcdd4d48556c91a65a2307c913cf9d301e1d4ea50db19b66 | MATLAB | 5,473 | 182 | %% ============================================
% Standalone Script:
% Markov Chain Analysis + One Combined Timeline
% (15–16 mice stacked vertically in one figure)
%% ============================================
clear; clc;
%% Add path
addpath('H:\Kaizhen\Anxiety_behavior_phenotyping_analysis\Ethologica... |
c122c0d4d1946a9e235c46d17fb7c9a83cc945550c04e6fd1ed72f7c738c4099 | MATLAB | 5,473 | 127 | % STD_APCLUSTER - Affinity propagation cluster for eeglab STUDY
% Wrapper for function provided by (Frey/Dueck, Science 2007)
%
% Usage:
% >> [IDX,C,sumd] = std_apcluster(clustdata);
%
% Inputs:
% clustdata -Preclustering matrix
%
% Optional inputs:
%
% 'maxits' -maximum number of iterations ... |
350f1454568e7794a25998aa7b16bca95de2783eec655c099bc686719769573f | MATLAB | 5,476 | 157 | function [ica_sig, ica_filters, ica_A, numiter] = CellsortICA(mixedsig, ...
mixedfilters, CovEvals, PCuse, mu, nIC, ica_A_guess, termtol, maxrounds)
% [ica_sig, ica_filters, ica_A, numiter] = CellsortICA(mixedsig, mixedfilters, CovEvals, PCuse, mu, nIC, ica_A_guess, termtol, maxrounds)
%
%CELLSORT
% Perform ICA wit... |
d36a54a1672ecf8ccc4342896a94123e28b249640b08c3363d42a3f1ca00dccf | MATLAB | 5,479 | 140 | % fieldtrip2eeglab - convert Fieldtrip structures to EEGLAB dataset
%
% EEG = fieldtrip2eeglab(header, rawdata, evt);
% EEG = fieldtrip2eeglab(data);
%
% Inputs:
% header - Fieldtrip data header
% rawdata - Fieldtrip raw data
% evt - Fieldtrip event structure (optional)
% data - Fieldtrip data ... |
f74c070f7e6955fb645e802340252445580b01f44f5d944e61cb4810ccca3d83 | MATLAB | 5,485 | 151 |
% creates the trainign and testing data for the projeciton neuron sthuffle
function [] = run_preprocess_decode_mlb_shuffle(savename, usemlb, epoch, decodertype, usetorch)
%location of analysis codebase
rng(101)
codepath = '~/projects/constantinoplelab/Analysis/';
% add code paths
addpath(genpat... |
823105944ea1f927c509e5c1f393070415da9887d9fe64639c98afa1bd601981 | MATLAB | 5,486 | 194 | % op_addrcvrs.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% [out,fids_presum,specs_presum,ph,sig]=op_addrcvrs(in,point,mode,coilcombos);
%
% DESCRIPTION:
% Perform weighted coil recombination for MRS data acquired with a reciever
% coil array.
%
% INPUTS:
% in = input spectrum in matlab structure f... |
bb81fa805da87839144575b92236d2e0f7ec5eb66516091e3c2eaef30b4ab04e | MATLAB | 5,488 | 118 | function event = ft_filter_event(event, varargin)
% FT_FILTER_EVENT does what its name implies
%
% Use as
% event = ft_filter_event(event, ...)
%
% The optional arguments should come in key-value pairs and determine the
% filter characteristics:
% type = cell-array with strings
% value = numeric a... |
0baa6f4071c0ff651149869f36718c8a417bcedad052340e2e4d2cc74446b6de | MATLAB | 5,489 | 141 | function delta = FindDeltaWaves(filtered,varargin)
%FindDeltaWaves - Find cortical delta waves (1-6Hz waves).
%
% USAGE
%
% delta = FindDeltaWaves(filtered,<options>)
%
% filtered delta-band filtered LFP <a href="matlab:help samples">samples</a> (one channel). This must
% be restricted t... |
3cbc7e9271ace7f5308136dc5cf29d0f7cfef2b3017d2a9ff2da572ece73ff57 | MATLAB | 5,492 | 151 | %% This file is used to calculate average 1D autocorrelation amplitude of MPS
clear all;
close all;
ipath = '\\E1-054867\Jinyu\20250801 a2KD towards a2b2\#4 DIV14 a2GFP MAP2_Cy3 a2_AF647\Analysis\diat_regions';
pixelSize = 167;
dbin = 10/1000; % micr
bb=0;
average_c=[];
txt_file='autocorrelation_amplitude.txt';
fileI... |
f9c7e09f7095027ad65ace2c940ab529d490ec1c92b8bbe9a3ffe27dd413e8a7 | MATLAB | 5,492 | 124 | % PLOTSPHERE - This function is used to plot a sphere and
% project them onto specific surfaces. This may
% be used for plotting dipoles for instance.
%
% Usage:
% >> handle = plotsphere(pos, rad, 'key', 'val')
%
% Inputs:
% pos - [x y z] 3-D position of the sphere center
% ra... |
e35c650d72a0b372e2a1fdb779de560fe02d0207bc88ecb06e1569f6317aa6cc | MATLAB | 5,493 | 157 | %%% NUMERICAL METHOD TO SOLVE THE 2D Diffusion Equation %%%
function [C_store]=NumericalSolver2D(M,ds2,dt,nt,Diff,S0,Q,kapa,tp,rate,sc,Mask,Cb, BC)
%Extract source coordinates
Sy=S0(1);
Sx=S0(2);
Mx=M(2);
My=M(1);
dy2=ds2(1);
dx2=ds2(2);
dy=sqrt(dy2);
dx=sqrt(dx2);
... |
5685e6476f70b8ebc12440f8ae424aee1cc50876f24392e63c9eeedbfc831f3a | MATLAB | 5,495 | 146 | function preconfun = preconhessiansolve(problem, options)
% Preconditioner based on the inverse Hessian, by solving linear systems.
%
% function preconfun = preconhessiansolve(problem)
% function preconfun = preconhessiansolve(problem, options)
%
% Input:
%
% A Manopt problem structure (already containing the manifold ... |
0b068f759cd22a3a262aa46913550a66ed65fd8760f794f46c162cf2704a5407 | MATLAB | 5,497 | 83 | function plot_RNN_choice_switch
close all
clear all
clc
% Plot perturbation-induced choice switching in RNNs.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
load('RNN_choice_switch_trial_fraction.mat')
switch_trial_fraction_control_no_ablation = RNN_choice_switch_trial_fraction.control.n... |
85d41dc5da384d7bc700cc03641c34da09402f367040ee512e62b3ba1bc4c7de | MATLAB | 5,499 | 184 | %% inputNIFTIList = read_bids_to_filelist(inputDir,outputPrefix)
%
% Input
% --------------
% inputDir : input directory with BIDS
% outputPrefix : full output basename
%
% Output
% --------------
% inputNIFTIList: file list for SEPIA
%
% Description: This script (1) reads BIDS compatible input directory to a fi... |
213c4a97877e9d801929ab03c0a7258fc343d56705c690edc8d96927647f6b92 | MATLAB | 5,500 | 124 | function MIGP(StudyFolder, Subjlist, fMRINamesRaw, ProcSTRING, dPCAinternal, dPCAout, outputPCA, checkpointFile)
%if isdeployed()
%better solution for compiled matlab: *require* all arguments to be strings, so we don't have to build the argument list twice in the script
%end
dPCAinternal = str2... |
dfc65cb7db3d0ea29818f19d3315d8db84252bea631e4029519a0cb8b03a7f1a | MATLAB | 5,500 | 121 | function [intervals,indices] = ExcludeIntervals(intervals1,intervals2,varargin)
%ExcludeIntervals - Exclude intersecting intervals.
%
% Given two lists of intervals, exclude from the first list those intervals
% that intersect with one or more of the intervals in the second list.
%
% USAGE
%
% [intervals,indices]... |
23a1c5bdba36fa4ed80d9ed0dcf71f4707a7dc6be20ffcc07f39920dd14d51ab | MATLAB | 5,504 | 90 | function osp_updatedistrOvWindow(gui)
%% osp_updatedistrOvWindow
% This function updates the raincloud overview tab.
%
%
% USAGE:
% osp_updateCoregWindow(gui);
%
% INPUT:
% gui = gui class containing all handles and the MRSCont
%
%
% AUTHORS:
% Dr. Helge Zoellner (John... |
87578ff0246e9403892f9a78d33c9ebcec971d218f463cab2fc49838f0a72d34 | MATLAB | 5,504 | 156 | function varargout = WhiteMatterSF(varargin)
% WHITEMATTERSF M-file for WhiteMatterSF.fig
% WHITEMATTERSF, by itself, creates a new WHITEMATTERSF or raises the existing
% singleton*.
%
% H = WHITEMATTERSF returns the handle to a new WHITEMATTERSF or the handle to
% the existing singleton*.
%
% ... |
9109cc3cf83ec6c31861bada19094815199a16c9dd03d5506ba35d266b1845cf | MATLAB | 5,505 | 150 | function plotResultsBetaBehavior_BIS(mBIS, mBISp, toi, outputFolder, varargin)
% plotResultsBetaBehavior_BIS(..., 'Q',0.05, 'Mode','hier'|'layered')
p = inputParser;
addParameter(p,'Q',0.05,@(x)isnumeric(x)&&isscalar(x)&&x>0&&x<1);
addParameter(p,'Mode','layered',@(s)ischar(s)||isstring(s));
parse(p,varargin{:});
... |
ba5869834fbe548eefbccf3fce6d0d236cb8593436764281db3e0383c53dd3ba | MATLAB | 5,509 | 142 | %{
# Retinotopy map
-> mice.Mice
ret_idx : smallint # retinotopy map index for each animal
---
%}
classdef RetMap < dj.Manual
methods
function createRet(self,keys,ret_idx,no_map)
if nargin<3
if exists(map.RetMap & keys)
old... |
41ff96e11451e3571bf6933a9fe74e402ae432dbb7b938efb8f1635cfd354816 | MATLAB | 5,513 | 135 | function [VOLLOCS, LOCS, verbose] = ...
tapas_physio_create_scan_timing_from_tics_siemens(t, t_start, log_files, verbose)
% Creates locations of scan volume and slice events in physiological time series vector from Siemens Tics-file
% (<date>_<time>_AcquisitionInfo*.log)
%
% [VOLLOCS, LOCS, verbose] = ...
% tapa... |
089bb1baafbfc08cfa02ba83b82a9fb9af0d4635716392d8feb3b8b95f316089 | MATLAB | 5,514 | 107 | % Matlab script to load two k-space volumes associated with the two flow
% encodings in a through slice cine PC acquisition.
% Martin Graves
% University of Cambridge
% 13/01/2025
disp('Loading k-space data...');
load("echo1.mat"); % Load the k-space data for echo 1
load("echo2.mat"); % Load the k-space data for... |
67d413842bcc145b719097676438e3040e9f4daa9cf4e1a8b72fcb4c36e646c3 | MATLAB | 5,514 | 123 | function out = WL_wpdBestTree(y, wname, maxlevel)
% WL_wpdBestTree Adaptive best-basis wavelet packet decomposition.
%
% Decomposes the time series with a full wavelet packet tree and then prunes
% it to the entropy-optimal ("best basis") subtree using the
% Coifman-Wickerhauser algorithm. Unlike a standard (or maxim... |
ef12cfe710166ae24c5de2f4b5585e492e31c9a5997a8b9f95342e0dcca22c19 | MATLAB | 5,517 | 140 | function [c, r, t, cpulse, acq_codes, verbose, gsr] = tapas_physio_read_physlogfiles_biopac_txt(...
log_files, cardiac_modality, verbose, varargin)
% Reads in 4-column txt-export from BioPac Data (resp, ppu, gsr, trigger)
%
% [c, r, t, cpulse, acq_codes, verbose] = tapas_physio_read_physlogfiles_biopac_txt(...
% ... |
553789a3ba081f71bfdbcef6f8c121b8448918d122196985cbfee2543dbe3901 | MATLAB | 5,520 | 134 | function this = update_and_validate_properties_from(this, dimInfo)
% Updates properties from other dimInfo, allowing only valid entries to
% update. Can update from MrDimInfo object or struct.
%
% Y = MrDimInfo()
% Y.update_and_validate_properties_from(dimInfo)
%
% This is a method of class MrDimInfo.
%
% IN
%
% OU... |
f7a2b140716dccdfc8c28360075c3e2139ce21d9ef6aa8231ae9c319ab121370 | MATLAB | 5,527 | 192 | function F1 = significance_distribution_plots(dist1, repVal, adjM, genotype, oneFigureHandle)
% Plots the threshold value as a function of the number of circular shifts
% (repeats) and the thersholded adjacency matrices
% INPUTS:
% dist1 = Cell where dist1{i} is double size(adjM) where element value
% at d... |
6c59db460a231cdd607daa7ce6b4b65a6fa5f3ae837de7f82cc82f85a95ec328 | MATLAB | 5,531 | 144 | function ARTwarp_cli_mode(varargin)
% PARSE INPUT ARGUMENTS
% Instantiate an inputParser object to manage inputs
p = inputParser;
% Add required positional arguments for:
% The path to the folder containing the contours to categorise
addRequired(p, 'inputFolder', @isfolder);
% The warp factor level
validationFcn =... |
c14efb467925613054f077ecab9fd18515ef1c569cb41a93bfd93f2fc96b7bb8 | MATLAB | 5,532 | 118 | function ProcessData_Figure2(datadir, savedir, codedir)
%ProcessData_Figure2 - Process raw data saved under datadir such that it can be plotted by PlotFigure2.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_Figure2.mat' from Zenodo was saved
% codedir - Local directory where code (e.g., publishe... |
15cc7bb404e6d5350e6d9f37ec46c2c0ec53f5551956efd6b0555b6b25f86b04 | MATLAB | 5,533 | 193 | % Script definition_of_geometry
% Basic overview of how the image geomtry is represented in uniQC, in
% particular the combination of two affine matrices as defined by dimInfo
% and affineTrafo
%
% definition_of_geometry
%
%
% See also tapas_uniqc_spm_matrix tapas_uniqc_spm_imatrix MrImageGeometry
% Author: Saskia B... |
98ecfe826387b3fbfbf8496f75af0cd3bedc8bf5c201af2cfc74cb7b663034c8 | MATLAB | 5,533 | 157 | function NewCalls = SeperateLong22s_Callback(hObject, eventdata, handles, inputfile, Calls)
%% Get if clicked through menu, or using the long call network
if nargin == 3
[trainingdata, trainingpath] = uigetfile([handles.data.settings.detectionfolder '/*.mat'],'Select Detection File','MultiSelect', 'off');
[audi... |
f35c32e42b6922fb05c7570616f8c44d765a98943db3206048a42a87dd170b4f | MATLAB | 5,533 | 136 | function [densityData, densityNoise, xev, yev] = NoiseModel(filename, deltaFoF, sigma, movements, plotFlag)
lambda=8;
deltaFoF(logical(movements),:)=NaN;
transfDataMatrix=bsxfun(@rdivide,deltaFoF,sigma);
points(:,1)=reshape(transfDataMatrix(1:end-1,:),[],1);
points(:,2)=reshape(transfDataMatrix(2:end,:),[],1)... |
4898a9e09a200535ab58bce5961a0b19a258faf81ae32d424e19d45bb4b58771 | MATLAB | 5,535 | 200 |
function [output]=getSpikesAllNeurons(path)
% path should contain the '*_clean.mat' structure fom EXTRACT and after
% manual clean up.
% the output is the updated strucutre with the spikeRaster and metadata
% stimulus TTL, speed is requested
% options.
if ~contains(path,'_clean.mat')
cleanExtractPath=dir(fullfile(... |
ca22b40375fb5bdc16daf6a951aa7b9c1ea678911581ae1150b23951a1bd297b | MATLAB | 5,535 | 140 | % EEGTHRESH - reject trials with out-of-bounds channel values within a
% specified epoch time range.
%
% Usage:
% >> [Iin, Iout, newsignal, elec] = eegthresh( signal, frames, ...
% elecs, negthresh, posthresh, timerange, starttime,endtime);
%
% Required inputs:
% signal - 2-D data... |
ce7a747126596d13fcf66df996a5d9ae8fce74241c74719d5b389984b4702446 | MATLAB | 5,535 | 155 | function [net, stats] = cnn_toy_data(varargin)
% CNN_TOY_DATA
% Minimal demonstration of MatConNet training of a CNN on toy data.
%
% It also serves as a short tutorial on creating and using a custom imdb
% (image database).
%
% The task is to distinguish between images of triangles, squares and
% circles.
% Copyright... |
3bc24500eb66f5b862a60e8c6901fef34ce576c4a6a0fb4b77fcf1677ff3293a | MATLAB | 5,536 | 165 | function [err,Indx] = AFNI_XYZcontinuous2Index (XYZmm, Info, CoordCode, IndexDim, retNaNoutside)
%
% [err,Indx] = AFNI_XYZcontinuous2Index (XYZmm, Info, [CoordCode], [IndexDim], [retNaNoutside)
%
%Purpose:
% Change from voxel XYZ in mm to XYZindex (called Voxel Coords in AFNI)
% The mm and voxel coordinates refer... |
c130d0918d6dc4499e05d88d2ca51fb416d4e080f121d89ab1f3f7db14e3d944 | MATLAB | 5,536 | 147 | % readbvconf() - read Brain Vision Data Exchange format configuration
% file
%
% Usage:
% >> CONF = readbvconf(pathname, filename);
%
% Inputs:
% pathname - path to file
% filename - filename
%
% Outputs:
% CONF - structure configuration
%
% Author: Andreas Widmann, University of Leipzig,... |
d44112c18aedf214456120d7b21323a4773c0b3340f5ce85cdfc558434d03303 | MATLAB | 5,540 | 146 | function out = NL_EmbedPCA(y, tau, m)
% NL_EmbedPCA Principal Components analysis of a time series in an embedding space.
%
% Reconstructs the time series as a time-delay embedding, and performs Principal
% Components Analysis on the result using Matlab's Statistics and Machine
% Learning Toolbox pca() function.
%
% T... |
d99ecf79391f75074726c6b12893f21d0f0c25dfd5826482abe130705376b611 | MATLAB | 5,541 | 159 | function [this] = read_biff(filename, opt)
% READ_BIFF reads data and header information from a BIFF file
%
% This is a attemt for a reference implementation to read the BIFF
% file format as defined by the Clinical Neurophysiology department of
% the University Medical Centre, Nijmegen.
%
% read all data and informat... |
573b1a9df69662507fe9cf9a86cca09eb7fc623ccc96bb73758be601a7e62647 | MATLAB | 5,542 | 163 | function ch2roi_plot_spectra(GRUP, groupInfo)
% groups channels into defined ROIs (anatomic areas), averages & plots
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected freq. band
% - significance (difference of conditions, from baseline (TO DO), or all)
% settings (subjects, di... |
709bff15c8ff3d73f3dd37cf0bf374bd3d5a986b142499aa9d52d2e8a4d6d681 | MATLAB | 5,542 | 120 | classdef McsCmosAcquisitionSource < handle
% Stores the contents of the Acquisition data source
%
% The different streams present in the Acquisition source are sorted into
% the {Channel,Event,Sensor,Spike}Stream fields where they are stored as
% cell arrays.
%
% (c) 2017 by Multi Channel Systems MCS GmbH
... |
b8e8fc47c4ed590d155366ea4f5b5cdb5db770f7441baa6a23c347e312a77e3d | MATLAB | 5,542 | 185 | function [ltom, htom, mtol, mtoh, ltom_incong, htom_incong, sems] =...
block_dynamics_wt_binTrials(A, twin, binSize, smoothfactor, varargin)
%computes the change in z-scored wait time, normalized to mean wait time
% for each reward volume around each block transition. **Does not include
% violation trials**. ... |
779d199b21ab9f30b58d037f58fc052c8f896e3a8df36ee8bd138a0dd3fa3c3e | MATLAB | 5,547 | 109 | % Script to run SPM RFX paired t tests
%
% a direct comparison between negative partner outcomes of lotteries
% chosen by the participant vs the same outcomes resulting from lotteries
% chosen by the partner, using paired t-test.
%% Base settings
baseDir = '/Volumes/LaCie_RAID_A/Documents/exp/SoDec/Responsibility/';
s... |
a1c959fa0500271faaa4ed5b4b3b7a5b964fcf27cebd65145b1190fd4c25dcb0 | MATLAB | 5,547 | 178 | function [u,maxd,usum,maxsum] = fast_max_density(n,iterations,radius_mm,varargin)
% [u,maxd,usum,maxsum] = fast_max_density(n,iterations,radius_mm,[brain_mask_name])
%
% Improved faster algorithm for null-hypothesis monte carlo simulation
% Same results as density_pdf.m
%
% u = critical threshold at alpha = .05
% maxd ... |
becdaeee281a0e75ac5e2e95ae380633c51b763ddeab1706443079814eda7905 | MATLAB | 5,548 | 156 | function tuned = TuneArtefactTimes(x,times,varargin)
%TuneArtefactTimes - Fine-tune artefact (e.g. stimulation) times.
%
% Fine tuning can be done using either the LFP (faster), or the wideband
% data (slower but more accurate). The latter is especially useful in cases
% where the artefacts are no longer visible in... |
ffbbbeeba526bee28fb0c5891dae1d82289f763d01d7b08e0c3e1d71f39dd03c | MATLAB | 5,549 | 161 | % analysis_CategoryIdentification Run object category identification
%
% Author: Tomoyasu Horikawa <horikawa-t@atr.jp>, Shuntaro C. Aoki <aoki@atr.jp>
%
clear all;
%% Initial settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Data settings
% subjectList : List of subject IDs [cell array]
% featur... |
d5f72da1ebbfe01f72f4f7b57685cd1b068d9d45be8a19dfce1e33a88417a106 | MATLAB | 5,551 | 140 | function net = cnn_Cones_init(varargin)
% Architecture and parameters for Cone network present in Cunefare
% et. al 2017
% This file was modified from the MatConvNet cnn_cifar_init.m file by David
% Cunefare 3-24-2017 for:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for... |
d682ef24c69a32012e0d63c938389d1d5573b70227ce6e1d17b029cca7665ee5 | MATLAB | 5,552 | 111 | function fn_handle = GiveMeFunctionHandle(cfnParams)
% GiveMeFunctionHandle Returns a function handle for computing classification accuracy
%
%---INPUTS:
% cfnParams, parameters for the classification, e.g., set with
% GiveMeDefaultClassificationParams.
% ----------------------------------------------------... |
3eba6c0cb055378581b19ec85ae1523e0b825f83acad4bc34cd34450dd8bd781 | MATLAB | 5,555 | 124 | % STD_TOPO - uses TOPOPLOT to get the interpolated Cartesian grid of the
% specified component topo maps. The topo map grids are saved
% into a (.icatopo) file and a pointer to the file is stored
% in the EEG structure. If such a file already exists,
% loads th... |
2735796de8e4971919069097d53cbf342e97dc1e0e158f9753226ad39ed8a5a4 | MATLAB | 5,557 | 113 | function [augmA, augmb] = fit_createSoftConstrOsprey(basisSet, A, b, ampl)
%% [augmA, augmb] = fit_createSoftConstrOsprey(basisSet, A, b)
% This function augments an unconstrained non-negative least-squares
% (NNLS) problem of the form min(||Ax-b||^2) with x >= 0 to include soft
% constraints on the metabolite a... |
aa05458179f7f01ca3f962eafa9e5f2526f0d419b192ca3ebd65284297321bd7 | MATLAB | 5,558 | 190 | function [ DCM ] = tapas_rdcm_model_specification(Y, U, args)
% [ DCM ] = tapas_rdcm_model_specification(Y, U, args)
%
% Utilizes data and driving inputs to specify a whole-brain dynamic causal
% modeling (DCM) structure that can be utilized for inference with the
% regression DCM (rDCM) toolbox.
%
% Input:
% ... |
29717bfd2b2e040bc2fc092a2070fee953a06dfb8ca9906a3fdb7df6383cc8bb | MATLAB | 5,559 | 134 | % PLUGIN_INSTALL - install EEGLAB plugin. Called by PLUGIN_ASKINSTALL.
%
% Usage:
% plugin_install(zipfilelink, name, version, force, size);
%
% Inputs:
% zipfilelink - [string] web link to zip file
% name - [string] name of the plugin
% version - [string] version of the plugin
% size - [real] si... |
c014f75d0b8a95cb589dea4d1b57261497ffb4d607c7a62f87544213e6261587 | MATLAB | 5,559 | 217 | function [Model, Info] = linear_stepwise_reg(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% regularization version
%
% Notice !!
% Delay embedding is done in this module,
% then input vector should be original input data without embedding
%
% [Model, Info] = linear_ste... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.