sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
7e0b431563420516b46a37b0422f7ac2f1bedc686b3d7be78ab633ccf052a7f4
MATLAB
6,090
127
function out = nk_mapY2Struct(mapY, permutefl) if ~exist('permutefl','var') || isempty(permutefl), permutefl = true; end global FUSION switch FUSION.flag case {0,1,3} out = mapY; case 2 % Concatenate modality structure into single multi-modal structure nvar ...
d10bfad0b7a9635da138b64512632339cc6e95b0790fe28f362b6237f66cbc18
MATLAB
6,105
165
<<<<<<< HEAD function y = base64decode(x) %BASE64DECODE Perform base64 decoding on a string. % % BASE64DECODE(STR) decodes the given base64 string STR. % % Any character not part of the 65-character base64 subset set is silently % ignored. % % This function is used to decode strings from the Base64 enco...
6d5e9699648d9b8df95357f51a713955086fa1f28801d44113886d68e08e25fb
MATLAB
6,114
216
function hdr = load_nifti_hdr(niftifile) % hdr = load_nifti_hdr(niftifile) % % Changes units to mm and msec. % Creates hdr.sform and hdr.qform with the matrices in them. % Creates hdr.vox2ras based on sform if valid, then qform. % Does not and will not handle compressed. Compression is handled % in load_nifti.m, which ...
a452c9b1c01d262ed10d14680bc3dab7c4bca3dee14819604c4b0584a7538012
MATLAB
6,135
179
function [opt_hE, opt_E, opt_F, opt_D] = nk_CVMax(E, L, EnsStrat) global BATCH MODEFL VERBOSE ind0 = L~=0; E = E(ind0,:); L=L(ind0); [m,k] = size(E); % Compute initial ensemble performance if EnsStrat.Metric == 2, T = sign(E); else T = E; end opt_hE = nk_EnsPerf(E, L); orig_hE = opt_hE; opt_D = nk_Entropy(T,[-1 1], ...
6b3d0bd8849c60db29d08fa3efae46e960ae631f31957d102c2771b49a598f2f
MATLAB
6,149
207
function all_resppred_map(EventTypes_all,EventTypes) % ALL_RESPPRED_MAP Maps units with all types of behaviorally relevant activity % ALL_RESPPRED_MAP(EventTypes_all,EventTypes) draws a map where each type % of responsive/ predictive unit is presented (rows). Each column represents a % type of behaviorall...
7d1e529dcf6ee9aac28d60bf5cf8f27bf6394333fdbf9d283b30243f2b0ee4e2
MATLAB
6,154
198
% ========================================================================= % FORMAT function [Z, R] = nk_AdjForCovarsUsingLocalModels (SY, S, Sid, TY, T, Tid, ... % tolvec, numsel, wins, act) % ========================================================================= % pe...
ebf2b8735c55105632e2b2618731712cbaee5200e410430ac88c577a8827e598
MATLAB
6,178
132
function [MultiGroupSelection, MultiBinBind] = nk_MultiBinBind(GD, label, f, d, curlabel) global CV RFE %%%% PREPARATIONS %%%% ngroups = numel(unique(label(~isnan(label)))); nclass = length(CV.class{1,1}); [CV1perms, CV1folds] = size(CV.cvin{f,d}.TrainInd); TsXdims =...
d08e1de39d240c8f668a275cf90396a2e159cbf3b546b6e68b8b8ece1c4964c5
MATLAB
6,190
153
function find_dominant_freq_bands(sess2analyse,fr_names,freq_bands,chanmean,subregion) %FIND_DOMINANT_FREQ_BANDS Selects dominant freuency within band limits % FIND_DOMINANT_FREQ_BANDS(sess2analyse,fr_names,freq_bands,chanmean,subregion) % - loads full-epoch normalized, epoched time-frequency data % ...
3751ec06b76373ec4da45a1a771ebb1f807d816fed4af7c1857be72fdf142334
MATLAB
6,193
195
function [x, infos] = ns_nmf(V, rank, in_options) % Nonsmooth nonnegative matrix factorization (nsNMF) % % The problem of interest is defined as % % min || V - W*S*H ||_F^2, % % or % % min D(V||W*S*H), % % where % {V, W, S, H} > 0. % % Given a non-negative matrix V, f...
81132118d30c0e28bac1997203ecda577e54d27b5f60041ad984049ad6275ec4
MATLAB
6,194
150
function [ STANDARD, act ] = nk_Standardize_config(STANDARD, parentstr, defaultsfl) global NM methodarr = {'standardization using median','standardization using mean','mean-centering','l1-median centering','qn-standardization','sn-standardization'}; sIND = []; dIND = []; WINSOPT = []; IQRFUN = 1; ZeroOut = 1; CALIBUSE...
a4283ba7ac973841558f42e1318578d7e129aa015b15d5fa0fb773c622a0e3d6
MATLAB
6,198
208
function [Y,numIter,tElapsed,finalResidual]=vsmftest(testSet,outTrain) % Versatile NMF to test samples % Definition: % [A,Y,AtA,numIter,tElapsed,finalResidual]=vsmf(X,k) % [A,Y,AtA,numIter,tElapsed,finalResidual]=vsmf(X,k,option) % X: matrix, dataset to factorize, each column is a sample, and each row is a feat...
d7b7867a24d0d1c67cbcf7a8a2cfb449d719f9a94d91a8d4272dd452b18f9212
MATLAB
6,200
219
% SB2_POSTERIORMODE Posterior mode-finder for the SPARSEBAYES algorithm % % [MU, U, BETA, LIKELIHOODMODE, BADHESS] = ... % SB2_POSTERIORMODE(LIKELIHOOD,BASIS,TARGETS,ALPHA,MU,ITSMAX,OPTIONS) % % OUTPUT ARGUMENTS: % % MU Parameter values at the mode % U Cholesky factor of the covariance at the mode % BETA V...
529483a21b9e9dce18032c977ce117e3cfede788777c3143544dfddfc1ba826e
MATLAB
6,212
106
clear; % Clear workspace variables clc; % Clear command window % Initialize a tracking table to store step names and counts stepTracking = table('Size', [0 2], ... 'VariableTypes', {'string', 'double'}, ... 'VariableNames', {'Step', 'ItemCount'}); %% First Step: Data Combining and Cleaning Based...
e4e5fdbb5cbfe079fad3da664a8507e9d46a9511df9bba0295b76b9c8c1bdec0
MATLAB
6,222
181
function ProceduralPolarGratingDemo(color1,color2,baseColor) % ProceduralPolarGratingDemo() -- demo polar grating procedural shader % stimuli, the shader is based on the colour grating shader, see % ProceduralColorGratingDemo for details. % % History: % 20/05/2021 initial version (Junxiang Luo) if ~exist('color1','var...
2b18d5b7d8d7c4583422152e94b3941c2c3a3d984647b6f13e8e54a8a4033277
MATLAB
6,257
253
<<<<<<< HEAD function r = save_mgh(vol, fname, M, mr_parms) % % save_mgh(vol,fname, M, <mr_parms>); % % M is the 4x4 vox2ras transform such that % y(i1,i2,i3), xyz = M*[i1 i2 i3 1] where the % indicies are 0-based % % mr_parms = [tr flipangle te ti] % % See also: load_mgh, vox2ras_0to1 % % % % save_mg...
c73733f18eba597fda1cf615c57a28ebfdd6174ce1a8e74d54dbe1ee38ab133f
MATLAB
6,272
184
classdef reduced_ly < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit % Note that this does sum over k properties kmax k0 k2u k2_volconduct...
0491a5e250da7d60dcffa902305ba923e15de9cd3dc14e9fe43281d38e3c6ebe
MATLAB
6,281
187
function [r_p,wat_pup,ftm,mu,bestmod,mufit,kappafit,pfit] = ... PC_figstat3(sp_hilb,smwin,act_cellid,event,figdir,isplot,fignm,plottype, components) %PC_FIGSTAT3 Population phase histogram plot with statistics % % Input parameters: % SP_HILB vector of complex or numeric values; % ...
e6f0257c7e47cee4621126ccdddee5195b0e49a0a7b9391f61d065402532c5a6
MATLAB
6,283
237
%% FUNCTION Least_CFGLasso % Fused Group Lasso Progression Model with Least Squares Loss. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * \|W\|_1 + rho2 * \|W*R\|_1 + % + rho3 * \|W\|_{2,1} } % where % rho1: sparse. % rho2: fused Lasso. % rho3: L...
58f6866a5c876bd61d6184c5512facdd0c0606ee660d1dac309cbce3015b935d
MATLAB
6,297
239
%% FUNCTION Least_Weight1FGLasso % Weighted Fused Group Lasso with Least Squares Loss. % %% OBJECTIVE % argmin_W { \sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + \sum_i^d rho1{i} * \|W(i, :)\|_1 % + rho2 * \|W*R\|_1 % } % rho1: reweighted Lasso sparse. % rho2: fused Lasso. %...
a8940cbecd267fe5f5570a3ff7e733e7d2d54d27f7e5e53e0f90018b081d421b
MATLAB
6,300
194
% to verify if triggers are detected and filter and epoch raw data % subject-wise analysis % subject = 'annesh'; % 10th block for Annesh has missed a trigger function preprocess (subject) for w = 1:15 % w = blocks close all; clear trigger_data; clear filtered_data; clear image_data1; ...
803c3d4bdbf61541b9e924acc0f9810792fb9276768d9624f7ad2dd1a0644f8f
MATLAB
6,304
217
function [x,y,z,info]=csdp(At,b,c,K,pars) % CSDP Uses CSDP to solve a problem in SeDuMi format % % [x,y,z,info]=csdp(At,b,c,K,pars) % % Uses CSDP to solve a problem in SeDuMi format. % % Input: % At, b, c, K SDP problem in SeDuMi format. % pars CSDP parameters (optional parameter.) % % Ou...
6f9e337676380e35fdf01cb2106ca7e4b839e3dd2f76df81a53f4c12e6c7ac05
MATLAB
6,312
175
function [D, I] = TransferModality2NM(D, I, varind) % Write IO data to D if (~isfield(I,'oocvflag') || ~I.oocvflag) && isfield(I,'modeflag'), D.modeflag = I.modeflag; end if isfield(I,'Y') % Check whether multiple modalities have to be imported if iscell(I.Y) nM = numel(I.Y)-1; m = size(I.Y{1},1)...
35f1f4d049f7a3c8e4731b2363c93e8e15f58ce9152777ebeb501047fa25769e
MATLAB
6,318
189
classdef ManualCutter < MClust.Cutter % ManualCutter properties (Constant) nStepToAutosave = 10; maxUndoRedo = 10; end properties % --- windows % --- process Autosave = MClust.ManualCutter.nStepToAutosave; % countdown, when reaches 0 autosaves ...
82b84c696e48b6479dac077b14aeb9507e28760fe44eafca272386a0c1510870
MATLAB
6,326
190
function [x, infos] = nmf_sparse_mu(V, rank, in_options) % Sparse Multiplicative upates (MU) for non-negative matrix factorization with orthogonalization (Orth-NMF). % % The problem of interest is defined as % % min || V - WH ||_F^2 + lambda*sum(sum(H)), % % or % % min D(V||W*H) + lambda*...
f02abe2d87f9676bb60b306d8f74c4d6c7cab34912057f826aba6e425b53175b
MATLAB
6,327
172
function [testExtr,outTest,time]=featureExtrationTest(trainSet,testSet,outTrain) % map the test/unknown data into the feature space produced by function "featureExtractionTrain". % testSet: matrix, each column is a test/unknown sample. % outTrain: the output of "featureExtractionTrain" function. % testExtr: the test/un...
20d4db0d55cc481afcfd8d2d13becf85f85d3c9e2e8451cab866796d1bbb7109
MATLAB
6,330
116
function handles = load_OOCV(handles, oocv) cnt=1; l = handles.selLabel.Value; % Loop through all OOCV containers for n = 1: numel(oocv) % If analysis has been applied to OOCV container, retrieve predictions % and prepare export tables if ~isempty(oocv{n}) handles.OOCV(cnt).num = n; ha...
a16ea6fba6c8c419f8db78cc37d9c234819e43b4af4569f21143a847bba1d587
MATLAB
6,330
159
%% Brainstorm Post-processing Batch (Subject 01–20) %% ===== USER SETTINGS (modify before running) ===== data_dir = '/path/to/ds004995'; eeglab_dir = fullfile(data_dir, 'derivatives', 'eeglab'); reports_dir = '/path/to/reports'; subjects = 1:20; % =================================================== sFiles = [...
0384d7d8930ee0c26db2cdfb54ebd9532082deaa97b7eb858ec77a154e9e5644
MATLAB
6,331
180
classdef (Abstract) template < matlab.mixin.Copyable % These properties are SetAccess protected to ensure that the MCMC functions % are properly independent of the choice of model properties(SetAccess = protected) % Public access, but can only be edited via the interface name n_params param_names param_...
29a976b4c35d8fdbd01a781b835cdb1a1970e805feee3d51ab29337bd200f513
MATLAB
6,335
129
function [REMVARCOMP, PX] = nk_Remvarcomp_config(NM, varind, REMVARCOMP, PX, parentstr) [m, ~] = size(NM.Y{varind}); corrmeth = 1; corrthresh = 0.5; corrcrit = 'corr'; varop = 'gt'; recon = 2; varops = {'gt','ge','lt','le'}; recons = {'yes', 'no'}; corrmeths = {'Pearson','Spearman','ANOVA'}; corrcrits = {'corr','p...
3798c60f1d3ff7cd96af3dd8dc5665d653ecc688c05cc63105a507ea932707e0
MATLAB
6,346
153
% ========================================================================= % = MULTI-GROUP CLASSIFICATION PLOTS = % ========================================================================= function handles = display_multiclassplot(handles) axes(handles.axes1); %uistack(handles.ax...
d0cd1704051ac4aa8d5a51d7cebba582cbc11b2aef2bca9986f9bd020d0af232
MATLAB
6,357
202
function [x, infos] = smu_nmf(V, rank, in_options) % Stochastic multiplicative update for non-negative matrix factorization (SMU-NMF) algorithm. % % Inputs: % matrix V % rank rank % options options % Output: % w solution of w % infos information % % % Cr...
c34699c4785211a88cc2e7c96d688f48a8a65e8123b5ddf30868346f895e9435
MATLAB
6,365
162
function [MULTI, act] = nk_Multi_config(MULTI, defaultfl, parentstr) % function res = nk_MULTI_config(res) % % Setup parameters for multi-group classification % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (c) N. Koutsouleris 04/2015 global NM if ~exist('defaultfl','var') || isempty(defa...
870cdd56413f6e4734ede6979f79848853c1c65b96c40d215477613868b2bccf
MATLAB
6,368
101
function VTBL = create_visdata_tables(v, VTBL, ind, act) if ~exist('act','var') || isempty(act) error('Action string is required') elseif strcmp(act,'reorder') && ( (~exist('VTBL','var') || isempty(VTBL)) || (~exist('ind','var') || isempty(ind)) ) error('Table data or sorting vector missing') end switch act ...
2f6c97559eac9ed0090029067da5462da88f140f7b4870fe24f64cc0f371cf85
MATLAB
6,372
166
function [Emtx_all] = gen_mussel_encodemtx(sentiv_map, grp_idx, header, varargin) %function [Emtx_all] = gen_mussel_encodemtx(sentiv_map, grp_idx, header, varargin) % % Wei-Tang Chang, UNC-Chapel Hill % May 28, 2019 % % Usage : generate the encoding matrix of MUSSEL % Input arguments: % sentiv_map: the sensitivity...
411c194ea4525076266e54dfa7830cbd8f532f094ad65a3f02daa8a311b66a42
MATLAB
6,389
177
function TE = PD_nosyncTE(Results,interp) %PD_nosyncTE extracts behavioral information of behavioral analysis % PD_nosyncTE(Results,ifinterp) extracts behavioral information from % RESULTS struct (data provided by the SSRT task algorithm, see Task_SSRT.m). Event timestamps % are NOT SYNCHRONIZED with EEG dat...
5a7f0e3637a07bde9b5dd3053f10b38e5a46c94711a5ce4126df9d7073cf15e6
MATLAB
6,389
90
function ProcessedData = removeJunkRecordings(a,sw,plxFileName,ProcessedData) % This function allows the user to delete recording segments that should not be part of the anaysis % For example, if life support was being connected during the first few minutes of the recording, % or if life support failed at the record...
a98074db12abe57a930b62944a1a55cbed1d1f6d4312c5760ad9ec7ac25d64fb
MATLAB
6,393
192
function obj = subsasgn(obj,subs,dat) % Overloaded subsasgn function for file_array objects %__________________________________________________________________________ % Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging % % $Id: subsasgn.m 7147 2017-08-03 14:07:01Z spm $ if isempty(subs), return; end %...
b8239f818577840a5d82237d0765cc278c3206d4846890dceb4288b7c4b756a6
MATLAB
6,399
156
%% ================================================================ % Script: consistency_variability_analysis.m % Purpose: % Assess cross-subject consistency (MSC dataset) and inter-individual % variability (HCP dataset) of FOCA matrices. % % Description: % - Part I: MSC dataset — compute pairwise correl...
80d96b48c8c729d5d9cbcaac8d7ddcf9c1190b12f2a400c9e52de9a795e7dc26
MATLAB
6,402
200
function palm_miscwrite(varargin) % Write various scalar data formats based on the struct X. % % palm_miscwrite(X); % % See 'palm_miscread.m' for a description of the contents of X. % % _____________________________________ % Anderson M. Winkler % FMRIB / University of Oxford % Aug/2013 % http://brainder.org % - - -...
5684f26398475a40bd98f261a18344d6ee8bf69f853acfc61a577fcf228fa447
MATLAB
6,407
143
function mtSVMs_wOptNcv_1vO_insula_linear_domain_m2(task_id) % For Discovery job % Toolbox addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/MediationToolbox')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/Neuroimaging_Pattern_Masks')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modu...
6e8a48c7df2509b6ce80158f364b4e43bf75351c0c7141935940d06bce6a4cb8
MATLAB
6,413
202
classdef KKCluster < MClust.ClusterTypes.DisplayableCluster % % Cluster type for KlustaKwik selection cutter % % This is an unmodifiable displayable cluster, that remembers % whether it should be kept or not. % % Because the spikelist cannot change, it remembers its % averagewaveform p...
7846b1aa6709ec28512ee04e987016413e698b63db68b8509e07151fde036068
MATLAB
6,413
189
function mappedX = cfa(X, no_dims, no_analyzers, no_iterations) %CFA Performs manifold charting on dataset X % % mappedX = cfa(X, no_dims, no_analyzers, no_iterations) % % Performs manifold charting on dataset X to reduce its dimensionality to % no_dims dimensions. The variable no_analyzers determines the number of ...
00c469ae039703016a44b0a52c42eb2b53778112cfa0f4f8ab9f0c798d9f7f25
MATLAB
6,435
185
function NMFBicHeatMap(Xout,Aout,Yout,indACluster,indYCluster,k,option) % Draw the heatmap for the result of biclustering % Usuage: % NMFBicHeatMap(Xout,Aout,Yout,indACluster,indYCluster,k) % NMFBicHeatMap(Xout,Aout,Yout,indACluster,indYCluster,k,option) % Xout: matrix, the same as the output "Xout" of function "biClus...
37ee7a2177d7959b746a9c85c74acee9280cbbe7ea595894a87460ba94b05ca6
MATLAB
6,438
185
function varargout = nk_main(varargin) % NK_MAIN MATLAB code for nk_main.fig % NK_MAIN, by itself, creates a new NK_MAIN or raises the existing % singleton*. % % H = NK_MAIN returns the handle to a new NK_MAIN or the handle to % the existing singleton*. % % NK_MAIN('CALLBACK',hObject,eventData,...
67ebff7d9ec72a473909e6dd05240d721f9d2190ef6410efd2e385e2edb20619
MATLAB
6,440
220
function [ x, f_x, output ] = pnopt_sparsa( smoothF, nonsmoothF, x, options ) % pnopt_sparsa : Structured reconstruction by separable approximation (SpaRSA) % % $Revision: 0.8.0 $ $Date: 2012/12/01 $ % REVISION = '$Revision: 0.8.0$'; DATE = '$Date: Dec. 01, 2012$'; REVISION = REVISION(11:end-1); DATE = DATE(...
6b3eee00eb9c14d969435b8a271e6f08ae25f467d3bbafa069a126a694c15718
MATLAB
6,453
207
%% run_oracle_val_sweeps.m % Hyperparameter sweeps for VMD, SSA, DWT, and optionally CEEMDAN on bench_val. % % For each method & configuration: % - decompose N_tune validation samples, % - oracle-reconstruct to the clean target, % - store per-sample RMSE / RRMSE / PCC, % - compute mean / std summaries, % - me...
1903cde876b3254ae0747a148b6837cfeeb01300fbbe99cae0e21ff9e9f9bfdc
MATLAB
6,465
229
function [init_factors, init_factors_opts] = generate_init_factors(V, rank, options) % V = WH + R m = size(V, 1); n = size(V, 2); init_factors_opts = []; %% generate W and H generate_wh_init = true; if isfield(options, 'x_init') if isfield(options.x_init, 'W'...
8c9a9d785df4d32ea63877bc877c95fc9dc8762c5488e46ff33cb12ee1391866
MATLAB
6,472
203
function [x, infos] = symm_newton(V, rank, in_options) % Symmetric non-negative matrix factorization by Newton's method (Symm Newton). % % The problem of interest is defined as % % min || V - WH ||_F^2, % where % {V, W, H} >= 0, and W is close to H'. % % Given a symmetric non-negative mat...
b4028a65f3fd3ab04a5e4fca02915fb30c0c32fcbaf5608d827243e5f8320aae
MATLAB
6,477
206
tic subj = 's36'; ExpDate = '061130'; MainDIR = ['~/liang/' subj '_' ExpDate '/']; % subj = 's31'; % ExpDate = '061020'; % MainDIR = ['~/liang/' subj '_' ExpDate '/']; SR = 500; %sampling rate of EEG when RECORDING A=[]; B=[]; C=[]; D=[]; E=[]; F=[]; A3=[]; A4=[]; A = importdata([MainDIR subj '_' Exp...
2f9f2dbe1b1af906f75f3581e734146788aa5d508f49ebaf4f293b7007d83b06
MATLAB
6,483
164
function [ GD, MD ] = nk_MLOptimizer_ParamAnnealer(GD, MD, DISP, Ps, Params_desc, mapY, algostr, f, d, npreml, nclass, batchflag, combcell) % ========================================================================= % FORMAT [ GD, MD ] = nk_MLOptimizer_ParamAnnealer(GD, MD, DISP, Ps, ... % Par...
4d78c3648b2cf146bf975a4a7818502826f93670caeb6d937ae75d85284fe779
MATLAB
6,488
180
% Convert a native Python variable to an equivalent native MATLAB variable. % {{{ code/matlab_py/py2mat.m % This code accompanies the book _Python for MATLAB Development: % Extend MATLAB with 300,000+ Modules from the Python Package Index_ % ISBN 978-1-4842-7222-0 | ISBN 978-1-4842-7223-7 (eBook) % DOI 10.1007/978-1-...
b8314c7a4bcc4f914a73db41b3900f5ba1d3c0a97d9e6a741f2543bf8b5adbb5
MATLAB
6,494
198
function [A,W] = fcn_preserve_degseq_lengthdist(A,Dist,nbins,nswap) % [A,W] = fcn_preserve_degseq_lengthdist(A,Dist,nbins,nswap) takes a % weighted, connectivity matrix, A, and Euclidean/fiber length matrix, % Dist, and generates a randomized network with: % 1) exactly the same degree sequence % 2) approximately the sa...
c636a7688654245a1d1b7f95711a62d3634f6ff6e03e81dab3073044713296d0
MATLAB
6,496
194
classdef reduced < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit % Note that this does sum over k properties kmax k0 k2u k2_volconduct ...
d123c759dad3b2ce852b7b78d9ac4e025fd07dfef8aa01d0fb7a5510f4c584e2
MATLAB
6,499
242
%% FUNCTION Least_Weight2FGLasso % Weighted Fused Group Lasso and Weighted Lasso with Least Squares Loss . % %% OBJECTIVE % argmin_W { \sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + \sum_{i=1}^d rho1{i} * \|W(i, :)\|_1 % + \sum_{i=1}^d rho2{i} \sum_{j=1}^{t-1}* \|W(i, j) - W(i, j+1)\...
6326b3b401be35ee981e695753dea17f292bb3f63e0b386d8f819570bd4b3c44
MATLAB
6,508
165
% ======================================================================== %> @class OptickaGUITest %> @brief Class-based unit tests for the opticka GUI wrapper. %> %> Opens the opticka GUI, loads a protocol from CoreProtocols, configures %> a dummy iRec eyetracker, sets nBlocks, and runs a behavioural task %> using xd...
c2c3395457465cd704ba6e0fea68b9e33c61eb0c93e3312ef984151e63df2f17
MATLAB
6,511
247
%% FUNCTION Least_TGL % Temporal Group Lasso Progression Model with Least Squares Loss. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * \|W\|_2^2 + rho2 * \|W*R\|_2^2 + % + rho3 * \|W\|_{2,1} } % %% R encodes smooth relationship % R=zeros(t,t-1);R(1:(t+1):...
cc5e1b5d4c93dcdb69e250b4d151c0280c8525847038ac667b9c6d7f3e0c9ce9
MATLAB
6,512
197
function result = diana(x,vtype,stdize,metric,plots) %DIANA is a divisive clustering algorithm. It returns a hierarchy of clusters. % % The algorithm is fully described in: % Kaufman, L. and Rousseeuw, P.J. (1990), % "Finding groups in data: An introduction to cluster analysis", % Wiley-Interscience: New York (...
045783ec6a262b8bd2ebd5fe91fde774bcddd01f45130cb679570a580a29f600
MATLAB
6,520
218
function [x, infos] = nmf_sc(V, rank, in_options) % Nonnegative matrix factorization with sparseness constraints (NMFsc) % % The problem of interest is defined as % % min , % where % {V, W, H} > 0. % % % Given a non-negative matrix V, factorized non-negative matrices {W, H} are calculated...
c7948a204153b42ccb0e3ea492e2a1e5f889c45dc93c6a30011cb2942d22b757
MATLAB
6,524
167
function [featmat, emptfl, nvar] = nk_GenPreprocMaster2(datid, cv, mastermat, tdir, basename, savefl, varind, varstr, concatfl, UIopt) % % This function assembles a bunch of paths to preprocessed data files (each file % contains the data of a CV2 data partition) into a single master file. % It allows to combine the pa...
30dd53eaf9de67be29d3f73697789e720fa27d783136694368e5c9b03172dba9
MATLAB
6,534
248
%% FUNCTION Least_SRMTL % Sparse Structure-Regularized Learning with Least Squares Loss. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * norm(W*R, 'fro')^2 + rho2 * \|W\|_1} % %% R encodes structure relationship % 1)Structure order is given by using [1 -1 0 ...; 0...
160b8c87850ba6e4f82ddf40f29ea9dae2a3f4334e00c6afeb3e04e177ade02a
MATLAB
6,538
194
function result = clara(x,kclus,vtype,stdize,metric,plots,nsamp,sampsize) %CLARA is the 'Clustering Large Applications' clustering algorithm. % It returns a list representing a clustering of the data % into kclus clusters following the clara algorithm which is % designed for large data sets. % %The algorithm is fully ...
fa023f06bdeb83a4b675690a8034d4d15ea4b23aa417b3773aad32415791110c
MATLAB
6,548
173
function [optparam, optind, optfound, optmodel] = nk_SimAnneal(Y, label, Ynew, labelnew, Ps, FullFeat, FullParam, ActStr) global VERBOSE TRAINFUNC RFE % ##################################################################### % This code does: % 1) Feature selection using SA % 2) This is a simple code working on 1 singl...
14e26fc40527dca11e5f548e427872380234fefd62e18998108e91301410f4ec
MATLAB
6,581
206
function [x, infos] = spg_nmf(V, rank, in_options) % Stochastic projected gradient for non-negative matrix factorization (SMU-NMF) algorithm. % % Inputs: % matrix V % rank rank % options options % Output: % w solution of w % infos information % % % Creat...
88f9913a8afae9fa7f971ae627335d04b275e4718e987786cb7a31afa3ff275c
MATLAB
6,597
199
%% run corrs to Day1 with same cell set, non-PreHab; by ID clear load('ProcessedData\tables_compiled.mat'); %% Corr to D1 no best sorting figure, t = tiledlayout(1,5,'TileSpacing','Compact'); D_template = tables_compiled{1,1}.Deltas; D_template = D_template.'; trial_cutoff = 8; within = cell(1,5); across = c...
0daf7420548990354e7fdc24b20ef68acd97805a0053c5a7c8b798a771b7a64f
MATLAB
6,603
180
function spike_phase_coupling_MAIN(EventTypes,SubEventTypes,rectype) %SPIKE_PHASE_COUPLING % Calculates the amount of coupling between spiking activity and LFP/ EEG oscillations (SPC), % expressed in mean resultant length (MRL), for each detected unit. SPC is % calculated in time windows around a specif...
259de91608af99a4e710022f09cb20030b3461ce547ac65eb848ac7e2b9a2922
MATLAB
6,647
199
% ======================================================================== %> @brief single disc stimulus, inherits from baseStimulus %> SPOTSTIMULUS single spot stimulus, inherits from baseStimulus %> The current properties are: %> %> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md % ========...
94f521876195577a9cafebc55fe8e262e41a35421ca88857a02b238f82738112
MATLAB
6,659
196
%PARSEMSGPACK parses a msgpack byte buffer into Matlab data structures % PARSEMSGPACK(BYTES) % reads BYTES as msgpack data, and creates Matlab data structures % from it. The number of bytes consumed by the parsemsgpack call % is returned in the variable IDX. % - strings are converted to strings % - numb...
379623b92c6f184be739f2a6468552b098af3860bff515d77b039b8556c4aa2c
MATLAB
6,664
154
function [act, RFE] = nk_RFE_config(act, TrainParam, SVM, MODEFL, MULTI, GRD, defaultsfl, parentstr) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = 0; end if ~isempty(act) || ~defaultsfl if ~isfield(TrainParam,'RFE') || isempty(TrainParam.RFE) [~, TrainParam.RFE ] = nk_RFE_config([],...
245ee9c4bfa37df4ce0cef1ba0013438cf7534ce92a3d4dc9ca4f182c7795a0e
MATLAB
6,670
169
%% mRVM2 % authors: Ioannis Psorakis psorakis@gmail.com, Theodoros Damoulas theo@dcs.gla.ac.uk % Copyright NCR, 2009 % % Use of this code is subject to the Terms and Conditions of the Research License Agreement, % agreed to when this code was downloaded, and a copy of which is available at % http://www.dcs....
d4953f599e497742b8c3c8e72d979945ad20833d8919364550177a077a6ab44f
MATLAB
6,671
191
classdef reduced_l < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit % % This model includes the factors of L in other connections properties km...
e6035652197b5b1e383393f3c25cd4890b302e15ac0f398dabdea505c5057c0e
MATLAB
6,681
196
% Produce Figure 4 panels A and B % (explore circuits of Kuramoto oscillators) %%% comparing different circuits clear; Nneurons = 6; % group size. NumSeeds = 100; % number of repetitions to do with different random seeds %% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%% % paramater space exploration: ScaleInput = 1; % this ...
e9aa2ba149295cd7e7b6486ef3667bc7f943fe87c83fac47481ebc3d54bef982
MATLAB
6,682
217
% traveling_wave_phase_mapping.m % % Public-friendly version of the original hybrid traveling-wave analysis. % % This script: % 1. loads concatenated 4D fMRI data % 2. trims rest periods at the beginning and end of each run % 3. identifies tuned voxels using sinusoidal regression (R^2 threshold) % 4. es...
a40adebfb46451ebc0bb41e1858a0047cf7a905325c911afc9af9f4e5839f750
MATLAB
6,688
140
%========================================================================== %FORMAT [F, Weights, Mx] = EvalSubSpaces(Perf, strout, ... % SubSpaceStrategy, EnsStrat, ... % Crit, minmaxfl, AddPerf, Weighting) %=========================...
e240149517e59c0f4814b6910f6050dcde01e57a13d74452dfc85ad3ba1f1cbb
MATLAB
6,695
288
function [w,L] = sbmlr(x, t, w) % % SBMLR - sparse Bayesian multinomial logistic regression % % ALPHA = SBMLR(X,T) computes the weights for a sparse multinomial % regression model, where the sparsity is obtained using Bayesian % regularisation with a Laplace prior, as described in [1]. Here X is % a matri...
912beb5f63c1559d536e12d65f48afd57e54f85a4a6c84294a36fe76342326bc
MATLAB
6,698
180
function sessionStats = PopulationDistanceDirect(sigArray,sessionName,distMethod,varargin) %% parse inputs winID = 2:5; % default optostimulation window, from post trial start to pre dig (2:5) % if ~isempty(varargin) idx = find(strncmpi(varargin,'window',3)); if ~isempty(idx) winID = varargin{idx+1}; ...
b52ed59b45b1b03c0d0a125e670eba09b7c8ed6156e06e18b45fcd4013b703f1
MATLAB
6,706
82
function trials_post_rating (subject, familiarity_rating) UM_F = [1 10 13 15 16 37 39 40 46 48 62 72 73 74 90 91 97 100 102 113 121 127 129 130 142 151 157 159 172 174 184 200 202 208 210 212 214 220 222 230 241 248 255 257 268 280 282 289 294 296 310 318 328 329 330 331 338 342 355 357 372 373 378 388 390 394 399 4...
8a98611aab139cdac916cd96feee6e8e87051cfc0d62e6837777e2d7942be59b
MATLAB
6,722
148
function mtSVMs_wOptNcv_insula_linear_apptVSaver_domain(task_id) % For Discovery job % Toolbox addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/MediationToolbox')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/Neuroimaging_Pattern_Masks')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/...
2f58a37a7ee7654d9d75fda1835d018e82eeff54c0de1102c64d843bef7ca131
MATLAB
6,750
269
% ====================================================================== %> @brief Input Output manager, a dummy class to allow task to run without %> strobe hardware %> %> %> %> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md % =================================================================...
68dcff26b9d31189cec4c88a0d740ac54e7a73e663638c46e2faa0288517f9cb
MATLAB
6,752
184
function [data, labels, covars] = nk_SynthDistkNN(realData, realLabels, realCovars, IN) if ~exist("IN","var") || isempty(IN) distanceMeasure = 'Euclidean'; k = 5; numSyntheticObservations = 100; std_flag = 2; else distanceMeasure = IN.distanceMeasure; k = IN.k; numSyntheticObservations = I...
25040ca266e3c579c80e7bbed1f88eb7f7a9a8a06a47f7d1c52e8911aaff88cd
MATLAB
6,763
170
%% mRVM1 % authors: Ioannis Psorakis psorakis@gmail.com, Theodoros Damoulas theo@dcs.gla.ac.uk % Copyright NCR, 2009 % % Use of this code is subject to the Terms and Conditions of the Research License Agreement, % agreed to when this code was downloaded, and a copy of which is available at % http://www.dcs....
9d846eb356742d64a8218699306d19fc6b73d2682607e5601a6d38f74ec82df8
MATLAB
6,768
223
function result=csimpls(x,y,varargin) %CSIMPLS performs Partial Least Squares regression using the SIMPLS % algorithm of de Jong (1993). % % Reference: % de Jong, S. (1993), % "SIMPLS: an alternative approach to Partial Least Squares Regression", % Chemometrics and Intelligent Laboratory Systems, 18, 251-2...
78b28e7bbdaf453e8669406cb8c9da277f1ec6f498a089dadfecaabacc811fbb
MATLAB
6,773
117
function plotCorrelograms(Correlograms,AnalysisRegions,RecordingMetrics,ProcessedData,plotProps) %This function plots correlogram of specific comparison vs. reference signals that are specified by the user donePlottingCorrelograms = 0; %initialize the logical indicating whether the user is finished plotting correlo...
6b12ce4e1419a02ff28c8977d43c9b2dbd5355f1abe7dde4a1332f61743b2852
MATLAB
6,779
181
function param = nk_Kernel_config(param, defaultsfl, translatefl) global DEV if isfield(param,'kernel') kerndef = param.kernel.kerndef; else kerndef = 1; end if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl=0; end if ~exist('translatefl','var') || isempty(translatefl), translatefl=0; end switch...
767848def18677a01e1da33ca6e6943982fcacbb3aaef185fe90411b8f2c272a
MATLAB
6,780
147
%========================================================================== %FORMAT o = TransferResults( I, O, Param ) %========================================================================== %Subfunction of OptimCore % %Generates output array from OptimCore processing results %%%...
4b0191bc8be71aef5be8a9daf255a9eebeba9689d444a3ce227031794f5176fb
MATLAB
6,802
193
classdef full < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit properties kmax k0 k2u k2_volconduct stab_gamma_prefactor spec_gamma_pr...
662fb26217e1cc9959290898fd2055a830719286f2423464014f8ae79fa3c00a
MATLAB
6,815
154
%% Pipeline for the proper concatenation of miniscope data across sessions % Developed by Daniel Almeida Filho Mar/2020 (SilvaLab - UCLA) % If you have any questions, please send an email to % almeidafilhodg@ucla.edu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Parameters %%%***...
7caa6530c1c2f3320ac6aba4b06895203eca963381e26a7d6d8d04cac6d3fa2f
MATLAB
6,819
148
function mtSVMs_wOptNcv_1vO_insula_linear_subd(task_id) % For Discovery job % Toolbox addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/MediationToolbox')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/Neuroimaging_Pattern_Masks')); addpath(genpath('/dartfs-hpc/rc/lab/C/CANlab/modules/s...
1604b9654b472e4f7943a0a14f6b6063fc78bd83b7fe1c02ead98e4d371c0550
MATLAB
6,840
218
function [Weight, tElapsed] = IMRelief_Sigmoid_FastImple(patterns, targets, distance, sigma, lambda, tmax, plotfigure, verbose) %IMRelief_Sigmoid_FastImple: fast implemetation of IMRelief_Sigmoid %-------------------------------------------------------------------------- %INPUT: % patterns: training data: [x1,x2,....
3c4940158f6a6090301957b99da70f1f8645c72b06412611b87d6489f44195d7
MATLAB
6,841
193
classdef full_gee_extended < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit properties kmax k0 k2u k2_volconduct stab_gamma_prefactor ...
e869e41d326a53de8e86acc3698e5e43c03ac9fcdc1ddc34994b8fe2101c54b1
MATLAB
6,847
124
%This script was used to make figure 1 of %% TO RUN THIS SCRIPT... % FIRST RUN Main_AnalyzeRecordingData.m ON SMJM_Bicuculline. % THEN RUN THIS SCRIPT WITHOUT CLEARING ANYTHING. %% %Below is copy/pasted from generateCorrelograms.m, except for the plotting. CorrelogramBins = linspace(-plotProps.correl...
be089ef4cfa55df7b0f3e1277972b70bc60081df0fe3f87e3a96f8787897998b
MATLAB
6,858
191
% ========================================================================= % FORMAT cv = nk_CVpartition(nperms, K, Labels, Constraint, Eq, AutoAdjust) % ========================================================================= % This function generates nperms*K partitions of data % using cross-validation resampling % ...
dc73297308792ee470af70f34fd6dfe7e1a0a6c51dc39071144e574fa6c22486
MATLAB
6,873
225
function result = adjustedoutlyingness(x,varargin) %ADJUSTEDOUTLYINGNESS calculates the 'Skewness-Adjusted Outlyingness'. % The method searches for outliers in multivariate skewed data % (thus without assuming elliptical symmetric). % It is based on the outlyingness measure of Stahel and Donoho (1981, 1982) % and on t...
1ffce05f72287cf183475d0dd3b85901595753956cb992114ead1c80614a42bb
MATLAB
6,882
146
% ----------------------------------------------------------------------- % % FUNCTION "customcolormap" defines a customized colobar given the % % positions and the colors that are going to generate the gradients. % % % % Input pa...
5310320f43cd26e03cbc39f659920b079ff4e344c4cc1ef51c88d90273bb507e
MATLAB
6,887
180
%% ================================================================ % Script: brain_axes_prediction_FOCA.m % Purpose: % Test whether internetwork covariance (FOCA) is shaped by % fundamental cortical organizational features using multiple % linear regression with 10-fold cross-validation. % % Descriptio...
36c73b5ca5e9afce62e3c1d164bfb86b20090ee1073514f4ca5e0790ccf5a36c
MATLAB
6,891
140
function [act, param] = nk_Wrapper_config(act, param, SVM, MODEFL, GRD, MULTI, defaultsfl, parentstr) % % Defaults % -------- % Activate feature filtering wrappertypes = {'Greedy feature selection', ... 'Simulated Annealing', ... 'Genetic algo...
b5aed654bc770ccef95252142e92d2cfcd7230cc004d336439600a6cf7bb4a5a
MATLAB
6,900
196
function mp2rage_run_remove_background(rmbg) %MP2RAGE_RUN_REMOVE_BACKGROUND Executable job that removes background noise for mp2rage UNI image. % % Method 1: % --------- % Use a INV2 as pseudo mask. No user tuning required. % Based on https:https://github.com/srikash/3dMPRAGEise.git % % Method 2: % --------- % The cor...
2f35fb7af841ffcb13d4e223fa3469406211f78853dd7782e6b61b9f1952c2f1
MATLAB
6,904
204
function [s, surrs, rots] = calc_eigenstrap(s, varargin) %% CALC_EIGENSTRAP Calculate eigenstrapped surrogate maps %% Syntax % s = calc_eigenstrap(s, 'map', map); % s = calc_eigenstrap(s, 'mapName', mapName); % s = calc_eigenstrap(___, Name, Value); % [s, surrs, rots] = calc_eigenstrap(___); % % %% Descript...
0684a8ebc0b736d640317c99874595d873a2cb87315a0fef2da2e8d6b3fdfb46
MATLAB
6,908
213
function [sY, IN] = nk_PartialCorrelationsObj( Y, IN ) % ========================================================================= % FORMAT [sY, IN] = nk_PartialCorrelationsObj( Y, IN ) % ========================================================================= % Remove nuisance effects IN.G from Y (opt. using predefin...
f10c871299ec60a82328140ccd05a7c3f06f7f407dc0aa1c8dbafdf10e73fed8
MATLAB
6,924
195
classdef full_gdiff < bt.model.template % This model is set up to fit t0 keeping the prior fixed if the alpha peak is not present % Note that prepare_for_fit must be used before spectrum() can be used % Uniform priors and DB initial fit properties kmax k0 k2u k2_volconduct stab_gamma_prefactor spec_ga...
dd3b38507b5c02a0e6e0b2dc5091c755efe3f69c60f31a4761960ff4fc331c83
MATLAB
6,928
201
function [Y,maskstruct,Yisvol,Yissrf,Ykindstr,Ytmp] = palm_ready(Yfile,maskstruct,opts,removecte) % An intermediate function to read input data (-i) and % voxelwise EVs (-evperdat). % % Usage: % [Y,maskstruct] = palm_ready(Yfile,maskstruct,opts) % % Inputs: % - Yfile : Filename to be read. % - maskstruct : Mask st...