sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1cce2ab9720c3ddd475a6fd0958692fa600928b40da9cdde75d36c9a7f9cc951 | MATLAB | 5,177 | 127 | function rbfBasis = rbfComputeBasis( X, k, cluster, scale, show )
% Get locations and sizes of radial basis functions for use in rbf network.
%
% Radial basis function are a simple, fast method for universal function
% approximation / regression. The idea is to find a mapping X->y where X
% and y are continuous real va... |
724c7dddb77ceb1785a1fb4886f8cbb8bd995c5e8542a37d162fc8a1b6f7144f | MATLAB | 5,177 | 207 | % explore balloon model stability
clear all
close all
clc
xg1 = [-5:0.2:5];
xg2 = xg1;
n = length(xg1);
lm = zeros(n,n);
kas = [-4:0.2:4];
kaf = [-3:0.2:3];
try
load demo_stability_hrf.mat
% get max eigenvalue
P = [0;0;0;0;0;0];
for i=1:n
for j=1:n
J = VBA_numericDiff(@f_HRF,1,[x... |
7c1c7b28f4a1c4206473775ff4688b0e24cf7bde74c3c7dd5b45591ea0cc70a4 | MATLAB | 5,178 | 150 | % First-kind integral equation on the unit square, Laplace single-layer.
%
% This example solves the Poisson equation on the unit square by using a single-
% layer volume potential, which yields a first-kind volume integral equation.
% The problem is discretized on a uniform grid, with simple point-to-point
% quadratur... |
4804a7188048ffa5a4f710d1d7544532427148232b911b6a3efef922a25143ab | MATLAB | 5,181 | 154 | function M = spectrahedronfactory(n, k)
% Manifold of n-by-n symmetric positive semidefinite matrices of rank k
% with trace (sum of diagonal elements) equal to 1.
%
% function M = spectrahedronfactory(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 s... |
f9db272c6d00791fe64efaebd315d8577b383875a15ec995b4b0b73a6f5efe73 | MATLAB | 5,184 | 153 | function d = getdict
% Dictionary of NIFTI stuff
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
%
% $Id$
persistent dict;
if ~isempty(dict),
d = dict;
return;
end;
% Datatype
t = true;
f = false;
table = {...
0 ,'UN... |
50c6fab6d8c2ff55cb97829da4dfe252250be1c98c3ec26d21b36a08654e43c3 | MATLAB | 5,185 | 163 | % load ../data/sigSL_allSessions_Ariel.mat
load ../data/sigSL_allSessions_Ariel_230522.mat
S = sigSL_Ariel;
S.MinI_minus_C = S.MinI - S.MinC;
session = S.session;
times = S.t;
dt = times(2) - times(1);
choice = S.choice;
RT = S.rt/1000;
coh = S.sig_coh;
% str = {'MinC',
% 'MinI',
% 'PC1',
% 'TinC',
% ... |
c29570bcc1f2a7e04532de36068abf29dbec8adb8b758df1008ee6675cdc883b | MATLAB | 5,188 | 123 | % ========================================================================
% Ruslan Masharipov, June, 2024
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
%
% The impact of amplitude differences on regression coefficients asymmetry.
% EXAMPLE #1: Adding ... |
f7fa0314a2b6cbceb9b823650020b1340009e71b2e21e8a93edb30f2964a2810 | MATLAB | 5,189 | 130 | function model = plotMCmatlabHeat(model)
% Requires
% plotVolumetric.m
%
% See also simulateHeatDistribution
%%%%%
% Copyright 2017, 2018 by Dominik Marti and Anders K. Hansen, DTU Fotonik
%
% This file is part of MCmatlab.
%
% MCmatlab is free software: you can redistribute it and/or modify
% it und... |
e7f53f0dd81e763099d8619751449f4eabcdf84c487c6762be4b28b4eb42676a | MATLAB | 5,193 | 187 | #!/bin/bash
#SBATCH --qos=vip
#SBATCH --job-name=Tenet3
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem-per-cpu=4G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-180
#SBATCH --output=Tenet3%A_%a.out
#SBATCH --error=Tenet3%A_%a.err
#Load Matlab 2017a module
ml MATLAB
matlab -nojvm -nodisplay<<-EOF
s=str2num(g... |
1937f7369dcb30dcd061a98ddf5e532380a05fb371b97e2fa72e86bbd90ed620 | MATLAB | 5,194 | 90 | function [trainedClassifier2, validationAccuracy,validationPredictions] = FineTree(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% ... |
2936b3b372d0e5b380c5b478a8993416618f2298e257fe0794b3c97473369fb8 | MATLAB | 5,194 | 90 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CourseTree(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
... |
4c449a94a5d61b11dde76fd257b0d4fa264a14d0472ef11b159a7dce02d743e9 | MATLAB | 5,195 | 151 | % TSRMFIELD Removes all instances of a field from the specified level
%
% Syntax: TSrmfield(Level,field,SupQuery)
%
% Level is a string specifying the level of the Experiment structure from
% which the field is to be removed. It must be one of the following:
% 'Experiment' 'Subject' 'Session' 'Trial... |
bc13f123edf3e0b4c0249d953472aa8436d44440b41b72b4f29eeab32c4b0eaf | MATLAB | 5,195 | 90 | function [trainedClassifier2, validationAccuracy,validationPredictions] = MediumTree(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
... |
de0cd9d5d9fb3ff7e5128e175343f96b59a0088496c14fb3ac17cb5c2f999289 | MATLAB | 5,195 | 153 | function m = methodInfo(className,methodName, full)
% Return a struct storing detailed info about a method.
% If the method does not exist, [] is returned.
%
% Example:
%
% m = methodInfo('MvnDist','infer')
%
%%
% m.Name - name of the method
% m.isPublic - true iff the method is publi... |
f08f6bdc5575e4f936a914ce8920b2fa9a2276579ce15e76d5d76b64b1e76e79 | MATLAB | 5,197 | 159 | function a = subsref(t,s)
%SUBSREF Subscripted reference for a sparse tensor.
%
% We can extract elements or subtensors from a sparse tensor in the
% following ways.
%
% Case 1a: y = X(i1,i2,...,iN), where each in is an index, returns a
% scalar.
%
% Case 1b: Y = X(R1,R2,...,RN), where one or more Rn is a ran... |
e6c48e4c42881eebd1de36b94056030b562b0798a3bdf20f66add3ae5ad5d6f2 | MATLAB | 5,198 | 112 | % MotorBehaviorPeriodsTable.m
% Sarah West
% 4/8/22
function [parameters] = MotorBehaviorPeriodsTable(parameters)
% Call this for each stack/trial
% Get list of period names in this all_periods
period_names = fieldnames(parameters.all_periods);
% Establish all_periods_table as Conditions plus a ... |
29810e4fc2cd3d5a5a80b86b3fa4d708c6f605735319d6a8766f4ab86532f62b | MATLAB | 5,201 | 124 | function [Ci,Q]=modularity_dir(A,gamma)
%MODULARITY_DIR Optimal community structure and modularity
%
% Ci = modularity_dir(W);
% [Ci Q] = modularity_dir(W);
%
% The optimal community structure is a subdivision of the network into
% nonoverlapping groups of nodes in a way that maximizes the number of
% wit... |
92dbccf0db37a4c13f21f4ad73b31b336ea07a7b1663b7ba68d0607c2134823b | MATLAB | 5,201 | 175 | % To plot DFT
% function [amp_dB, freq, ax]=plot_dft(vecin, fs, xscale, optional)
% ---------------------------------------------------------------------------
% Example: [Pxx_dB,freq, ax]=plot_dft(vecin, fs, 'log', 'NW', NW...
% 'title', title_str, 'DC', true, 'plot', true, 'nfft', nfft)
% ----------------------------... |
20e9ca1a85c6f04b263e4374909fbac3db8db6384ae126f3afc4015b94fcf9a9 | MATLAB | 5,202 | 97 | function lan_master_gui(LAN_var)
LAN = LAN_var;
mainfig = figure('name', 'Welcome to LAN MASTER GUI');
parent_panel = uipanel('units','norm','position',[.26 .01 .73 .98]);
uicontrol('style', 'pushbutton', 'units', 'norm', 'position', [0 .94 .25 .06],...
'string', 'visualization', 'callback', {@cb_btn, mainfig}, '... |
19a6722f989feef24430471a302db5471963532a6e2bf29746653abad679e793 | MATLAB | 5,203 | 94 | %% 共空间模式 | common spatial patterns (CSP) 不可在main中调用,仅可单独使用
%% one vs one Multiclass or two-classes 目标函数法
% how:N个类别中任意两个做CSP,共得到CN2=N*(N-1)/2个投影矩阵,对每个投影矩阵取最佳的2m个方向(前后各m个),特征矩阵为2m*N*(N-1)/2=m*N*(N-1)维
% 优点:每次计算CSP投影矩阵时,2个类别都是单纯的类别,更容易找到两类差别最大的投影方向
% 缺点:N类需要计算CN2个投影矩阵,N很大时,计算量会大大增加
% Inputs
% EEG_train: 训练集各类别的所有... |
f0e924400b4ad57459bdea38a9762b74fa6fb3baff0e55a21c63dd0700b67852 | MATLAB | 5,206 | 185 | function [ ICout ] = step2_ICA(STmu,UnmixingMat_init,pc_XFilter,pc_TimeCourse,Nsrc,Niter_max,TermTol)
%STEP2_ICA Apply Independent Component Analysis
% INPUTS
% STmu scalar - relative coefficient for spatio-temporal ICA
% (0=temporal, 1=spatial)
% UnmixingMat_init
% ... |
3e202f4819ade7b8f4fc4b3f190825f88e91f5f69b0d299531c249f6dcd126e5 | MATLAB | 5,208 | 186 | % OTO: demo 'observing the observer'
clear variables
close all
% parameters of the perceptual model:
% theta(1): within-class stimuli precision
% theta(2): (static) volatility of cue-outcome association probability
% mu: class-specific 1st order moment of stimuli
% phi: response model parameters
% sigma: reaction-tim... |
71775b6ae1a0ac7294c72a52941b96c114e23345d6501f157419f96633b5eeca | MATLAB | 5,208 | 125 | function newdata=struct2jdata(data,varargin)
%
% newdata=struct2jdata(data,opt,...)
%
% convert a JData object (in the form of a struct array) into an array
%
% authors:Qianqian Fang (q.fang <at> neu.edu)
%
% input:
% data: a struct array. If data contains JData keywords in the first
% level children, t... |
c572cfafb9009e0681b9dc4cac8f7b8331000682e222232a886a46d2a5ce6e74 | MATLAB | 5,208 | 151 | function [negloglik,grad,Hess] = neglogLikBTDR_IncompObs_uneqvar_Sonly(pars,lambi,Ai,Ri,zzi,r,ni,g)
% Negative marginal log-likelihood for basis of population regression
% model
%
%[negloglik, grad] = neglogLikBTDR_IncompObs_uneqvar_S_fast(pars,Ai,Ri,zzi,r,ni,g)
%
%Computes negative log-likelihood under linear Gaussian... |
dd383b5e0f9fa1fe450533026ff94a160b9a0658461e90d8057d36a8233e0460 | MATLAB | 5,208 | 142 | % logic
% folder = FolderPath
% fstruct = dir("*AvgR_Fz.nii)")
% select folder with all functional maps for flipped seeds
% folder = 'D:\ECoG_Atlas\MRI\flipped_seeds\functional_maps\flipped_seeds_maps';
% Select all files with AvgR_Fz from directory flipped_seeds_maps
% fstruct = dir("*AvgR_Fz.nii")
% outputs a str... |
1f4920173c27c1a837736975809d2b12fb9224ce4bf7d10e1c34b69065ff5a7b | MATLAB | 5,209 | 109 | function plot_half_session_place_fields()
% helps create plots, with the ratemaps divided into first and second half
% (use laps)
% to show location is stable
parameters= list_of_parameters;
load('lap_times.mat');
load('extracted_place_fields_BAYESIAN.mat');
% find cells common to both tracks
[~,idx_T1,idx_T2]= inter... |
e3d7414125156fbfbfbcff23c214162a401c3be66b89bc767d43d79d1d1cc076 | MATLAB | 5,209 | 134 | function [timelock] = ft_appendtimelock(cfg, varargin)
% FT_APPENDTIMELOCK concatenates multiple timelock (ERP/ERF) data structures that
% have been processed seperately. If the input data structures contain different
% channels, it will be concatenated along the channel direction. If the channels are
% identical in t... |
17f18d43322ffce69b904fb87043babb236326a8dae207e2cb7addceb7c718a8 | MATLAB | 5,210 | 115 | % pop_processMARA() - graphical interface to select MARA's actions
%
% Usage:
% >> [ALLEEG,EEG,CURRENTSET,com] = pop_processMARA(ALLEEG,EEG,CURRENTSET );
%
% Inputs and Outputs:
% ALLEEG - array of EEG dataset structures
% EEG - current dataset structure or structure array
% ... |
607d21ff1497bb032631a77db045533302ce691c0d93ad1e847b437637dafc18 | MATLAB | 5,212 | 133 | function [h,miss,stds] = plotRoc( D, varargin )
% Function for display of rocs (receiver operator characteristic curves).
%
% Display roc curves. Consistent usage ensures uniform look for rocs. The
% input D should have n rows, each of which is of the form:
% D = [falsePosRate truePosRate]
% D is generated, for exampl... |
a6b3e89e54516f7592d08eddece835483446164a83499300760d02275084e05f | MATLAB | 5,212 | 171 | function VBA_spm_plot_ci(E,C,x,j,s)
% plots mean and conditional confidence intervals
% FORMAT spm_plot_ci(E,C,x,j,s)
% E - expectation (structure or array)
% C - variance or covariance (structure or array)
% x - domain
% j - rows of E to plot
% s - string to specify plot type:e.g. '--r' or 'exp'
%_____________________... |
415d9a621d7e6928f2fa668be697947ff65daf97407870639eff54270d63f996 | MATLAB | 5,216 | 174 | function sam_normalize_command_smd(mrilist, samlist, num, res)
% sam_normalize_command_smd(mrilist, samlist, num, res)
% mrilist is path to single *.MRI file
% samlist is path to single *.IMG file converted from *.SVL derived from
% headmodel
% num is number of subjects
% res is resolution in mm
%%%%%%%%%%%%%... |
4d512f759c43995a41c30b4d218650d5a1ba232006c5309d8b279ffc2b1a7630 | MATLAB | 5,216 | 115 | function [W,Gss,Gds,Hds]=sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%interpolate matrix for spherical interpolation
%
% W = sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%
% Inputs:
% src - [3 x N] old electrode positions
% dest - [3 x M] new electrode positions
% lambda - [float] r... |
bc1d9107d191b41aaa0b24e2077ca4f942462599336227f37ab4a2276586b833 | MATLAB | 5,216 | 172 | % Plot the distribution of pairwise spike count correlations within L1,
% within L2, and between L1 and L2, as well as the average pairwise
% correlation as a function of pairwise distance.
% NB: If this script is run on a local machine, then one trial of the
% simulations (here the one with ID1) for each parameter ... |
f69434e1857ee47d6e82ec32098dfd3321e1eff83a91ba540d1edf274bfc693a | MATLAB | 5,217 | 171 | classdef Feature < dynamicprops
properties
type
range
color
end
properties (Transient)
reporter
end
properties (Dependent = true)
startTime
endTime
duration
lowFreq
highFreq
end
events
Ra... |
fd4f20e1dccc68ae2f4ac2a1d8794a9b98f2580e12ad4e74e89f88ecbee43c2b | MATLAB | 5,218 | 189 | function [Iphi,SigmaPhi,deltaMuPhi,suffStat] = VBA_Iphi_split(phi,y,posterior,suffStat,dim,u,options)
% Gauss-Newton update of the observation parameters
% !! When the observation function is @VBA_odeLim, this Gauss-Newton update
% actually implements a gradient ascent on the variational energy of the
% equivalent dete... |
ae30e3be996b87915e6061ad0ebfeca004bae6c1b690af9f5fd7d9ab69bbf6a0 | MATLAB | 5,219 | 115 | function [W,Gss,Gds,Hds]=sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%interpolate matrix for spherical interpolation
%
% W = sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%
% Inputs:
% src - [3 x N] old electrode positions
% dest - [3 x M] new electrode positions
% lambda - [float] r... |
d1e5cc65b6897d0acf6159eafcc92f7f4c2a2229eee1c35c1eaa3e1ad1c830e8 | MATLAB | 5,221 | 124 | function [hdr] = read_biosig_header(filename)
% READ_BIOSIG_HEADER reads header from EEG file using the BIOSIG
% toolbox and returns it in the FCDC framework standard format
%
% Use as
% [hdr] = read_biosig_header(filename)
%
% The following data formats are supported: EDF, BKR, CNT, BDF, GDF,
% see for full document... |
296cfd07f287d557f065f3dc6485ce9c40171ebf55195c5da3e6af5f5b18401e | MATLAB | 5,224 | 140 | % This script runs over the cortical dipole layer (multiple dipoles)
%
% Copyright SNM/WAW 2018-2023
close all hidden
%% load bem-fmm engine
addpath('../engines/bem_fmm_engine/');
%% Dipoles are within GM
has_wm = isscalar(find(contains(tissue,'WM')));
has_gm = isscalar(find(contains(tissue,'GM')));
if(~has_wm ... |
5b72d42432c09fbd5730d53b52c21f22510c6d007ffd746b1d74c21f5c72982d | MATLAB | 5,224 | 172 | %% getDetrendedPerieventSignal
%
% Enhanced method for spike-triggered signal extraction w/ detrending.
% Useful for trying to isolate spike-triggered effects for conditional STA.
%
% Designed for use with the dataCell classes.
% This is based off the work of Poliakov, A. V., & Schieber, M. H. (1998).
% "Multiple fr... |
7b9c195b27c51a43b4094fd35d42310a355f5a033084da283b0947080734f667 | MATLAB | 5,224 | 154 | % This is ran inside the registerWithDescriptors function
% left as a script just to keep the code separate.
% Author: Daniel Goodwin, Aug 2015 dgoodwin208@gmail.com
%Create new A, calcuate the transformed values, get the distance from the
%target points as defined by the correspondences
keypointsM = [];
keypointsF =... |
3288da5e21e90d32f2a7e6c3c62d6480f9ddb0a4911a06811f7d8f42d44c0643 | MATLAB | 5,225 | 1 | % TSORDEREVENTS Re-orders event codes that have near-equal timestamps
% Sometimes events occur in very close proximity but because of
% innacuracies in timing measurement, they end up in incorrect order.
% This can create problems later when using matchcodes on this data. For
% example, suppose that when the mo... |
da15befeeb800a53ade7be4ea7f24b46c698d48481f3474be9aa961eacc8723b | MATLAB | 5,225 | 177 | function [LL,feat] = hmm_gradient(X, hmm, options)
% [LL, feat] = hmm_gradient(X, hmm, options)
%
% computes the gradient of HMM log-likelihood for time series X (single
% subject/session) with respect to specified parameters
% for use with HMM-MAR toolbox (https://github.com/OHBA-analysis/HMM-MAR)
%
% INPUT:
% X: ... |
57782a324f3290591fa4af03b3a0c93e711afd4064374445e105f750c93420f7 | MATLAB | 5,228 | 132 | function [s, cfg] = ft_statfun_indepsamplesF(cfg, dat, design)
% FT_STATFUN_INDEPSAMPLESF calculates the independent samples F-statistic on the
% biological data in dat (the dependent variable), using the information on the
% independent variable (ivar) in design.
%
% Use this function by calling one of the high-level... |
fe41814b986ef300d284f6aa1a15c6367eb5a2fa0734809f636e9b2b076610c0 | MATLAB | 5,228 | 117 | function [lh_label_fslr, rh_label_fslr, lh_label_fslr_164k, rh_label_fslr_164k] = ...
CBIG_project_from_fsaverage_to_fslr(lh_label, rh_label, abs_path_to_output_folder, type_of_smoothing)
% [lh_label_fslr, rh_label_fslr, lh_label_fslr_164k, rh_label_fslr_164k] =
% CBIG_project_from_fsaverage_to_fslr(lh_label, rh_la... |
973c81f5f4d754e803488ccc30ee8f0ea1b9927d9b697793584d6bb5b86cb1b7 | MATLAB | 5,229 | 145 | function fieldtrip2besa(filename, data, varargin)
% FIELDTRIP2BESA saves a FieldTrip data structures to a corresponding BESA file. This
% export function is based on documentation that was provided by Todor Jordanov of
% BESA.
%
% Use as
% fieldtrip2besa(filename, data)
% with data as obtained from FT_PREPROCESSING ... |
c979c8f209bd0b64d89f2eb3bdc74866cc6ce9f389078c917119afc4cb5e309e | MATLAB | 5,231 | 142 | %% bootstrap_tsdata_to_smvgc
%
% Calculate sampling distribution for conditional frequency-domain MVGC from
% time series data, based on a nonparametric bootstrap
%
% <matlab:open('bootstrap_tsdata_to_smvgc.m') code>
%
%% Syntax
%
% fB = bootstrap_tsdata_to_smvgc(U,x,y,p,fres,nsamps,acmaxlags,acdectol)
%
%% Argumen... |
8005532533f85334c21414828ab82969cb5942065f5713fb543e1dab7815c666 | MATLAB | 5,238 | 143 | function out = get_corr_3dMatrix_final(A1, B1, pixel, rmax, xyzshift, distance,flag)
% function [xyzshift, d, 0, g] = get_crosscorr_3dMatrix(A, B, pixel, rmax, xyzshift,distance,flag)
% calculates crosscorrelation function between two 3d Matrix
% For two clusters supposed to be overlaped, set xyzshift=[0,0,0];
... |
32055936ffc5df40c4fbb5ac829131d6dd87cad58e78d08ad500341377527bf6 | MATLAB | 5,239 | 143 | function out = get_corr_3dMatrix_final(A1, B1, pixel, rmax, xyzshift, distance,flag)
% function [xyzshift, d, 0, g] = get_crosscorr_3dMatrix(A, B, pixel, rmax, xyzshift,distance,flag)
% calculates crosscorrelation function between two 3d Matrix
% For two clusters supposed to be overlaped, set xyzshift=[0,0,0];
... |
8dfcd92f94770eaf76368e1457f2b78cdcc675394fde26a8797a9a82933541c5 | MATLAB | 5,239 | 142 | %% GSA_GetSy: calculate the Sobol' sensitivity indices
%
% Usage:
% [S eS pro] = GSA_GetSy(pro, iset, verbose)
%
% Inputs:
% pro project structure
% iset cell array or array of inputs of the considered set, they can be selected
% by index (1,2,3 ...) or by name... |
7fd27e1499010f2778a3e1f248fdacf36baf11e05ba369fffee6026b6e5a8beb | MATLAB | 5,240 | 168 | function P = expand_path(in)
% P = expand_path(path_name)
%
% This function will expand a path name with wildcards into a list of
% complete path names. For example, the command:
% P = expand_path('c:\my_experiment\subject_001\run_*\V*.img');
%
% will return
% P = 'c:\my_experiment\subject_001\run_01\V0001.img... |
37f940ba82d1fdc86d6f477058695d53c68034d7c69dc5200e1bdd8dec799c9b | MATLAB | 5,242 | 173 | % peakdet returns peaks and depressions (local maxima and minimum) in the input signal. It can detect peaks/dep crossing the threshold or zero. Signal data requires a row or column vector with real-valued elements. If there are no local minimum/maxima returns empty.
% Cite As
% Marco Borges (2023). peakdet (https://ww... |
73ddf9c0b8392a7863db54a4131919f29331e1abbce189afbf221bdb0b508570 | MATLAB | 5,242 | 194 | function [hfig,savename,sortederrs] = PlotSortedWorstLandmarkError(varargin)
[sortederrs,gtdata,nets,legendnames,colors,exptype,...
conddata,labeltypes,datatypes,statname,...
minerr,maxerr,...
hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,...
annoterrdata,annotcolor,annoterrprc] = myparse(varargin,'sorted... |
d348f768e3f65f5d334c04d0a7636dc78e4020bce20da1634a82c42391ab94fc | MATLAB | 5,242 | 174 | function M = fixedrankMNquotientfactory(m, n, k)
% Manifold of m-by-n matrices of rank k with two factor quotient geometry.
%
% function M = fixedrankMNquotientfactory(m, n, k)
%
% This follows the quotient geometry described in the following paper:
% P.-A. Absil, L. Amodei and G. Meyer,
% "Two Newton methods on... |
edccb2ebe9bea428c21d91f8b69ee57988195151e116cea1ac239f4a5206db71 | MATLAB | 5,243 | 163 | % function [fH,figNames] = meg_plotITPCTimeSeries(sessionDir,i)
%% input
saveFigs = 1;
user = 'karen';
expt = 'TANoise';
[sessionNames,subjectNames,ITPCsubject,ITPCsession] = meg_sessions(expt);
%% loop sessions
for iS = 1 %:20
sessionDir = sessionNames{iS};
%% setup
ch = groupC(iS).channelsRan... |
0883dd3c8eb45faacfe19aa0fafc112c33245855758a8d957e71a0b601cb0b6d | MATLAB | 5,244 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CosineKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
%... |
8262b05c0a1aee9a887163ecb97369ba192772480f523b1aa735fda69c421391 | MATLAB | 5,244 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = FineKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% g... |
a80852f393bddf21ae13c6cc5ca41f5ce68bc95fdc026c66ec578fc10992f8f6 | MATLAB | 5,245 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CubicKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% ... |
0db6cac9e596184525c5652fce029a50cddef2f1dc7919dfd87408b63f4c3ccd | MATLAB | 5,246 | 177 | function varargout = getDatAndVideoSessionInfo(fb,forceRegenerate)
% TSPS = dir('*tsp');
metas = dir('*.meta');
if ~exist('forceRegenerate','var')
forceRegenerate = 0;
end
if length(metas) > 1
if forceRegenerate
if FileExists([fb, '-metaInfo.mat'])
movefile([fb, '-metaInfo.mat'],[fb, '-met... |
d225f9dbb34075ee87f49b3ea9638c751b5cd0f0f2e85be46ae0ded1734a2fe9 | MATLAB | 5,247 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = MediumKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
%... |
ea5530dda58999a8e6f132e2bbe3a1385a4f7be93ba0a53a4cbae12eb4e2b442 | MATLAB | 5,248 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CoarseKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
%... |
4f001081de4d456640a799bb747c4fdc2fd612a191a664511de3c2b13f09d3e7 | MATLAB | 5,249 | 142 | function [tracking_struct,field_names] = process_and_sync_dlc_SNLab(varargin)
% Unpacks DLC and syncs with digitalin.events.mat timestamps
%
% Run this after you have exported deeplabcut csv results, have
% basename.session.epochs labeled, and have digitalin.events.mat.
%
% optional inputs:
% basepath: location of SNLa... |
c294e09886a1e58f501f794c34c043ac1a96fde7136c78c6db00ee658b4d99e3 | MATLAB | 5,250 | 148 | function [sourcemodel] = patchsvd(cfg, sourcemodel)
% This function does something like Limpiti et al.
% IEEE trans biomed eng 2006;53(9);1740-54
% Copyright (c) 2006, Jan-Mathijs Schoffelen & Robert Oostenveld, F.C. Donders Centre
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the docu... |
f2b4f6f37f902be580946c18800ee7767eccf84cc5232b63f55955a4412c514f | MATLAB | 5,251 | 121 | function [ IDX, C, d ] = kmeans2( X, k, varargin )
% Fast version of kmeans clustering.
%
% Cluster the N x p matrix X into k clusters using the kmeans algorithm. It
% returns the cluster memberships for each data point in the N x 1 vector
% IDX and the K x p matrix of cluster means in C.
%
% This function is in some w... |
9af509e3601f872dc1d09368751db4dd1919911578fcba8703e363c22c0ad19a | MATLAB | 5,252 | 113 | function IJ = jitterImage( I, varargin )
% Creates multiple, slightly jittered versions of an image.
%
% Takes an image I, and generates a number of images that are copies of the
% original image with slight translation, rotation and scaling applied. If
% the input image is actually an MxNxK stack of images then applie... |
9dafa2ac30f391767ba6ec67b03ec0baa32db638d0664d09d28a8e0d2a0c76ed | MATLAB | 5,253 | 227 | function [xc,good,bad,type] = cornerfinder(xt,I,wintx,winty,wx2,wy2);
%[xc] = cornerfinder(xt,I);
%
%Finds the sub-pixel corners on the image I with initial guess xt
%xt and xc are 2xN matrices. The first component is the x coordinate
%(horizontal) and the second component is the y coordinate (vertical)
%
%Based on H... |
d0808ab0bd9a40f01cf806eab72f9214c7fa48e48149f4b89fb7fda98eab8cf9 | MATLAB | 5,253 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = LinearSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
%... |
d425fb35102ee2a038448e8bb75124ef1ad89bb3c3ff16ea85491a69d1795490 | MATLAB | 5,253 | 143 | %% permtest_tsdata_to_spwcgc
%
% Calculate null distribution for pairwise-conditional frequency-domain MVGCs
% from time series data, based on a permutation test
%
% <matlab:open('permtest_tsdata_to_spwcgc.m') code>
%
%% Syntax
%
% fP = permtest_tsdata_to_spwcgc(U,p,fres,bsize,nsamps,regmode,acmaxlags,acdectol)
%
%%... |
ebf270104e5184952a5c86b47d411442db9b705857457d159de7874f53dfbe28 | MATLAB | 5,255 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CubicSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% ... |
333b1c2cc3859b970198f5a145eb416f6fc03f86a92e5bed07cb73193662d673 | MATLAB | 5,257 | 128 | function [AllVolumeBrain, GHeader] = y_Scrubbing_Surf(InFile, OutputName, AMaskFilename, TemporalMask, ScrubbingMethod, ScrubbingTiming, IsNeedDetrend, Band, TR, CUTNUMBER)
% [AllVolumeBrain, GHeader] = y_Scrubbing_Surf(InFile, OutputName, AMaskFilename, TemporalMask, ScrubbingMethod, ScrubbingTiming, IsNeedDetrend, Ba... |
e13f33fbc2485ddf975c2e5a77157fce8d4a5d71076ce69bba5d0959ca45804d | MATLAB | 5,257 | 158 | function ga_mixedsensory_figure(subjects, nerve)
%% set variables
srmr_nr = 2;
figure_path = getenv('FIGUREPATH');
if nerve == 1
% channels
chan_names = {'esg_cca'};
nerve_name = 'med';
elseif nerve == 2
% channels
chan_names = {'esg_cca'};
nerve_name = 'tib';
end
fname_start = 'epo_ccacleancl... |
0435a0efa1ee6c074a31e7788ed02aae507fd23dbd1b49c240fd8a16339a8ee3 | MATLAB | 5,258 | 184 | addpath C:\code\spm12\
addpath C:\code\wjn_toolbox
%%
clear all
close all, clc
dt = readtable('decodingtimes.csv');
color_OFF = [55 110 180]./255;
color_ON = [223 74 74]./255;
color_DOT = [255 244 0]./255;
ioff = ci('OFF',dt.Stimulation);
ion = ci('ON',dt.Stimulation);
subs_off = dt.Subject(ioff);
subs_on = dt.Subject... |
1e31022cb9c7d7f04a2ddce737229bb51a9186e4a1a8e75aa2ff43dea8e7c51a | MATLAB | 5,258 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = FineGaussianSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use ... |
7ef35d1883108b2f68c857ee63d0657d050b8fa262511fd2185398716af05d7e | MATLAB | 5,258 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = WeightedKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
... |
d8ca1dce6a5838f8201c50cd1ddc72b35d74deae21d3ac2a4bea7001aa3ac657 | MATLAB | 5,258 | 158 | function [ftver, ftpath] = ft_version(command)
% FT_VERSION returns the version and installation directory of FieldTrip
%
% FieldTrip is not released with version numbers as "2.0", "2.1", etc. Instead, we
% share our development version on http://github.com/fieldtrip. You can use git or
% subversion (svn) to make a lo... |
a17c3186b03a980ff3448eaee808e8436c579765c85743add1da7b47c7609e88 | MATLAB | 5,259 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = QuadraticSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the... |
e862a1c45d5ef15213ae52bc1a1dc89f66e2c2136b292cdd26f9548232a4e681 | MATLAB | 5,259 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = CourseGaussianSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Us... |
74b62e108ba51d3d01fcc7eb5f63cc468a49ba6c539eb57a0bdc4a80ec636d14 | MATLAB | 5,260 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = MediumGaussianSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Us... |
90cd199c165f5444a3fc79e9fcfc838dd559f7b78d73c3d0aee6f088a56b3205 | MATLAB | 5,261 | 131 | function varargout = DPABI_AddWildcardROI(varargin)
% DPABI_ADDWILDCARDROI MATLAB code for DPABI_AddWildcardROI.fig
% DPABI_ADDWILDCARDROI, by itself, creates a new DPABI_ADDWILDCARDROI or raises the existing
% singleton*.
%
% H = DPABI_ADDWILDCARDROI returns the handle to a new DPABI_ADDWILDCARDROI or t... |
d12a5c8a1cd12adf3423f7068ef8cc4184e5dab16915f5df53131ad35082af0c | MATLAB | 5,261 | 90 | function [trainedClassifier2, validationAccuracy,validationPredictions] = LinearDiscriminant(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. U... |
1d78a8ac4d7389c4e445c58d547091050e07547d529407dc06d41a4da8512b08 | MATLAB | 5,262 | 154 | function [lrp] = ft_lateralizedpotential(cfg, avgL, avgR)
% FT_LATERALIZEDPOTENTIAL computes lateralized potentials such as the
% lateralized readiness potential (LRP)
%
% Use as
% [lrp] = ft_lateralizedpotential(cfg, avgL, avgR)
%
% where the input datasets should come from FT_TIMELOCKANALYSIS
% and the configurati... |
994a941baa06bee3713bf35bed3abc7a7d78905ed792f4d2890373e8d59fbbab | MATLAB | 5,262 | 154 | function [lrp] = ft_lateralizedpotential(cfg, avgL, avgR)
% FT_LATERALIZEDPOTENTIAL computes lateralized potentials such as the
% lateralized readiness potential (LRP)
%
% Use as
% [lrp] = ft_lateralizedpotential(cfg, avgL, avgR)
%
% where the input datasets should come from FT_TIMELOCKANALYSIS
% and the configurati... |
3bf3f6414a368f9aae187ba147b59b7554b01cb90fb6d97eecb5864c474dc924 | MATLAB | 5,263 | 178 | function fileInfo = czifinfo( filename, varargin )
%CZIFINFO returns informaion of Zeiss CZI file
%
% czifinfo returns information of czi file includingl pixel type,
% compression method, fileGUID, file version number, a structure
% recording various information of raw image data including data start
% positi... |
7960d9611c27697f41f0348b9d5e4cf5ad1f15638dbf6e7f1ff3ff3f17da16b8 | MATLAB | 5,263 | 157 | function U = create_guess(varargin)
%CREATE_GUESS Creates initial guess for CP or Tucker fitting.
%
% U = CREATE_GUESS('Param',value,...) creates an initial guess at the
% factor matrices for a CP or Tucker decomposition. The factors can be
% generated randomly, random orthogonal, etc. If the tensor is provided,
% ... |
5c9f2ff5661e9869c9058b675320c359147e72774bda71fb68366d9bb1ebabae | MATLAB | 5,264 | 173 | %% conformsdo
%
% For a recovered stochastic dynamic operator to behave linearly for
% composition and prediction, (and to predict outside of the original bounds
% for whch it was created), it must not violate some underlying assumptions:
% 0) The overall magnitude of sdo must not exceed 2
% 1) Each column must su... |
8930723a4b8dc96bee19051dba6466ba0e8cb5587277553d5b318c5606823afd | MATLAB | 5,264 | 127 | function CFC_plot(config)
% CFC_plot creates ROI x ROI heatmap of CFC values for all specified
% participants and visits, from data calculated by Step4d_CFC
%
% Configuration structure (config.CFCplot) must contain:
% pids: patient ids to be included in heatmap
% visitnum: cell array containing visit number... |
de388c3af899dc40d40dba286366c25c3674d664fe952a9c83dfa095439020d4 | MATLAB | 5,266 | 198 | % plotfresp() - Plot a filter's impulse, step, magnitude, and phase response
%
% Usage:
% >> plotfresp(b, a, nfft, fs, causal);
%
% Inputs:
% b - vector numerator coefficients
%
% Optional inputs:
% a - scalar or vector denominator coefficients (IIR support is
% experimental!) {default 1}
% nf... |
c1a06ad17a54d7c4a601ff08d77fd5f14c4f65d20778198a3fd89884cbb64d6f | MATLAB | 5,269 | 151 | function CBIG_MFMem_rfMRI_DrawBarchart_W_Desikan68_into_Yeo7_fsaverage5()
%-------------------------------------------------------------------------
% CBIG_MFMem_rfMRI_DrawBarchart_W_Desikan68_into_Yeo7_fsaverage5
%
% show mean value of W in Yeo's 7-network
% what to do?
% 1) give the value of W to each voxel, accord... |
eadc77a694da05343585d4d28a524e6c041af8336e1d3f41f4dab839b032e0af | MATLAB | 5,269 | 130 | % FT_PREAMBLE_INIT is a helper script that is used at the start of all FieldTrip main
% functions. It checks whether the user specified at lease one input arguments (i.e.
% the cfg) or shows the help of the calling function. It merges the global defaults
% with the cfg. It checks whether the output file already exists ... |
3b381afc472253514a1b0360ebdba90547184be44eb57163f1018f0a074b0ace | MATLAB | 5,270 | 135 | % demo for SingleRoomDRIR: save DRIR data from Uni Oldenburg (Office II) as
% SOFA file and plot the speaker and listener positions.
% It uses conventions SingleRoomDRIR and RoomType 'shoebox', defined by
% RoomCornerA and RoomCornerB.
% SOFA API - demo script
% Copyright (C) 2012-2013 Acoustics Research Institute - ... |
793dbceea2998220a672a2e25268d6ca02454f72340ec45ff64d9852a6a76847 | MATLAB | 5,273 | 202 | function [hfigs,savenames,errprctiles] = PlotPerLandmarkErrorPrctiles(varargin)
[errprctiles,gtdata,nets,legendnames,colors,colorfracprcs,exptype,...
conddata,labeltypes,datatypes,...
maxerr,prcs,...
pttypes,...
hfigs,figpos,savedir,savenames,dosavefig] = myparse(varargin,'errprctiles',{},'gtdata',[],...
'ne... |
8d3d0e89dec0c0c5a624d69990bee87dface7a6b2a8611ed3d3579236aac8cb8 | MATLAB | 5,273 | 142 | % Seven-point stencil on the unit cube, constant-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is basically the 3D analogue of FD_SQUARE1.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of points + 1 in each dimension (default: N = 32)
% - OCC: tree occupancy ... |
5ebdb19ca9a2abaf561a5ddc766849ad1b731a77fb347b5afea889a3ba1cf4b4 | MATLAB | 5,276 | 208 | %% generate manuscript figures
% April 2021
%% setup
expt = 'TANoise';
p = meg_params('TANoise_ITPCsession8');
[sessionNames,subjectNames,ITPCsubject,ITPCsession] = meg_sessions(expt);
t = p.tstart:p.tstop;
toi = p.eventTimes(1):p.eventTimes(4); % time of interest: precue -> response cue
tBuffer = 100;
toiBuff... |
6d5949194294413206f0df0b9ea7da20eee8680be5a8a5d82c30f46d31588c65 | MATLAB | 5,276 | 121 | function params = CBIG_AuthorTopicEM_Inference(act, paradigm_by_exp, params)
% params = CBIG_AuthorTopicEM_Inference(act, paradigm_by_exp, params)
%
% Runs Expectation-Maximization (EM) algorithm to estimate parameters of the author-topic model
%
% Input:
% - act = E x 1 cell where E is the number of experim... |
fbb8230cc1817664924c51c33efe50351c18e7074e938213d2c1297dbedf20b7 | MATLAB | 5,276 | 127 | function [h2sens, ds2sens] = ft_sensinterp_openmeeg(pos, headmodel, sens)
% FT_SENSINTERP_OPENMEEG creates a volume conduction model of the
% head using the boundary element method (BEM). This function takes
% as input the triangulated surfaces that describe the boundaries and
% returns as output a volume conduction m... |
75417379e302d5c033c5c798a7d251594f9c8ac9cd80c313d5705ba7b46b334e | MATLAB | 5,277 | 129 | function [BLA_PET] = BLA_PET_atlas(PET_scan,MRI_atlas)
save_imgs = 0;
%% Slices
% Column 1 - left
regions = cell(12,2);
regions{1,1} = [76 33;68 32;61 34;54 39;51 43;52 47;54 48;59 46; 67 40]; %slice=106
regions{2,1} = [76 33;68 32;61 34;54 39;51 43;52 47;54 48;59 46; 67 40]; %slice=107
regions{3,1} = [76 33;68... |
c8f5709d6fe23ac23f0974b10e9330f6491b98771623fe0fa797b78127a3b89d | MATLAB | 5,278 | 142 | function xyzshift = calculate_xyzshift(A1, B1, pixel, rmax, xyzshift, distance,flag)
%calculates xyzshift for each synapse based on shared reference channel
% function [xyzshift, d, 0, g] = get_crosscorr_3dMatrix(A, B, pixel, rmax, xyzshift,distance,flag)
% calculates crosscorrelation function between two 3d Matrix
% ... |
5e71e4cfaff660f737d117ef82a209215140a4f673f8bc3265fc22ee03893baa | MATLAB | 5,281 | 1 | % TSPARSE Flexibly extract information from time stamped data.
% TSPARSE(TSDATA,MCODE,MATCHCODES) evaluates MCODE based on matching
% CODELIST in TSDATA. TSDATA represents the TSData. MCODE denotes the
% Matlab code that will be executed when a match is found. This code
% should set the variable result to ... |
6c6df712903163429c518493bb821727e8c239bacf264f6561a8ddeda7482b48 | MATLAB | 5,281 | 152 | % First-kind integral equation on the unit square, Laplace single-layer.
%
% This example solves the Poisson equation on the unit square by using a single-
% layer volume potential, which yields a first-kind volume integral equation.
% The problem is discretized on a uniform grid, with simple point-to-point
% quadratur... |
789f6184c14beef1db1085c90dc282b479aaac765e64b1192739e8728866acab | MATLAB | 5,284 | 162 | function [ Total_Muscle_Fatigue ] = Cost_Function (xopt)
% 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 M-file minimizes muscle fatigue: (FMT/PCSA)^3
% Act:... |
23f8d4ab2f20a989e8d3afc36d61a0f6b85c4ebe34b6e00196fcfd57a9834e9e | MATLAB | 5,285 | 160 | function [ftver, ftpath] = ft_version(command)
% FT_VERSION returns the version of FieldTrip and the path where it is installed
%
% FieldTrip is not released with version numbers as "2.0", "2.1", etc. Instead, we
% share our development version on http://github.com/fieldtrip/fieldtrip. You can
% use git to make a loca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.