sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
47628440d67edffdd8008c0cd6f56815681038ae5b39ecbf86b04e64df9c6c18
MATLAB
6,931
158
function [inputMap, MBM, varargout] = mbm_read_inputs(MBM, varargin) % Read inputs for analysis from file paths given in MBM. % %% Input: % MBM - structure having the fields: % MBM.maps.anatListFile - Character vector. % - Path to either: % ...
2076247ebbf15062ba2732f8a7f18896d6fb256948ce69c6ce17e62d7315eba9
MATLAB
6,935
226
function [A,Y,AtA,numIter,tElapsed,finalResidual]=vsmf(X,k,option) % Versatile Sparse Matrix Factorization % 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 ...
514b7a135b06e4faa8152accab96c2c6e579cd73ef2a3f59e74c37ed9c3cbd41
MATLAB
6,944
145
%----------------------------------------------------------------------- % Tapas function for BMPD dataset % CL Septembre 2020, landelle.caroline@gmail.com // caroline.landelle@mcgill.ca % Toolbox required: Matlab, SPM12, Tapas PhysiO Toolbox % https://github.com/translationalneuromodeling/tapas/tree/master/PhysIO % ...
7d6d0722c8a496f6348eaa1fac504d31f1e20dcdf7ab2aac96871cc7c2e46f86
MATLAB
6,944
165
% demo file for applying the NoRMCorre motion correction algorithm on % 1-photon widefield imaging data % Example files can be obtained through the miniscope project page % www.miniscope.org clear; gcp; %% read data and convert to double name = '/Users/epnevmatikakis/Documents/Ca_datasets/Miniscope/msCam13.avi'; %add...
6648004b059ac499ffc76ee433fa3610c6c33914de3dfa1f2ee5fdbef3ca43a2
MATLAB
6,948
148
function [mappedA, mapping] = autoencoder_ea(A, no_dims) %AUTOENCODER_EA Trains an autoencoder using an evolutionary algorithm % % [mappedX, mapping] = autoencoder_ea(X, no_dims) % % Trains an autoencoder using an evolutionary algorithm. The autoencoder is % trained in such a way, that it reduces the dimensionality o...
80fc84d06255892b1674bf185e56ad987c16fae95ed7d6ef6f29c41cacc53782
MATLAB
6,951
190
function PD_ssrt_EEG_LFP_time_freq_MAIN(epoch_win,baseline_win, EventTypes,SubEventTypes) % PD_SSRT_BEHAV_MAIN Main function for EEG and LFP time-frequency analysis % % Input parameters: % EPOCH_WIN 1x2 vector, time window relative to event timestamp in sec, for data epoching (ex: [-2 2]) % % BASE...
979ee0b44e1e592d6f4ca659089b4ed159173481fb52850decf7267584c5784e
MATLAB
6,958
76
function labels_colors = defineLabelsColors_pd %DEFINELABELSCOLORS_BALAZS Labels and colors for plotting. % LABELS_COLORS = DEFINELABELSCOLORS_BALAZS returns preset labels and % colors for plotting. LABELS_COLORS is an N x 5 cell with tag, label, % color, second option for color, and line style in its colum...
1fbd945bf906e6b3e98cf318b69fe7ddc69298c6fee8b46b615f96ed1df69955
MATLAB
6,960
166
function [IO, mess] = ReadTabular(IO, fileflg, mess) if ~exist('mess','var'), mess=[];end switch fileflg case 1 IO.Y = evalin('base',IO.M_edit); IO.s_featnames = evalin('base',IO.col_edit); IO.s_ID = evalin('base',IO.case_edit); if ~isfield(IO,'oocvflag') || ~IO.oocvflag || IO.lab...
da6451dd48fed73f0fbb32384ed7fc3d1ca0d1dce579f713a734918d56fbde80
MATLAB
6,977
267
%% FUNCTION Least_Dirty % Dirty Multi-Task Learning with Least Squares Loss. % %% INPUT % X: {n * d} * t - input matrix % Y: {n * 1} * t - output matrix % rho1: group sparsity regularization parameter % rho2: elementwise sparsity regularization parameter % %% OUTPUT % W: model: d * t % C: constant paramet...
872ed9b686b8a9c8935200290e22debc606f4057035c52ef6fe1c683297290da
MATLAB
6,981
222
%> SEDITOR GUI to manually edit values from a stimulus class passed to it %> from opticka, and optionally edit many stimuli at the same time classdef seditor < handle properties handles fn stim cprop ckind otherstimuli mversion optickahandle = 0 end methods function obj = seditor(stimin, ohandl...
1e7e5f44d8983faa63e2acb9f0ad9b3d10030e447e6f18e2dec4298114f41811
MATLAB
6,991
167
function [STACKING, act, mess] = nk_Stacking_config(STACKING, NMS, mess, parentstr) global NM act = 0; %% Set-up configuration interface % Check the status of previous analyses if ~exist('NMS','var') || ... isempty(NMS) || ... ~isfield(NMS,'completed_analyses') || ... isempty(NMS.completed_a...
927b20581c13d48c0577d5bee9c75af40e2b8434092efed076b3d89ec6cc077a
MATLAB
6,999
156
%% 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 %%%***...
727bfabe3c23c974a45acf2bc2c63a3754e68c264c56d05142fc6bb9c24f5fa3
MATLAB
7,005
210
clear all; close all; setup_paths; data=load('JupiterSPIKE distance all session_v2.mat'); winSize = 100; xx=[]; yy=[]; xx2=[]; yy2=[]; xx3=[]; yy3=[]; xx4=[]; yy4=[]; for j=1:42 if j<4 |j>4 TOJ_begin_correct=data.TOJ_begin_early_all{j,1}; TOJ_begin_incorrect=data.TOJ_begin_late_all{j,1}; TOJ_end_co...
d82756f2acbdac69bc2b425fa68106ff61fb53b1dd7f7df3a242776cf0b40b1d
MATLAB
7,019
217
function [JUSPACE, act ] = cv_JuSpace_config(JUSPACE, brainmask, parentstr, defaultsfl) % from NM structure % brainmask % badcoords % user input Atlas = []; Option1 = 4; CorType = 1; % Spearman Option3 = 0; AutoCorCorrect = 1; % correct for spatial correlations Option5 = 0; PetList = []; if ~exist('defaultsfl','var...
9ec9672909d2ab897f44d2632530d604e13132bf9896674608df46ee0fab6ad0
MATLAB
7,029
191
clear; clc; load('...\LFPdata_Fig5E_S3.mat') fs=LAT.fs; t_start=LAT.t_start; t_end=LAT.t_end; saveFig=0; % JA of Mk1/Mk2 (signals recorded simultaneously) [allDiffLAT_P1Go_ja,allDiffLAT_N1Go_ja,allDiffLAT_P1MovOn_ja,allDiffLAT_N1MovOn_ja,allRT1_ja,allRT2_ja,allDiff_RT_ja,allBestLag_rVal_ja,allICD_lat]=f_Ca...
cc293a9cea37f2845f4572011bb8db20604e131987c454022ad0c94e75ab3ccd
MATLAB
7,033
183
% ======================================================================== %> @class BarStimulusTest %> @brief Class-based unit tests for barStimulus. %> %> Tests construction, property defaults, type list, bar dimensions, %> contrast, interpMethod validation, colour handling. CI-safe tests %> run without PTB; hardware...
5ccf85009061dfbae3637f8c2553d5a1310606b1e70483b9b0c33bff393aa86a
MATLAB
7,047
193
function outclass = Mysvmclassify(svmStruct,sample, varargin) %SVMCLASSIFY classifies data using a support vector machine % % GROUP = SVMCLASSIFY(SVMStruct,SAMPLE) classifies each row of the data % in SAMPLE using the information in a support vector machine classifier % structure SVMStruct created using SVMTRAIN....
8cfcc13063559ccb26c5803e3efa707870877d3cdd7dd7386e39e386720e67b9
MATLAB
7,055
214
clear all; close all; setup_paths; data=load('MercurySPIKE distance all session.mat'); winSize = 100; xx=[]; yy=[]; xx2=[]; yy2=[]; xx3=[]; yy3=[]; xx4=[]; yy4=[]; for j=1:21 if j<22 TOJ_begin_correct=data.TOJ_begin_correct_all{j,1}; TOJ_begin_incorrect=data.TOJ_begin_incorrect_all{j,1}; TOJ_end_co...
49e7890e2288d7b6226104dd58deee7dc6e0e3deceb2209eaa64f4b7c4531fa2
MATLAB
7,061
181
function [featmat, emptfl, skiparr, missarr] = nk_GenCVdataMaster2(datid, cv, mastermat, tdir, basename, savefl, varind, varstr, concatfl, UIopt) global SAV featmat = []; skiparr=[]; missarr=[]; saveflx = false; if exist('savefl','var') && ~isempty(savefl), if savefl, saveflx = true; end; end if ~exist('tdir','var') ...
856109df98fa164c007b53179c736e655b376ee758d9df1445ae7128f6103724
MATLAB
7,069
213
clear all; close all; setup_paths; data=load('MercurySPIKE distance all session.mat'); winSize = 100; xx=[]; yy=[]; xx2=[]; yy2=[]; xx3=[]; yy3=[]; xx4=[]; yy4=[]; for j=1:21 if j<22 TOJ_begin_correct=data.TOJ_begin_early_all{j,1}; TOJ_begin_incorrect=data.TOJ_begin_late_all{j,1}; TOJ_end_correct=d...
db9c4a12c559bc0d38eebf3ff7daca339598e75a8ae1c5db4f7d6e8e2b3f7795
MATLAB
7,076
174
function [bandwidth,density,xmesh,cdf]=kde(data,n,MIN,MAX) % Reliable and extremely fast kernel density estimator for one-dimensional data; % Gaussian kernel is assumed and the bandwidth is chosen automatically; % Unlike many other implementations, this one is immune to problems % caused by multimo...
dfc1caef108caa6b7ea83bc15873fa4a483be8904b7f1c90eb7e54a850e562e6
MATLAB
7,088
166
% ========================================================================= % = MODELPERF PLOT (BAGGED ENSEMBLES) = % ========================================================================= function handles = display_modelperf_bagged(handles) multfl = false; predind = get(...
60325642f936aae3ca767d78408512f86a09a85142db6fb93fcb886ffa3a6641
MATLAB
7,092
138
%{ ---------------------------------------------------------------------------- This file is part of the Sanworks Frame2TTL repository Copyright (C) 2017 Sanworks LLC, Sound Beach, New York, USA ---------------------------------------------------------------------------- This program is free software: you ca...
c653911fe3518cbd11e7f088d1cf465be3aeb02e7f8c865dc55df762721d7c8d
MATLAB
7,108
205
function [y, E] = sammon(x, n, opts) %SAMMON Performs Sammon's MDS mapping on dataset X % % Y = SAMMON(X) applies Sammon's nonlinear mapping procedure on % multivariate data X, where each row represents a pattern and each column % represents a feature. On completion, Y contains the corresponding % co-ordin...
4de9e34cb5ea8c6d6b40a8531ab10bcd2e90d27e715d340f721d086e7beaa09b
MATLAB
7,144
131
function [varind, varstr] = nk_SelectVariateIndex(dat, unifl, varind, askfl, showvar) % ---------------------------------------------------------------------------------- % FORMAT [varind, varstr] = nk_SelectVariateIndex(dat, unifl, varind, askfl, showvar) % -------------------------------------------------------------...
51779f32890e8017f2f2682c9becbb1c49e0be1bc1c1d86b1cf3ebf14a6c8b8f
MATLAB
7,161
266
function [u, v, C, success] = spls(X, Y, cu, cv, C, e, itr_lim) % % Sparse PLS algorithm, please check Monteiro et al. 2016 for details: % doi:10.1016/j.jneumeth.2016.06.011 % % Inputs: X, Y - data matrices in the form: samples x features. These % should have each feature with mean = 0 and ...
ebdfcefe72fa7a811e3ae7623e36a56e8caebd36bdedd1e7ec54554e8aaf16cb
MATLAB
7,182
271
%% FUNCTION Logistic_Trace % Trace-Norm Regularized Learning with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * \|W\|_*} % where \|W\|_* = sum(svd(W, 0)) is the trace norm % %% INPUT % X: {n * d} * t - input mat...
0b583518d5d535faf3fdb52d62f29439aa894ea6187d133b298d1ba50746b81f
MATLAB
7,183
193
% ========================================================================= % function [P, Perf, d, crit] = nk_MultiDecideMaxWins(H, Y, Classes, % maxfunc, weightflag) % ========================================================================= % % INPUTS: % -------...
4de82e5682f87b9639e012304e2c8f26e078669eae5aef4c40c967681ac21533
MATLAB
7,185
218
function [P, newY, L, newV, idx]= sdecca2(Y, snn, regularizer, relative) % doing semidefinitve embedding/MVU with output being parameterized by graph % laplacian's eigenfunctions.. % % the algorithm is same as conformal component analysis except that the scaling % factor there is set as 1 % % % function [P, newY, Y] ...
58d8ad0395b464b52053fc295564cf347a95f8734c87ee1cb83260dfae827a0f
MATLAB
7,196
198
function [P,apar,kpar,upar] = palm_pareto(G,Gdist,rev,Pthr,G1out) % Compute the p-values for a set of statistics G, taking % as reference a set of observed values for G, from which % the empirical cumulative distribution function (cdf) is % generated. If the p-values are below Pthr, these are % refined further using a ...
79f9d4549394da75a55863cc0c12568526774230158640a2d6fded69add2626a
MATLAB
7,199
169
function R = display_seqopt_perf(NM, analind, Cind, NodeN) R=[]; if ~exist('analind','var') || isempty(analind), errordlg('Please specify a sequential prediction analysis'); return; end if ~strcmp(NM.analysis{analind}.params.TrainParam.SVM.prog,'SEQOPT'), errordlg('The specified analysis is not a sequential predictor!...
78cb123aa85fef4d310211fa3c5aded96251cd4ec51963d8ea8d88faa5017f00
MATLAB
7,203
207
function [mat_data, dims, folder_analysis] = distribute_data(nam, patch_dims, ... w_overlap, memory_size_per_patch, memory_size_to_use, dir_output, filter_kernel) % divide the field of view into multiple small patches and save the data % into these small patches individually. There are overlaps between these % patc...
45febe6ae689aab0c5cbf86b258ab6501073e89f394df987fdb64977007bc72a
MATLAB
7,208
164
%% mRVM1 % authors: Ioannis Psorakis psorakis@gmail.com, Theodoros Damoulas theo@dcs.gla.ac.uk % Copyright NCR, 2009 %performs predictions given the results of the training phase, described by %TRAIN_OBJECT (see train_mRVM1) and a collection of test samples Xtest. In %case the test_labels are available, it also perf...
3986e90b88ae93cbdd10fab5a8d1904c4e4002851bc379dfac21df1a4391e0a3
MATLAB
7,209
175
% ======================================================================== classdef DMTSFunctions < userFunctions %> @class myUserFunctions (child of userFunctions) %> @brief For DMTS task %> % ======================================================================== %% ADD YOUR OWN VARIABLES HERE ↓ properties comm...
a86a72495e226cde91975bf54e6d94591b6e6794aa18b110995d3cc4ebc02c95
MATLAB
7,214
267
% Test file for NMF base % % Created by H.Kasai on March 24, 2017 % Modified by H.Kasai on Oct. 18, 2017 % Modified by H.Kasai on May 21, 2019 clc; clear; close all; anls_asgroup_flag = 1; nmf_mu_flag = 1; nmf_mod_mu_flag = 1; nmf_acc_mu_flag = 1; nmf_als_flag = 1; nmf_hals_flag = 1; nmf_acc_hals_flag = 1; nmf_pgd_...
97bab01cde10d1e695bad6545b8097a88e7ca3ecc397133905fb5ab32f82c449
MATLAB
7,221
229
% SB2_INITIALISATION Initialise everything for the SPARSEBAYES algorithm % % [LIKELIHOOD, BASIS, BASISSCALES, ALPHA, BETA, MU, PHI, USED] = ... % SB2_INITIALISATION(TYPE, BASIS, TARGETS, SETTINGS, OPTIONS) % % OUTPUT ARGUMENTS: % % LIKELIHOOD Likelihood structure (from SB2_LIKELIHOODS) % BASIS Pre-processed full ...
3136e69c48d61987cafd3ba94d07409608134348760fd9b21368526ab2fdfae7
MATLAB
7,240
221
function result = agnes(x,method,vtype,stdize,metric,plots) %AGNES is a agglomerative 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: ...
18c3e3224092d83b063c3f405d154fa2266ccf4fb927c6d55370a3b628309ac2
MATLAB
7,281
236
function [eigvector, eigvalue, elapse] = NPE(options, data) % NPE: Neighborhood Preserving Embedding % % [eigvector, eigvalue, elapse] = NPE(options, data) % % Input: % data - Data matrix. Each row vector of data is a data point. % % options - Struct value in Matlab. Th...
afc01f87748f290e61233e523e8cf8ce75a502782eb7fcb462deaae600ca7c4d
MATLAB
7,293
214
% This class is part of Titta, a toolbox providing convenient access to % eye tracking functionality using Tobii eye trackers % % Titta can be found at https://github.com/dcnieho/Titta. Check there for % the latest version. % When using Titta or this class, please cite the following paper: % % Niehorster, D.C., Anderss...
faf87210fe2c979b42e7fa9fd464e11057306e73d5192eb0712aae721491fbb1
MATLAB
7,301
190
% ======================================================================== %> @class DiscStimulusTest %> @brief Class-based unit tests for discStimulus. %> %> Tests construction, property defaults, flash type, contrast/sigma %> properties, colour handling. CI-safe tests run without PTB; %> hardware-tagged tests exercis...
96e284143c59359e6d1c37858b1092b15573b0b760ff334d91137ec0cd2ee03b
MATLAB
7,314
285
%% FUNCTION Logistic_Lasso % Sparse Structure-Regularized Learning with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * \|W\|_1 + opts.rho_L2 * \|W\|_F^2} % %% INPUT % X: {n * d} * t - input matrix % Y: {n * 1} *...
7fa3ab193d814eda7fa9e398902cf88cd45bb9f55819433bceec81a553a6f819
MATLAB
7,411
256
function gui_advc (action) % % This file is needed by FASTICAG % This file holds the callbacks for advanced options -dialog % @(#)$Id: gui_advc.m,v 1.3 2003/09/08 11:28:58 jarmo Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf...
549dfdb59ba2610a9089221f065b93c3cb026486b0806a7c9e1dadc4eed546a5
MATLAB
7,428
281
%% FUNCTION Logistic_TGL % L21 Joint Feature Learning with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + opts.rho_L2 * \|W\|_2^2 + rho1 * \|W\|_{2,1} } % %% INPUT % X: {n * d} * t - input matrix % Y: {n * 1} * t - outp...
fea49488f49c098c30f769aaa3810fda4fbc6dad89f900427f65596ec372b5a0
MATLAB
7,429
166
function handles = display_main(handles) h_class = handles.popupmenu1.Value; h_classlist = handles.popupmenu1.String; h_list = handles.selModelMeasures.String; h_val = handles.selModelMeasures.Value; if h_val>numel(h_list), h_val=1; end handles.curclass = h_class; if isfield(handles,'S...
0d79ce78a4775c069a0bf4fc6135a8fc2858f2c86a01fe0502acda90a6f0df8f
MATLAB
7,436
218
function PC_respcells_stacked_compare(pcevent,plot_win,fr_name,downsamp,PC_win,alpha,rectype,chanmean,subregion,PCdir) % PC_RESPCELLS_STACKED_COMPARE % PC_RESPCELLS_STACKED_COMPARE(EventTypes,pcevent,plot_win,fr_name,downsamp,PC_win,alpha,rectype,chanmean,subregion,PCdir) % Plots stacked bar plots with count...
3b72a0f7d864f11d5e226ecdb887564d3e93445edae990b72b149e0e3160817a
MATLAB
7,453
198
%% 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.dc...
f4446f1c0ecd2795e889eb808281a0913199062a3b66747d7a93d14b135a873f
MATLAB
7,458
214
function param = nk_LIBLIN_config(res, param, defaultsfl, parentstr) % Nikolaos Koutsouleris: Added bias term configuration option on the 19/02/2023 classifier = 0; tolerance = 0.01; b0 = 0; weighting = 0; bias = -1; AutoFl = false; autoflag = false; autostr = 'no'; NonRegBias = false; NonRegBiasFlag = false; NonRegBi...
c8947f4430706201828d2ba17786fb74d52b99c4c1ed8e96f377bc0182d0b8b9
MATLAB
7,494
215
% ========================================================================= % = CLASSIFICATION PLOTS = % ========================================================================= function handles = display_regrplot_oocv_labels_unknown(h, handles) % Prepare axes warning ...
7b20030d09092f538d2cd2a3c3440ca75807f2006a1f5700232b97205d6edf51
MATLAB
7,498
283
function [vol, M, mr_parms, volsz] = load_mgh(fname,slices,frames,headeronly) % [vol, M, mr_parms, volsz] = load_mgh(fname,<slices>,<frames>,<headeronly>) % % fname - path of the mgh file % % slices - list of one-based slice numbers to load. All % slices are loaded if slices is not specified, or % if slices is emp...
0708f548e8c9490b7429885b86b3cd5e7e02567aa435eb476b15adb69187b21c
MATLAB
7,506
284
% ====================================================================== %> @brief nirSmart fNIRS Sync manager %> %> %> %> Copyright ©2014-2025 Ian Max Andolina — released: LGPL3, see LICENCE.md % ====================================================================== classdef nirSmartManager < optickaCore propertie...
fc6d284ac3501fff8f4d23dde3894c965e3f20fbe0019f1c7369141027888621
MATLAB
7,527
187
function [CURACT, act ] = nk_PartialCorrelations_config(NM, CURACT, varind, parentstr, defaultsfl) if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end % Defaults METHOD_DEF = 1; COVAR_DEF = 1; MCOVARUSE_DEF = 1; MCOVAR_DEF = []; MCOVARLABEL_DEF = 1; COVDIR_DEF = 1; INT...
17df90987f7911707fa033f847851f7dcb092e41ca3df44fc32b4705548823cc
MATLAB
7,529
284
% ====================================================================== %> @brief Input Output manager, currently just a dummy class %> %> %> %> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md % ====================================================================== classdef nirSmartManager < o...
3cb2dfda101b495775e95b4747911e4328ac8e0f1f0266ca16934a58f71d1924
MATLAB
7,532
254
function [eigvector, eigvalue, elapse] = IsoP(options, data) % IsoP: Isometric Projection % % [eigvector, eigvalue, elapse] = IsoP(options, data) % % Input: % data - Data matrix. Each row vector of data is a data point. % % options - Struct value in Matlab. The fields i...
3a091b358249f0c42227ce8d1f1e46e5c87c35a1ae1447ce68ed7e08712a3912
MATLAB
7,536
189
function [CURACT, act ] = nk_PartialCorrelations2_config(NM, CURACT, varind, parentstr, defaultsfl) if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end % Defaults METHOD_DEF = 1; COVAR_DEF = 1; MCOVARUSE_DEF = 1; MCOVAR_DEF = []; MCOVARLABEL_DEF = 1; COVDIR_DEF = 1; IN...
c086f1aa4f2483b7b0c618ba8e4c8774e77b9ca47b398e8f24eca8ba80e23620
MATLAB
7,580
282
% ====================================================================== %> @brief mentaLab Sync Class %> %> %> %> Copyright ©2014-2025 Ian Max Andolina — released: LGPL3, see LICENCE.md % ====================================================================== classdef mentalabManager < optickaCore properties devi...
cea60b55404a28f0802d21de71260cc9af47515215075732f025f28a3b17807b
MATLAB
7,587
221
% Compute h-step Weisfeiler-Lehman shortest path delta kernel for a set of graphs % Author: Nino Shervashidze - nino.shervashidze@tuebingen.mpg.de % Copyright 2010 Nino Shervashidze % Input: Graphs - a 1xN array of graphs % Graphs(i).am is the adjacency matrix of the i'th graph, % Graphs(i).al is the adjacency...
6b2e4fc2fd0370c549b0993a7930555f20549f8a2ba6e58e7f3c771c1c535c4c
MATLAB
7,589
195
function [ GD, MD ] = nk_MLOptimizer_ParamCycler(GD, MD, DISP, Ps, Params_desc, mapY, algostr, f, d, npreml, nclass, ngroups, batchflag, PsSel, combcell) % ========================================================================= % FORMAT [ GD, MD ] = nk_MLOptimizer_ParamCycler(GD, MD, DISP, Ps, ... % ...
cadcf6a100a45845e4d902616e1265636ec11cec21db066f11025d76a77b180d
MATLAB
7,600
202
%% 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.dc...
eefd7fc3d64bfae6083ec3030807bbf835c7165bec8622405ad92e17741e2855
MATLAB
7,603
321
classdef Cutter < handle % Cutter superclass properties (Constant) CutterFuncKey = 'CutterOption_'; uicHeight = 0.05; uicWidth = 0.175; uicWidth0 = 0.075; uicWidth1 = 0.10; XLocs = [0.05 0.40:MClust.Cutter.uicWidth1:0.9]; dY = 0.05; YLocs = 0.95:-MClust.Cutter.dY:0.05; end properties % --- ...
d956264a191d8c36fa19b4d570ff3b2e6da17e3dfb8247fde8d78023b2f1b6f9
MATLAB
7,628
173
function writeMz3(filename, face, vertex,vertexColors,alpha, isCompress, isForceScalar) %function writeNv(vertex,faces,filename) % --- save Face/Vertex data as Surfice MZ3 format file %inputs: % vertex: Vx3 array with X,Y,Z coordinates of each vertex % vertexColors: Vx0 (empty), Vx1 (scalar), Vx3 (RGB), Vx4 (RGBA), (Vx...
df2f29ba3792b1ec7285ce813071e385f5b5e028a58ca2b00a3cac5ca3a02142
MATLAB
7,628
210
clear all close all setup_paths; for monkey=1 if monkey==1 monkey_name='Jupiter'; elseif monkey==2 monkey_name='Mercury'; end [num,txt,session_name]=xlsread('Session_name.xlsx',monkey_name); filename_marker=[monkey_name,'_stage2_nonprimate_marker_organized.xlsx']; filename_spike...
7b9651a178de951da05ce6a6a42fd632c52c578e44237c3243f3e0aaff1d3664
MATLAB
7,660
173
function writeMz3(filename, face, vertex,vertexColors,alpha, isCompress, isForceScalar) %function writeNv(vertex,faces,filename) % --- save Face/Vertex data as Surfice MZ3 format file %inputs: % vertex: Vx3 array with X,Y,Z coordinates of each vertex % vertexColors: Vx0 (empty), Vx1 (scalar), Vx3 (RGB), Vx4 (RGBA), (Vx...
1307a8e0bf4fd811341741bd58d8baa655130fadfc52e144c18ef828c20e4d60
MATLAB
7,666
200
function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy,TY] = elm_kernel(TrainingData_File, TestingData_File, Elm_Type, Regularization_coefficient, Kernel_type, Kernel_para) % Usage: elm(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction) % OR: [TrainingTime, Tes...
740a2938edfa4c1ffe25d7ed5d1b4ff1632b2e5b119b86d047a424091c30b211
MATLAB
7,680
181
%Sleep Analysis Widget % THe purpose of this script is to input a specific window of data to be % analyzed from the sleep_analysis_2020 code. This will ask for the window, % which you must manually provide then spit out summary data for that % window % Requirement: Place a .mat file to analyze into Perl Ba...
a73f7a87f7aa6600c6eecf80428250b525b547641c60ddb917d74ac17aee4db7
MATLAB
7,691
182
function [ inp, contfl, analysis, mapY, GD, MD, Param, P, mapYocv ] = nk_ApplyTrainedPreproc(analysis, inp, paramfl, Param) % ========================================================================= % [ contfl, analysis, mapY, GD, MD, Param, P, mapYocv ] = ... % nk_ApplyTrainedPreproc(analysi...
69e42f40f3adffd83f1e98b1cd74b06b1e388729627dcb304fee609d19ddec02
MATLAB
7,697
196
function wcoh_onebyone(sess2analyse,event,subevent,isfig,freqs,downsamp,alpha,plot_win,baseline_win,chanmean) % WCOH_ONEBYONE Mean-squared wavelet coherence (MSWC) map between intraop EEG and LFP. % EEG_LFP_WCOH_PD calculates the MSWC map aligned to EVENT within FREQS frequency range % patient-by-patient, incl...
9f3550defe1f699195b50b0a12ac14c37a89b7f49c104191db89f5bf5831eefb
MATLAB
7,706
196
function varargout = ghostscript(cmd) %GHOSTSCRIPT Calls a local GhostScript executable with the input command % % Example: % [status result] = ghostscript(cmd) % % Attempts to locate a ghostscript executable, finally asking the user to % specify the directory ghostcript was installed into. The resulting path % is s...
08adf8d21bd00d09d251fd2d39c37ed870759793a0fca35632737d6902907f4f
MATLAB
7,709
191
% script to combine multiple animalBehavioralAnalysis objects, output % timeseries plots, reliability (z-score relative to WT) csv, and heatmap % % SurveyBott, 2019, info@surveybott.com %#ok<*AGROW> function data = combinedReliability(in,varargin) wt = fullfile(fileparts(mfilename('fullpath')),'wt.mat'); % inputs p = i...
650b764747f82dda9f0cd565d2a94811187a6c75814321e9bba269aca74be51b
MATLAB
7,723
185
function ms = msGenerateVideoObjConcat(dirName, equipment, replaceRGBVideo, filePrefix) %MSGENERATEMS Summary of this function goes here % Detailed explanation goes here ms.dirName = dirName; % Added by GE to keep track of where the files were initially MAXFRAMESPERFILE = 1000; %This is set in the miniscope control...
dae6ddaeb1a27c1d7ac428f138cdaff9192d1d7477b1487018e23b468eb00a14
MATLAB
7,734
231
function palm_plot(Y,X,I,Z,res,F,opt) % Take a vector of data, regressors from a design, then % make an interaction plot. % % Usage: % % palm_plot(Y,X,I,Z,res,F,opt) % % - Y : Data. % - X : Main effects (up to 3 colums, of which % no more than 2 can be continuous. % - I : The interacti...
a84513b297ac933fa444b6d9b53663f13049a76f776df03253d4118a4166ce77
MATLAB
7,753
237
classdef HEDTags %HEDTags V8.3 properties name id comment end enumeration % Event/ Sensory_event ("Event/Sensory-event","","") Agent_action ("Event/Agent-action","","") Data_feature ("Event/Data-feature","","") Experiment_control ("Event/Experiment-control","","") Experiment_procedure ("Event/E...
3f3a4c460e548fd2b6bca060200dd2ff02c38fe48722762e9360ea63c51727d8
MATLAB
7,784
224
% ========================================================================= % function [P, Perf, d, crit] = nk_MultiDecideMaxWins(H, Y, Classes, % maxfunc, weightflag) % ========================================================================= % % INPUTS: % -------...
3934f5c61d11afe756bf0ed78b600999c0b76e8d75e31d435fc6a17b9a0e1398
MATLAB
7,786
188
function [ b sigma2_x x_est y_est stats] = deming(x,y,lambda,alpha) % [ b sigma2_x x_est y_est stats] = deming(x,y,lambda,alpha) % % deming() performs a linear Deming regression to find the linear % coefficients: % y = b(1) + b(2)*x % under the assumptions that x and y *both* contain measureme...
9ce236a204796240955e67527c1bcf5481f352c66066db7c64d70abbe0231511
MATLAB
7,792
233
% ========================================================================= % Coded by Youngmin Ha (y.ha.1@research.gla.ac.uk) on 21 Jan 2015 % by referring to Ha, Youngmin. "Fast multivariate relevance vector % regression," submitted to Annals of Mathematics and Artificial % Intelligence (2015). % ============...
b67e1b9f178a18d4e281b18e026564bcd5a1598e2c12f01c6532a1b3e9d279bf
MATLAB
7,831
199
function input_struct = brainframe_inputs_human(matpath,varargin) %Loading the data necessary to create this default input_struct: if mod(nargin,2) == 0 || isempty(matpath) % matpath = [cd filesep 'Data']; matpath = cd; end input_struct = struct; load([matpath filesep 'brainframe_defaultHuman_datinput.mat'],....
290db18d98945e49334f2b206b0dbaf65bd7a96b7f9bb0e257481140d7d62a7f
MATLAB
7,833
279
%% FUNCTION Least_CASO % Convex-relaxed Alternating Structure Optimization with Least Squares Loss. % %% OBJECTIVE % argmin_{W, M} { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * eta (1+eta) trace(W' (eta I + M)^-1 W) % subject to: trace (M) = k, M \preceq I, M \in S_+^d, eta= rho2/rho1 % %%...
c17ac10d84922786877fbd4e14b7eae0c98f6f03e90f1ee88f49acdf6c4e70fa
MATLAB
7,843
403
function ret=writesdpa(fname,A,b,c,K,pars) %WRITESDPA Take a problem in SeDuMi format and writes it in SDPA format % % Usage: % % ret=writesdpa(fname,A,b,c,K,pars) % % fname Name of SDPpack file, in quotes % A,b,c,K Problem in SeDuMi form % pars Optional parameters. % ...
b84f1192a525fca1d5092350ca72a75830b90f3359b9e12e780d27e021ac3f9f
MATLAB
7,854
231
function [x, infos] = nmf_pgd(V, rank, in_options) % Projected gradient descent for non-negative matrix factorization (NMF). % % The problem of interest is defined as % % min || V - WH ||_F^2, % where % {V, W, H} > 0. % % Given a non-negative matrix V, factorized non-negative matrices {W,...
0c193c926bdc7a7b22445799438c14be7108ffc9c5ad8d04b613677bea83d66e
MATLAB
7,872
216
function CorrelationPlotter(outputs,savenclose) if nargin < 2 savenclose = 0; end fldnames = fieldnames(outputs); % Rvals across time points for optimal model for k = 1:length(fldnames) tempstruct = outputs.(fldnames{k}); data = tempstruct.Full.data; predicted = tempstruct.Full.predicted; notnanin...
a94e5a1e93040622e70e8a1d1a5c4943286892d060dfb473fa4177ed933d325e
MATLAB
7,875
179
%% mRVM1 % authors: Ioannis Psorakis psorakis@gmail.com, Theodoros Damoulas theo@dcs.gla.ac.uk % Copyright NCR, 2009 %performs predictions given the results of the training phase, described by %TRAIN_OBJECT (see train_mRVM1) and a collection of test samples Xtest. In %case the test_labels are available, it also perf...
161f71723230895ddb23f95d78afd3170e5352f7e8ed29ce3150f455c2efa3ca
MATLAB
7,910
174
% ======================================================================== %> @class AudioManagerTest %> @brief Class-based unit tests for audioManager. %> %> Tests construction, silent mode, property defaults, volume clamping, %> and beep sound vector generation (via the private getBeepSoundVec %> method, exercised th...
4d4ac7364e36a718b1b00e8fbdd80d92fbecbc34edc424f7bb2f9d6e18308362
MATLAB
7,912
220
function password = passwordUI(varargin) % PASSWORDUI Dialog for entering and creating passwords % PW = PASSWORDUI() brings up a dialog for entering a password. % The dialog masks the characters with a "*". % PW = PASSWORDUI(...) accepts up to 3 optional input arguments. The % arguments can be: % ...
0c4fc7d21460c20ed57a9423ad267f6b2fb988c1455a43c3b7f57bb403584a74
MATLAB
7,920
186
function [check_str, mess, t_label, IO] = CheckLabel(IO, act, t_Y, na_str, mess, Mx) check_str = na_str; t_label = []; if ~isfield(IO,'label_edit') || any(strcmp(IO.label_edit,na_str)), return, end if ~exist('mess','var'), mess=[]; end if ~exist('Mx','var') || isempty(Mx), Mx = 'unknown matrix source'; end if ~exist('...
8051b7be635d1ba7069e102b0b14dde691bdb2533c6ac7fff4cb6697c2acbe46
MATLAB
7,967
182
function CreateCutterWindow(self, varargin) % MClustCutter.CreateCutterWindow % varargin CreateAxesControls = true; CreateHideShow = true; process_varargin(varargin); MCS = MClust.GetSettings(); MCD = MClust.GetData(); %-------------------------------- % constants to make everything identical uicHeight = self.uicHe...
292a89c5f8ae8d4ce06a8f44324b18824f68f297bcb4d3485ff9d5d81e55b159
MATLAB
7,997
256
%% plot_SAT_TTS_three_algs.m % Plot SAT TTS scaling (median + IQR error bars) for three algorithms: % 1) HO_color_full_precision % 2) HO_single_spin_flip % 3) QUBO % % Folder structure (relative to this script's location): % HO_color_full_precision/coarse_summary.csv % HO_color_full_precision/coarse_instance_...
efe273b98f538b40e298aca8902722dfeb02069a63c3fce29b1540e8e9fde290
MATLAB
8,020
282
%% FUNCTION Least_CMTL % Convex-relaxed Clustered Multi-Task Learning with Least Squares Loss. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * eta (1+eta) trace(W (eta I + M)^-1 W') % subject to: trace (M) = k, M \preceq I, M \in S_+^t, eta= rho2/rho1 % %% INPUT...
01a46e7170094b8fb0a8bf5334d73cf423db205496ee8e93f956cc387132a22b
MATLAB
8,039
201
%% step1 确认保存位置 %change while needed clear; clc; % savepath = 'D:\930_paper_plotting\fig\yield'; % Create saving path if ~exist(savepath, 'dir') mkdir(savepath); end %% 手动load数据 % % includeHS subject = {'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8','P9','P10','P11','sum'}; single_unit_count = [78, 51, ...
46e6d78e0fcddc55ea2985b31fb17736755506d8325d74a1ae746a2efa77fd51
MATLAB
8,041
235
function [merged_ROIs, newIDs, obj_bk] = merge_close_neighbors(obj, show_merge, dmin, method_dist) %% merge neighboring neurons if they are too close % inputs: % show_merge: boolean scale, manually verify the merging % dmin: scalar, minimum distance (pixel) % method_dist: str {'max', 'mean'}, method for computin...
8ff0bcd6e194cdec88f6bfdbd4372bd4732e63647a2ac220483fff5eb01be935
MATLAB
8,057
198
%This code is from the following two links %https://www.mathworks.com/matlabcentral/fileexchange/45134-violin-plot. %Bechtold, Bastian, 2016. Violin Plots for Matlab, Github Project %https://github.com/bastibe/Violinplot-Matlab, DOI: 10.5281/zenodo.4559847, https://www.mathworks.com/matlabcentral/fileexchange/1701...
4872943a379686313e47917a8e2a1e5a6f420d5923178741191c07ab00c5eadf
MATLAB
8,076
205
function input_struct = brainframe_inputs_mouse(matpath,varargin) %Setting the path to load defaults; set matpath to [] if using default if mod(nargin,2) == 0 || isempty(matpath) % matpath = [cd filesep 'Data']; matpath = cd; end %Loading the data necessary to create this default input_struct: input_struct = ...
36eef8fb1f9a1e7936af7b2faa63d4dfd461489f512af66ffded4f3e7396af17
MATLAB
8,079
266
%% file example_Calibration.m % a toy example on using different types of multi-task learning % calibration algorithms. % %% OBJECTIVE % see manual % %% LICENSE % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the...
459e2dd2aa23ceaf21b4387fb5621c171724b31223b42359c24f1c50aedf8cb9
MATLAB
8,101
206
function [varargout] = mbm_plot(MBM) % plot MBM results % %% Inputs: % MBM - structure having the fields: % % MBM.maps.mask - Vector of the binary mask. % % MBM.plot.saveFig - Option ('true' or 'false') to % save the visualisation of the results. % % MBM.pl...
408f6ebeac152b82684a9d53dbe0bf52069fba8cbbd2cdab51e9daace648afe6
MATLAB
8,120
220
% ========================================================================= % FORMAT [opt_hE, opt_E, opt_F, opt_Fcat, opt_D, opt_Pred] = ... % nk_MultiCVMax(E, L, EnsStrat, C) % ========================================================================= % % Inputs % ------ % E ...
7663ffe92dbd215f943409fcfbdce46e6c9aa54d9c984b0cf968ab6af6454a29
MATLAB
8,135
192
function JH = nk_GridSearchEnsembleAdaBoost(Y, GD) % % function JH = nk_GridSearchEnsembleAdaBoost(Y, GD, C, G) % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ % % Inputs: % ======= % Y = Input Data structure (Y.Tr{x,y} = Training Data, Y.TrL{x,y} = Training Data % Labels) p...
244b1b0662111ada025d0b7d6c966cd2bb5fd07a9391fb8acb844a4220f4b34a
MATLAB
8,144
220
function [data_permuted] = generate_spatial_nullMaps(atlas,data,N,opt_symmetry) % [data_rand_weighted] = generate_spatial_nullMaps(atlas,data,N,opt_symmetry)) % atlas: file path to the atlas % data: extracted data from JuSpace % N: number of nullMaps % opt_symmetry: 1 (default) generate symmetric null maps, else 0 --> ...
30e4ae9462a7e3768b38de20f4d129611cfde64ecb2ede897c9ce320a2ac09c7
MATLAB
8,170
239
function [x, infos] = nmf_als(V, rank, in_options) % Alternative least squares (ALS) for non-negative matrix factorization (NMF). % % The problem of interest is defined as % % min || V - WH ||_F^2, % where % {V, W, H} > 0. % % Given a non-negative matrix V, factorized non-negative matrice...
ed82260079a28355bebec91c3fa0364f301566b94156cd3eccfc6b5904558b2c
MATLAB
8,175
272
function updrs_behav_corr(conditions) %UPDRS_BEHAV_CORR calculates correlation between UPDRS scores and behav. parameters % UPDRS_BEHAV_CORR calculates Pearson's correalation between preop and postop (DBS-on) % UPDRS scores (tested both with and without medication) and reaction time (RT), stop signal delay at 50...
9e5b5284e21e09705813eec1491c939ae4388f4318cefd2c4a9b9577b2038ae2
MATLAB
8,185
100
function Correlograms = generateCorrelograms(ProcessedData,InjuryIndicies,AnalysisRegions,sw,plotProps) %This function makes correlograms by comparing each raster against all others % One raster acts as a reference, one is compared against the reference % All reference events are set as t=0 (one by one),...
d462b364bbaa200fecc526366cf8f1e50eaad04fb991dcec9bdd910db1a4596a
MATLAB
8,185
306
%% FUNCTION Logistic_SRMTL % Sparse Structure-Regularized Learning with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * norm(W*R, 'fro')^2 + rho2 * \|W\|_1} % %% R encodes structure relationship % 1)Structure order...
c1f48196806f9ec050f0aac1c58ca8eb4271c8b9c34d4beb9f67d6cb049eee4b
MATLAB
8,187
239
function clusplot(x,ncluv,span,xlabels) %CLUSPLOT creates a bivariate plot visualizing a partition (clustering) % of the data. All observations are represented by points in the plot, % using principal components or multidimensional scaling. Around each % cluster an ellipse is drawn. % %The algorithm is fully described...