sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
4be4ae253c9de6d25552012b7ff40beebdcac6be586ba8643b3441e0b3b866ad
MATLAB
3,869
122
function [data_ind, train_ind, nP, nA] = nk_ParamReplicator(P, PXopt, PREPROC, nA) % ========================================================================== % [data_ind, train_ind] = nk_ParamReplicator(P, PXopt, PREPROC, TrainedParam) % ========================================================================== % nk_...
4eb5b58ee1e59e3760261d75acdf2b43acef7b1fdd07271c23132878a41d1b99
MATLAB
3,877
93
function ms = msGenerateVideoObj(dirName, 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 software % ...
aa7a2d073fb20349f433367d8c49fda8e47894636b79fcb5fccfafd3989d6039
MATLAB
3,878
109
function [ACluster,YCluster,indACluster,indYCluster,Xout,Aout,Yout,numIter,tElapsed,finalResidual]=biCluster(X,k,option) % The biclustering method using one of the NMF algorithms % Usage: % [ACluster,YCluster,indACluster,indYCluster,Xout,Aout,Yout,numIter,tElapsed,finalResidual]=biCluster(X,k) % in this case, X and k a...
76ed0ba9c1692e3ef129e6776eb04e20e6f550ecf6144d45a13100482d70bf68
MATLAB
3,880
96
function CreateCutterWindow(self) % MClustCutter.CreateCutterWindow MCS = MClust.GetSettings(); MCD = MClust.GetData(); self.CreateCutterWindow@MClust.Cutter(); % call superclass to build initial window %-------------------------------- % constants to make everything identical uicHeight = self.uicHeight; uicWidth ...
46b9587035b5fd1c9a89ae8f39025798f343effb1a430c08a410eb36445a2970
MATLAB
3,882
131
function [W,H] = NNDSVD(A,k,flag) % % This function implements the NNDSVD algorithm described in [1] for % initialization of Nonnegative Matrix Factorization Algorithms. % % [W,H] = nndsvd(A,k,flag); % % INPUT % ------------ % % A : the input nonnegative m x n matrix A % k : the rank of the computed factors W,H %...
d90bae65e44dcf6bdf4cc46f9be27b1dbdd15dbc5cd4fc353ca1f34f5efc5c75
MATLAB
3,883
93
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; switch h_list{h_val} case 'Classification plot' handles.pnModelP...
b2de41cdedaae75990d0d86aaa9994a76763389e460941463ac667f08d521854
MATLAB
3,887
112
function [ Lperm, Yperm ] = nk_VisXPermY(Y, L, IND, permmode, indpermrows, indpermcols, permind, analysis, inp, paramfl, BINMOD, n, h, k, l, pnt, FullPartFlag, F, u) global MODEFL CV switch permmode case 1 Lperm = L(indpermrows(:,permind)); Yperm = Y; indN = isnan(L); if strcmp(MO...
d5cf7dd8d5166e4d7fba70ee22da2041de732e985c40313ad29f5811ac9766d2
MATLAB
3,890
128
function model=softSVMTrain2(trainSet,trainClass,option) % soft margin svm, express bias explictly %model.mu: % Lagrance multiplier %model.sv: support vectors % example: % load('C:\YifengLi\Reseach Program\dataset\Colon\ColonCancer.mat'); % dataStr='Colon'; % kfold=3; % ind=crossvalind('Kfold',classes,kfold); % indTest...
682fb267dca4eae7647d6870d0ae109161ae20b8025e7719a269c428f1035c7a
MATLAB
3,902
115
function output = mp2rage_matlabbatch_job_output( job_name, display_name ) % This function is used to manage the output files within the Batch system. % Later, the function mp2rage_generate_output_fname will perform the output name generation. % % See also mp2rage_matlabbatch_job_output mp2rage_get_defaults mp2rage_gen...
c7753bf10a7d93fe20d90be8c350094da74bb74efe1c7fed06e2c6894367d4d9
MATLAB
3,902
98
%% ================================================================ % Script: generate_individual_topography.m % Purpose: % Derive participant-specific functional network topography % from individualized functional networks. % % Description: % - Loads individualized functional network labels (from template match...
1870f0c01643338757d7b961c09a5dea6810c40a7f0c1a8cbaae1e7a644efb14
MATLAB
3,903
117
function SI = search_information(W, L, has_memory) % SEARCH_INFORMATION Search information % % SI = search_information(W, L,has_memory) % % Computes the amount of information (measured in bits) that a random % walker needs to follow the shortest path between a given pair of nodes. % % Inputs:...
e20bb594a8c74c44aa02463127a66ff836807e7115f455f007b3f3485466e6af
MATLAB
3,903
116
function [A,Y,numIter,tElapsed,finalResidual]=sparsenmf2nnqp(X,k,option) % Sparse NMF, X=AY, using active-set NNQP solver. Both basis matrix and coefficient matrix are constrained by % l_2 and l_1 norm. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=sparsenmf2nnqp(X,k) % [A,Y,numIter,tElapsed,finalResidua...
9a5444dc98682401aa1f28c5a5e7c95ae9573d6f3054e2f0facbd7c968b7bdab
MATLAB
3,909
126
function scorediagplot(Xdist,Odist,k,cutoffx,cutoffo,attrib,labsd,labod) %SCOREDIAGPLOT plots the score outlier map. The score distances (SD) and % orthogonal distances (OD) calculated in a PCA analysis are plotted % on the x and y-axis, respectively. % The cutoff values marked by a red line indicate which observ...
f93c5f6129efc12ddba0babd006aa6dbb80f556b56a0428ede441078b566f41e
MATLAB
3,916
109
function [c, s, active_set] = oasisAR1(y, g, lam, smin, active_set) %% Infer the most likely discretized spike train underlying an AR(1) fluorescence trace % Solves the sparse non-negative deconvolution problem % min 1/2|c-y|^2 + lam |s|_1 subject to s_t = c_t-g c_{t-1} >=s_min or =0 %% inputs: % y: T*1 vector, On...
34f69fb4075a05f092d8b9c8cc623fa48e5c1da2c16897cadf862495c35c4686
MATLAB
3,923
94
function [sY, IN] = nk_PerfScaleObj(Y, IN) % ========================================================================= % FORMAT function [sY, IN] = nk_PerfScaleObj(Y, IN) % ========================================================================= % Scaling of matrix Y to [0,1] (zero_one=1) or [-1,1] (zero_one=2) or % r...
5e975b0249f21756e52c13d4fb49a55d816ade7e7ec9360f67226637476a1959
MATLAB
3,924
97
%% figure % 横轴:时间 % 纵轴:spike position % 点的颜色:幅值 clear; clc; load('I:\930_project\paper_figure\waveform_table\Unit_info_SU\Unit_info_SU_patients\Unit_info_SU_patients_extend\Unit_info_SU_20250220_HS_WithNeedle_NoCuration_all_SpkTypes.mat'); fs = 25640; big_amp_thres = 0; FigureWidth = 30; FigureHeight = 20;...
15f8885fa24b6a904a52db70e88dd0e23ccb327d13dcdb6f219a4198d7e5aeca
MATLAB
3,929
88
function beh = importfile(filename, startRow, endRow) %IMPORTFILE ½«Îı¾ÎļþÖеÄÊýÖµÊý¾Ý×÷Ϊ¾ØÕóµ¼Èë¡£ % JUPITERFINALTESTNONPRIMATEDAY1R1 = IMPORTFILE(FILENAME) ¶ÁÈ¡Îı¾Îļþ FILENAME % ÖÐĬÈÏÑ¡¶¨·¶Î§µÄÊý¾Ý¡£ % % JUPITERFINALTESTNONPRIMATEDAY1R1 = IMPORTFILE(FILENAME, STARTROW, % ENDROW) ¶ÁÈ¡Îı¾Îļþ FILEN...
999a8950c3c2d56ef8edf3d8b3d4be027409eb7f63b08b32c97ef40306e3fda0
MATLAB
3,929
93
function palm_cohen(M,psi,res,plm,opts,y,m,c,o,p) % Computes and saves effect sizes and a few other GLM estimates. % This is intended to be invoked if "-saveglm" is used. % If "-saveperms" is also used, then it will be executed for every permutation. % % This function isn't intended to be executed by the user, but be ...
d84769b4c7b6b0a64b048ea3d4867c4f2bcfccda1d4a9e882275cfaa5478b81a
MATLAB
3,929
119
%% file example_CMTL.m % this file shows the usage of Least_CMTL.m function % and study how to capture tasks clusters. % %% 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=...
25e95894e2fd0b50fcbe0d6dd105e721fd10e22cba604c7d49714bfbb61ddb4b
MATLAB
3,931
140
function result=rrmse(x,y,h,kmax,attrib,plots,k,weight,res) %RRMSE calculates the robust RMSECV and/or the robust RMSEP-value % for RPCR and RSIMPLS. % % The robust RMSECV is described in: % % Engelen, S., Hubert, M. (2005), % "Fast model selection for robust calibration methods", % Analytica Chimica Acta, 544, ...
9b52d42f69a38637133f8f7b6e32c6e6c2fb28735466d06bbe7227729f3c9847
MATLAB
3,938
88
function [testClassPredicteds,classPerforms,conMats,tElapseds,OtherOutputs]=multiClassifiers(trainSet,trainClass,testSet,testClass,methods,options) % trainSet, matrix, the training set with samples in columns and features in rows. % Usuage: % [testClassPredicteds,classPerforms,tElapseds,OtherOutputs]=multiClassifiers(t...
9128ea180346d46758d4beb93859f42b62c4c24a281ddeb27a84332e1c9d17ab
MATLAB
3,943
75
% Demo code for mapping cortical thickness difference taking into account covariate of sex and age, i.e., ANCOVA, using MBM. % % This demo uses 72 empirical thickness maps from T1 maps in an open % dataset: https://openneuro.org/datasets/ds002748/versions/1.0.5 % % All input files are stored in 'data/demo_book_chapter...
d0916134655d41fe2093b45cfccf519ad51351d289424c5b63ff62290569d31c
MATLAB
3,944
100
function [testClassPredicted,sparsity,Y,otherOutput]=nnlsClassifier(trainSet,trainClass,testSet,testClass,option) % NNLS Classifier: testSet=trainSet*Y, s.t. Y>=0. % Usage: % [testClassPredicted,sparsity]=nnlsClassifier(trainSet,trainClass,[],testClass) % [testClassPredicted,sparsity]=nnlsClassifier(trainSet,trainClass...
10be1f0069a0b89201fc781cc655bfdd92163f2dff46cb6bf6efcb1b4bdcd933
MATLAB
3,948
148
function [hdr,be] = read_hdr_raw(hname) % Read a NIFTI header % FORMAT [hdr,be] = read_hdr_raw(hname) % hname - filename of image's header % hdr - a structure containing header info % be - whether big-endian or not %__________________________________________________________________________ % Copyright (C) 2005-201...
fcfd1d7828ea8ed7cb54dad69808d2afe3726e9297482048e0b895d1117c76a5
MATLAB
3,949
128
%% 0. Setup % Initialization clear all; close all; clc; % Add folder with raw data to path addpath([pwd '/raw_data_mouse']) % Add library with eNDM functions to path addpath([pwd '/lib_eNDM_numeric']) addpath([pwd '/lib_eNDM_analytic']) % Load dataset of interest load Tasic_CTMaps.mat %sw...
475a2d69e1cdff022473593a4bb747472480a7248fecda56395a3c9fd2a8c5fe
MATLAB
3,955
113
function [A,S,Y,numIter,tElapsed,finalResidual]=orthnmfrule(X,k,option) % Orthogonal-NMF based on NNLS: X=ASY, s.t. A'*A=I, Y*Y'=I, A,S,Y>0. % Definition: % [A,S,Y,numIter,tElapsed,finalResidual]=orthnmfrule(X,k) % [A,S,Y,numIter,tElapsed,finalResidual]=orthnmfrule(X,k,option) % X: non-negative matrix, dataset ...
92d9c60527fa4fbcf4f8de8577ad4a08bf45788cc1267b951f9dcf9cb40820fa
MATLAB
3,955
97
%% figure % 横轴:时间 % 纵轴:spike position % 点的颜色:幅值 clear; clc; load('I:\930_project\paper_figure\waveform_table\Unit_info_SU\Unit_info_SU_patients\Unit_info_SU_patients_extend\Unit_info_SU_20250220_HS_NoNeedle_NoCuration_all_SpkTypes.mat'); fs = 25640; big_amp_thres = 0; FigureWidth = 30; FigureHeight = 20; ...
0a811893278a775a4e6aa00f8b103075ae3dbde5eff76e114d55adde58eacf8b
MATLAB
3,956
139
%Demonstrates the mcrvm algorithm on a toy example (Three class classification problem). Part of the code was %derived from Tipping's matlab code. % @file mcrvm_example.m % Author Arasanathan Thayananthan ( at315@cam.ac.uk) % (c) Copyright University of Cambridge % % This library is free sof...
3cbf3892b948d04b1016d214abb60f66f2ce207e70ae4743ff11c56365953b8a
MATLAB
3,968
103
classdef full_emgf < bt.model.full % 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 end methods function self = full_emgf() % Constructor self.name...
2b84de6124051518158b92987859c5f1d8e0f321fc49f07cd36887a0dc63e886
MATLAB
3,969
131
function [x, infos] = semi_nmf(V, rank, in_options) % Semi non-negative matrix factorization (Semi-NMF). % % The problem of interest is defined as % % min || V - WH ||_F^2, % where % H > 0. % % Inputs: % V : (m x n) non-negative matrix to factorize % rank : ra...
834fe00cc82b15f02aee780f407ddd41ebafd3560512e9fcd2efc650ba66ca42
MATLAB
3,971
96
classdef test_net < matlab.unittest.TestCase properties num_output model_file net end methods (Static) function model_file = simple_net_file(num_output) model_file = tempname(); fid = fopen(model_file, 'w'); fprintf(fid, [ ... 'name: "testnet" force_backward: true\n...
b0bbea96ffaa4bcef2bf780c6ffae062b4a2f6124a2973fc406a4452eaa6185b
MATLAB
3,971
136
function [perf,conMat]=perform(testClassPredicted,testClass,c) % Analyze the performance of classification % For binary-class problem, the class labels should be 0 and 1. % For m-class problem, the class labels should be 0,1,2,3,...,m-1. % Usage: % perf=perform(testClassPredicted,testClass,c) % testClassPredicted: vect...
f7890d7443069be07f1213fe085b4f5eb5a2f287f6c077f81aeb4ddf31312d6a
MATLAB
3,974
104
%% ================================================================ % Script: generate_group_templates.m % Purpose: % Generate group-level functional network templates from individual % seed-based correlation maps using the MSC dataset. % % Description: % - Loads a 20-network reference parcellation % -...
49da4b80ec8b555bc978e48272470c4f44c7b523a4166b9909458981c0dbe26b
MATLAB
3,975
151
% ======================================================================== %> @brief plaidStimulus TODO %> %> %> %> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md % ======================================================================== classdef plaidStimulus < baseStimulus properties sf...
94ea54ebd37fdb9fc5122e5d7b10dcbef66240e1b5afe14fd6d9c7961490980b
MATLAB
3,977
105
clear %% load PreProcessed file load('PreProcessed.mat'); %% Re-org deltas and drop lost trials so dataset has no missing values % intialize empties and parameters tables_compiled = cell(1,5); trial_cutoff = 8; % number trials to keep norm_toggle = 0; % 0 to not, 1 to normalize as below % pull table values, drop NaN...
1b54fe75efd74d80fda67bdd68e0f8bee4e798d8207df94fe717d604c0590020
MATLAB
3,980
125
function motiontest() screen = max(Screen('Screens')); screenSize = []; cycleTime = 1.5; % time for one sweep, determines max speed bgColour = 0.5; dotColour = [0 0 0]'; dotSize = 0.5; nDots = 35; backlight = false; ptb = mySetup(screen,bgColour,screenSize); % ---- setup dot motion path nSteps = floor(cy...
d4ec6910737562320ec348fe1bbfd6bcf5fa18d07e651826e7d0669e1e82a994
MATLAB
3,994
100
function varargout = opx_opt_ui(varargin) % OPX_OPT_UI MATLAB code for opx_opt_ui.fig % OPX_OPT_UI, by itself, creates a new OPX_OPT_UI or raises the existing % singleton*. % % H = OPX_OPT_UI returns the handle to a new OPX_OPT_UI or the handle to % the existing singleton*. % % OPX_OPT_UI('CALL...
da6e92ea4397933b146b32558d52c85d751661e887337aebd9bfff8a1890114a
MATLAB
3,994
101
function behav = msExtractBehavoir(behav, trackLength) %MSEXTRACTBEHAVOIR Summary of this function goes here % Detailed explanation goes here ROI = uint16([behav.ROI(1) behav.ROI(1)+behav.ROI(3) behav.ROI(2) behav.ROI(2)+behav.ROI(4)]); %% Removes background % takes the median of each pixel from 100 frames spread...
1a7d00f7202c276292c9a60ee85a3102badc354d5a2af1e1d61711a39a2bb4bd
MATLAB
3,996
114
function [A,Y,numIter,tElapsed,finalResidual]=nmfrule(X,k,option) % NMF based on multiple update rules: X=AY, s.t. X,A,Y>=0. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=nmfrule(X,k) % [A,Y,numIter,tElapsed,finalResidual]=nmfrule(X,k,option) % X: non-negative matrix, dataset to factorize, each column is...
981829b814289f08632e526dc42dd69c52fd1e37d8a6e8af7d5ae548d535c932
MATLAB
4,001
124
%% 0. Setup % Initialization clear all; close all; clc; % Add folder with raw data to path addpath([pwd '/raw_data_mouse']) % Add library with eNDM functions to path addpath([pwd '/lib_eNDM_numeric']) addpath([pwd '/lib_eNDM_analytic']) % Load dataset of interest load Tasic_CTMaps.mat %sw...
9d68192d09f2465e5afcf099eaeeedb070fb9f2ea632765fc1a46e697b18d471
MATLAB
4,007
151
% SB1_POSTERIORMODE Find mode of posterior distribution (Bernoulli case) % % [W, UI, LMODE] = SB1_POSTERIORMODE(PHI,T,W,ALPHA,ITS) % % OUTPUT ARGUMENTS: % % W Parameter values at mode % UI Inverse Cholesky factor of Hessian % LMODE Log likelihood of data at mode % % INPUT ARGUM...
7cb802339868e9205dfe987b95c0accc883248677d955df83e6a226b81c3315c
MATLAB
4,011
119
function [Rlatt,Rrp,ind_rp,eff] = latmio_dir_connected(R,ITER,D) %LATMIO_DIR_CONNECTED Lattice with preserved in/out degree distribution % % [Rlatt,Rrp,ind_rp,eff] = latmio_dir_connected(R,ITER,D); % % This function "latticizes" a directed network, while preserving the in- % and out-degree distributions. In w...
1a2de29615774e1f6750ce16feff25bb95ff8498aaa833f5db80a48ba3c15c7b
MATLAB
4,013
108
function [ fl, desc ] = GetMLType(SVM) fl = []; if exist('SVM','var') && ~isempty(SVM) && isfield(SVM,'prog') switch SVM.prog case {'MikRVM', 'MKLRVM', 'MVTRVR','FAMRVR'} fl = 'RVM'; desc = 'Relevance Vector Machines'; case {'LIBSVM','SVMLIT','SVMPRF','PROSVM','CUDSVM'} ...
055a2e9228147614ca6d5e9d71b805e8d9ad9a16c6324437a5386d7dd683a167
MATLAB
4,016
102
function nk_MLInterpreter_batch(paramfile) global NM % Read parameter file % =========================== if ~exist(paramfile,'file') error([paramfile 'not found. Abort job!']); end fid = fopen(paramfile); params = textscan(fid, '%s'); fclose(fid); % Parse parameters in params % =================================...
dafe0e798bb4888251113b3f608bf2b22554f39a89c63ed18c1cdbe2139465d2
MATLAB
4,019
100
%% ================================================================ % Script: NeonatalAgePrediction_SVR_FC_dHCP_GSR.m % Purpose: % Evaluate the predictive validity of conventional functional % connectivity (FC) features in predicting neonatal chronological age % using linear SVR with 10-fold cross-validati...
9d850285d36a713eadf222dad3f76532a6d5baa64ef5eef27e4a68375e11966b
MATLAB
4,020
125
function [varargout] = LoadIntanSpikes(varargin) % MClust loading engine for Intan spike data. % % INPUT % fname - filename of spikes file % records_to_get - (optional) which spikes to retreive % record_units - (optional) code for the format of records_to_get % 1 - records_to_get is a timestamp list % ...
08c357d86266203855ae5f628ac66615090506b50d659e19888591ce38275e2d
MATLAB
4,026
91
function [I,Q,F]=motif4struct_wei(W) %MOTIF4STRUCT_WEI Intensity and coherence of structural class-4 motifs % % [I,Q,F] = motif4struct_wei(W); % % Structural motifs are patterns of local connectivity in complex % networks. Such patterns are particularly diverse in directed networks. % The motif frequency ...
9a723a8bab04522b40576b0ab5c5ebc88792ddba6e36032a9bfd38fa706ef067
MATLAB
4,029
105
clear %% load PreProcessed file load('PreProcessed.mat'); %% Re-org deltas and drop lost trials so dataset has no missing values % intialize empties and parameters tables_compiled = cell(1,5); trial_cutoff = 8; % number trials to keep norm_toggle = 0; % 0 to not, 1 to normalize as below % pull table values, drop Na...
40c511626f60a4f9ab110dd42491fba3d01cd9aff57d9f7df5b1997181b49618
MATLAB
4,039
147
% SB1_EXAMPLECLASSIFY Example of Sparse Bayes Classification % % SB1_EXAMPLECLASSIFY(N,KERNEL,WIDTH,MAXITS) % % INPUT ARGUMENTS: % % N Number of training points (up to 250) % KERNEL Kernel function to use (see SB1_KERNELFUNCTION) % WIDTH Kernel length scale parameter % MAXITS Maximum...
f108d92e7e1b909377fc1f3f61447655bc42e3a99e30c44847628f95ca1ba5e8
MATLAB
4,047
91
function [DEVMAP, PX] = nk_Devmap_config(DEVMAP, PX, NM, defaultsfl, parentstr) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = 0; end; algostr = 'pls'; covdesc = 'undefined'; covmat = []; loo = false; glabel = []; ncomp = 1; act = 0; if ~defaultsfl if ...
874a41cd0bc91d5ad3ade196902a675556a9fd8b1528310d13e86e8598679cf1
MATLAB
4,049
109
<<<<<<< HEAD function Z = zstream(action,D) % Compress/decompress stream of bytes using Deflate/Inflate % FORMAT Z = zstream('C',D) % D - data stream to compress (converted to uint8 if needed) % Z - compressed data stream (uint8 vector) % FORMAT D = zstream('D',Z) % Z - data stream to decompr...
a3a2bec539cc41bf492975b910db87857728c0cbc3e646d20f9759dd99fcfbd0
MATLAB
4,049
111
function [A,Y,numIter,tElapsed,finalResidual]=sparsenmfnnls(X,k,option) % Sparse-NMF based on NNLS: X=AY, s.t. X,A,Y>0. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=sparsenmfnnls(X,k) % [A,Y,numIter,tElapsed,finalResidual]=sparsenmfnnls(X,k,option) % X: non-negative matrix, dataset to factorize, each co...
11198905960695c482fda16d27e20de062b3960e05b7bc01a5dc44bb2018b95b
MATLAB
4,051
132
function [ YYY, LLL, CCC, fl ] = nk_PerfADASYN(Y, L, C, IN, noconcatfl) adasyn_beta = []; %let ADASYN choose default adasyn_kDensity = []; %let ADASYN choose default adasyn_kSMOTE = []; %let ADASYN choose default adasyn_normalized = false;%false...
aeb778b54f7ac3a280936d915150812ffba92a5a4408c646e794402baaa72aca
MATLAB
4,051
144
function [x, infos] = ronmf(V, rank, in_options) % Robust online non-negative matrix factorization (ONMF) with outliers (RONMF) algorithm. % % Inputs: % matrix V % rank rank % in_options options % Output: % w solution of w % infos information % % References: % ...
fc865d6eb38ed363620fbeafd2b72cb833d9c43c8cf6f536db37caf7a506c044
MATLAB
4,055
130
clc;clear;close all; %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Analyses\Data"); d=load('Jupiter_test_data_v3_align0to8.mat'); spikes=d.data.spikes; %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Data\PSTH_1_to_401_jupiter\PSTHwithFittingCurve\...
7b733ccd4aade2dd8ddf55ca1feb8567b9ffd5fc0a520b316eacabb57c074537
MATLAB
4,056
147
function [classes, perf, dist, sim, minimum] = nk_MultiDecideErrorCorrOutCodes(X, L, ClX, Groups, Coding, Decoding, ~, ProbComp) % [classes, ECOC] = nk_ErrorCorrOutCodes(X, L, ClX, Coding, Decoding, Weightflag) % =================================================================================== % % This function uses...
680c06d8550c35547d93cd024ba79f15b74506a886515dac16553edcac4a5b7c
MATLAB
4,061
118
% Sample data (replace with your actual data) dataset = { '25,776 patients (1,026 mortalities)'; '1,149 fetal heart images'; '259 elderly sarcopenia patients'; '161 TTE 3DE images'; '80 elderly patients with ALHF'; 'EchoNet-Dynamic, CAMUS, and local dataset'; 'CAMUS dataset (450 pati...
1759139c6561652405af053cde8cb6c13b4b223f7ae740ad0020a8897619c349
MATLAB
4,065
137
function [K,runtime]=lRWkernel(Graphs, lambda, small) % Compute a random walk kernel for a set of labeled graphs % Copyright 2012 Karsten Borgwardt, Nino Shervashidze % Input: Graphs - a 1xN array of graphs % Graphs(i).am is the adjacency matrix, Graphs(i).nl.values is a column vector of node labels. % lambda ...
fcd331589e26ca9a382b2d718fe214720d1c0e776455cf53498cb757c5198d8b
MATLAB
4,065
142
c1 = dir('ALL_CSV/sub-P*_ses-*_T1w_iso_biascorrected_histogram.csv'); c2 = dir('ALL_CSV/sub-P*_ses-*_T1w_iso_biascorrected_calib-lin_histogram.csv'); c3 = dir('ALL_CSV/sub-P*_ses-*_T1w_iso_biascorrected_calib-nonlin_histogram.csv'); c4 = dir('ALL_CSV/sub-P*_ses-*_T1w_iso_biascorrected_calib-nonlin2_histogram.csv'); c4b...
63d6b036b12d1ae24c3ba8f56cd1fe074363df95320259a52d686f6072cc418e
MATLAB
4,067
101
%% ================================================================ % Script: NeonatalAgePrediction_SVR_FOCA.m % Purpose: % Validate predictive validity of FOCA (Functional Orthogonal % Connectivity Architecture) features in predicting chronological % age during the neonatal period using linear SVR. % % ...
faa8d3a69905435e8c7c5af4ac9fac40a9719491229a959e824534e6ac641002
MATLAB
4,072
94
%========================================================================== %FORMAT AgreeFeat = ProbabilisticFea( F, EnsStrat ) %========================================================================== %Determines optimum feature space through the between-classifier agreement %of s...
b89d55f5938a227afd8787f759e88fc481ecad4acb5fcda625caa43d3351bb6b
MATLAB
4,074
123
%% Demo [Analytics vs Numeric] % % *****NB: Only the numeric function called is modified to include multiple costfun % options while we investigate the proper naming and reorganization of the % analytic functions***** % The goal of this demo is to apply eNDM to mouse data. % Uses numerical solutions for models using ...
42e915e16453c3d5889a9027bfb4ad00d510a50696e00e4f62d310b1b4f785f3
MATLAB
4,077
145
%% FUNCTION Construct_iMSF % Prepares input for iMSF optimization. This function is not intended to % directly called by users. See the Logistic_iMSF function. % %% 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...
cee37767b2b83bef6b22851511a2ee8a9474c1e3c634fe28a6a92b997b8feb29
MATLAB
4,080
119
function [C, C_raw, results_deconv, cc] = HALS_temporal(Y, A, C, maxIter, deconv_options) %% run HALS by fixating all spatial components % input: % Y: d*T, fluorescence data % A: d*K, spatial components % C: K*T, temporal components % maxIter: maximum iteration number % deconv_options: struct variable,...
adecc3d071977b4c34d86df2839a8cbc151dfd013753238f42309a79d7b42623
MATLAB
4,081
123
function [W, medialNeighbors] = triangulation2adjacency(faces, varargin) %% TRIANGULATION2ADJACENCY Returns adjacency matrix from face and ROI allocations % % ![](../IMAGES/adjacenciesAndParcellations.svg) % %% Syntax % W = triangulation2adjacency(faces, rois) % % %% Description % `W = triangulation2adjacency(f...
41fd24d312ed5a6b50a3bab2d0b5d350b997f484fe324d497769a77b1fd68fcd
MATLAB
4,082
123
classdef template_spatial < bt.model.template % This is a template function that allows rapid prototyping of new spatial % fitting by leveraging model.params.spatial_spectrum with absolutely % no regard for performance properties p n_modes = 6 n_truncate = 6 % Seems like a useful starting point for cosine va...
be78cdddac08d57351cfc613749d3cfe8ce33e0f35b2a434c4805175cd0dca77
MATLAB
4,084
84
% % EDFMEX uses the Eyelink EDF access API to read eyelink data % files into a matlab structure. % % Usage: % % edfdata = edfmex(filename,[start_at_record_number],[end_at_record_number], % [load_sample_flag], [load_event_flag],[consistency_check_flag]); % % Input: % % filename ...
c1b83417cb2b20aed26dfa3cc46ac52d65ce3adf685da26e1490fe9d40e3c3d3
MATLAB
4,088
156
% Non-negative Matrix Factorization via Nesterov's Optimal Gradient Method. % NeNMF: Matlab Code for Efficient NMF Solver % Reference % N. Guan, D. Tao, Z. Luo, and B. Yuan, "NeNMF: An Optimal Gradient Method % for Non-negative Matrix Factorization", IEEE Transactions on Signal % Processing,...
05dbac160ce80e9cb0cca886d7faf2f3123eac556887a4a12ce2340247e38f2f
MATLAB
4,092
109
% File: sst_jags_and_save.m function destMatPath = sst_jags_and_save(prep, modelfile, nChains, nSamples, nBurnin, nThin) % SST_JAGS_AND_SAVE Use PREP struct to run JAGS (matjagsRAND, parallel=0) and save outputs. if nargin < 2 || strlength(string(modelfile))==0, modelfile = "MainModel"; end if nargin < 3 || i...
eb9c9298b07ef4bb5303e3337570a6af8091ae5b4089192109171d5fa41c67d8
MATLAB
4,097
89
%% Prep: Generate example data rng(123); % Set the random seed n = 1000; x = randn(n, 3); A = [2, 1, -1; 1, 2, 1; 1, -1, 2]; s = x * A'; % Mix the signals % in the Matlab implementation of fastica(), whitening of the data is % internally performed, so we do not need to do it before hand % Perform ICA using FastICA [i...
295ffd5c7e9b4128c3edb75835a3ba66e03604f9fcfa7d16c40e6aad29a8ef1c
MATLAB
4,104
113
function [Bk,intk,sigmayykmaxrew_k,sigmattkmaxrew_k,Hopt] = extractmcdregres(resMcd,T,y,kmax,n,q,k,h,cutoffWeights) %EXTRACTMCDREGRES is an auxiliary function for cross-validation with RPCR and RSIMPLS. % It extracts mcd-regression coefficients for a certain k based on % the raw estimate of the slope and intercept o...
4190e633dda08e13b8bcca58189ac1b41777276cb330375067151850a2287f16
MATLAB
4,105
122
function [mappedX, mapping] = npe(X, no_dims, k, eig_impl) %NPE Perform the Neighborhood Preserving Embedding algorithm % % [mappedX, mapping] = npe(X, no_dims, k) % [mappedX, mapping] = npe(X, no_dims, k, eig_impl) % % Runs the Neighborhood Preserving Embedding algorithm on dataset X to % reduce it to di...
ad6ac703bdb486d2a9fcd51f259a9848e5e42fc28253f4b98f495f11dbbbff8d
MATLAB
4,105
147
% Parameters projectName = 'Name'; saveLocation = 'C:\...'; acclimationTiming = [0 4800]; baselineTiming = [4800 5400]; eventTiming = [0 1 29]; groupingFile = {'C:\ ... '}; viewPointFile = {'C:\ ...'}; timingFile = 'C:\ ... '; dv = 'actinteg'; groupName = 'grp_GroupLabel_1'; eventIndex = 'Light'; ...
12b4d35d839f6b825b8d6ec180171c212b1fb6f6aa2308536a6ffde8d8ee4ba9
MATLAB
4,107
138
function [cellids1 cellids2 bindex1 bindex2 cond_cellidx] = find_cellidx(condition,cell_dir,cellidx1,cellidx2,pdcells) %FIND_CELLIDX Cells matching selection criteria % [cellids1 cellids2 bindex1 bindex2 cond_cellidx] = find_cellidx(condition,cell_dir,cellidx1,cellidx2,pdcells) % Finds cellids matching selection...
fbb3242e34ce2ed215cedef500d4d9400e44ada3c1a9a06696ab047378f9d511
MATLAB
4,109
119
clear; clc; load('...\LFPdata_Fig5A') %% % Color paintLFP{1,1}=[.4 0 0]; % Small paintLFP{2,1}=[.9 .2 .2]; % Med paintLFP{3,1}=[1 .6 .6]; % Large figure() set(gcf,'Position',[-590 0 530 916]) tiledlayout(2,1) xTickLabels = {'Delta (1-4 Hz)', 'Theta (4-7 Hz)', 'Alpha (8-12 Hz)', 'Beta (13-30 Hz)', 'low...
411feed5d1d4a19aa8f4c16bc073d053cc02e55ca76340541cbabcada5104ac1
MATLAB
4,113
145
function [model] = ml_binaryclass_HSVM(X,y,options) % ml_binaryclass_HSVM(X,y,options) % % Description: % - Fits a linear classifier using Huberized SVM % % Options: % - addBias: adds a bias variable (default: 0) % - epsilon: threshold for Huberized hinge loss (default: 0.5) % - lambdaL2: strength of L2-regulari...
cd5e0e2329adbfdf2374b5f713c7fb4b61993432466668c59de4afb32787c4e9
MATLAB
4,117
210
function [x,y,z]=readsol(fname,K,m) %READSOL Read solution from CSDP % % [x,y,z]=readsol(fname,K,m) % % fname File name to read solution from. % K structure of the matrices. % m size of y vector. % % Modified 7/15/04, for greater MATLAB acceleration. % % % % This file is part of the Matlab T...
9cba2e3ca10074df56e0686fce7954a31f7cfa94a827cd0b64dad76abe83e752
MATLAB
4,123
162
function [surface, M, S] = calc_mass_stiffness(surface, lump) % calc_mass_stiffness.m % % Calculate the mass and stiffness matrices of the input surface/volume % % Inputs: surface : surface structure with fields % 'vertices' - vertex locations [Nx3], N = number of vertices % 'faces' ...
c4a0e0049cd4ad9fbebb797c6c126339c6b0e33f84ee554002e53952f2c2a5fc
MATLAB
4,137
110
classdef spatial_express_t0_phased < bt.model.template_spatial % This is a template function that allows rapid prototyping of new spatial % fitting by leveraging model.params.spatial_spectrum with absolutely % no regard for performance properties % No new properties required by this derived class end methods ...
4ebe18a730d1027ec664d615355516e85d32e64e0f02d716b9413a105e4c3f55
MATLAB
4,144
118
function [DM LrC valid_channels] = LRatio_pd_ssrt(cellid,feature_names,valid_channels) %LRATIO L-ratio and Isolation Distance. % [DM LRC] = LRATIO(CELLID,FEATURE_NAMES,VALID_CHANNELS) calculates % cluster quality measures (Isolation Distance, DM; L-ratio,LRC) for a % given cell (CELLID) using the given clus...
1464b06157872d72b0d7e39d0460329719240de3ab850ef9ca44f38b7fe0768c
MATLAB
4,145
112
function mappedX = llc(X, neighbor, no_dims, R, Z, eig_impl) %LLC Runs the LLC algorithm (given information on the formed factor analyzers) % % mappedX = llc(X, k, no_dims, R, Z, eig_impl) % % Runs the LLC algorithm (given information on the formed factor % analyzers). The variable X contains the dataset (transposed)...
e246bf172828aaf9e0f4632cc59a25352328bb6eff763a5d2520a3abaaa678bf
MATLAB
4,154
130
function [mappedX, mapping] = hlle(X, no_dims, k, eig_impl) %HLLE Runs the Hessian LLE algorithm % % mappedX = hlle(X, no_dims, k, eig_impl) % % Runs the Hessian LLE algorithm on dataset X to reduce its dimensionality % to no_dims. The variable k specifies the number of nearest negihbors that % is used. % % % This f...
b98117e0be065cb39ad8869c132bedfd48e820a234864b87cb2b215c93360f5c
MATLAB
4,157
127
function options = pnopt_optimset( varargin ) % pnopt_optimset : Set options for PNOPT % % options = pnopt_optimset( 'param1', val1, 'param2', val2,... ) creates an options % structure in which the named parameters have the specified values. Default % values are used for parameters that are not specified. % % pn...
2532ecb46ece0b3ecab207d10fd84544191f5a8c86a7c6e23f391d248bd7bb2a
MATLAB
4,162
128
%% plotting sample traces for figs % load deconvolved trace trace_ex = load("085_LEC286239_D1awake_DeconTrace.csv"); times = readtable("085_LEC286239_D1awake_notes.csv"); % z-score for scaling consistency Decon_Z = zscore(trace_ex, 0, 2); frames_odors = ceil(times.Var1/1000*5); % gap between traces; adjust ...
00956bd0cf919f3b713ff1ed06931d7955631a2a63c06410549d2d9a078ada7a
MATLAB
4,164
123
<<<<<<< HEAD function varargout = subsref(this,subs) % Subscript referencing for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: subsref.m 7577 2019-04-24 08:59:56Z guillaume $ if l...
5a9663484bb00986ef3730b774df757983afb0d4dcbe71e38e0dc2879a1cd662
MATLAB
4,167
100
function mp2rage_run_estimate_T1(estimateT1) %MP2RAGE_RUN_ESTIMATE_T1 Executable job that estimates the quantitative %T1map and R1map=1/T1map from the UNI image and the sequence parameters. % % The core code of this function is an implementation of https://github.com/JosePMarques/MP2RAGE-related-scripts/blob/master/fun...
6048e92b4389f6d41770f21ccf59790ae33d997a08b0fc6bc4f86d9b66875354
MATLAB
4,169
132
function [eigvector, eigvalue, elapse] = KLPP(W, options, data) % KLPP: Kernel Locality Preserving Projections % % [eigvector, eigvalue] = KLPP(W, options, data) % % Input: % data - % if options.Kernel = 0 % Data matrix. Each row vector...
fe5ae7589cf5b4b79a60b07486dc97eeaeb229fe47a3b8310ab7a81379270065
MATLAB
4,171
152
function [Z,p1,U,p2,mrl,ftm] = b_rao3_mod(x) %RAO Rao's Spacing Test. % [Z,P1,U,P2] = RAO(X) calculates Rayleigh's Z-Statistic (Z) and Rao's % U-Statistic (U) with the corresponding p-values (P1 and P2). Input % argument X is the vector of phase angles in radians. % % See also WATSON and WATSONTWO. ...
e3b68bcfc7d0f7b0f9d8b89cc3a7160dce5f72e1c594bd51e8115d0474c62071
MATLAB
4,173
116
function [Xk]=constrainedQPActive(H,C,A,B) % solve 0.5*tr(X^THX + CX) % s.t. A*X -B <=0 % -X<=0 % where A is a row vector, B is a row vector %%%% % Copyright (C) <2012> <Yifeng Li> % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as p...
435146c614658d59980ab4699ce8505a3b62daf7d6a7bc4e6c33c8568c9d8c37
MATLAB
4,175
85
nsub = 25; for k = 1:nsub if k == 1 subject = 'sub23'; familiarity_rating = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0]; elseif k == 2 subject = 'sub22'; familiarity_rating = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1...
7619704ab40113d4703adfa2fa84ec9c5cc10dccd2728e4606bc21d103fb4570
MATLAB
4,178
93
% homeo = [2344, 801, 1162, 2305, 1540, 3062, 3240, 1717]; rng(0); % studylist = {'asyn_mouse', 'asyn_human'}; studylist = {'asyn_mouse'}; niters = 1; R2s = zeros(1,niters); for i = 1:length(studylist) outputs_ndm = stdNDM_mouse('study',studylist{i},'bootstrapping',1,'niters',100,... 'w_dir',1,'volcorrect',...
720e934365ee48a7292c63bfec15616affc3b3fb2bfbcd18eb162a5a44a49b10
MATLAB
4,185
109
function [K, Pset] = kfcnnls2(CtC, CtA) % kernel FCNNLS solving min ||phi(A)-phi(C)*K||_F, s.t. K>=0, for given A and C. % CtC, kernel matrix, k(C,C). % CtA, kernel matrix, k(C,A). % References: % [1] \bibitem{NNLS2004} % M.H. Van Benthem and M.R. Keenan, % ``Fast algorithm for the solution of large-scale non-negaive c...
94bdcf812eb7b258a59d5f0af82e77c64fa8a568232f5bcdf771b71e767321b5
MATLAB
4,188
136
% script to create animalBehaviorAnalysis object and perform built-in analyses % % SurveyBott, 2018, info@surveybott.com function cmd = run_aba(cmd,varargin) % inputs p = inputParser; p.addRequired('cmd',@(x) isstruct(x) && all(isfield(x,{'mutant','lights','files','savePath','projectName'})) && all(isfield(x.mutant,{...
b8e2df42d6639b1291ba138d9c072ecc7f29b2071c91405f6c42112ae93e1d00
MATLAB
4,192
110
function [K, Pset] = NNQPActiveSet(H, G) % kernel l1 Regularized NNQP solving min K' H K + G' K s.t. K>=0, for given H and G. % H: kernel matrix, Hessian. % G: kernel matrix, Gradient. % References: % [1] \bibitem{NNLS2004} % M.H. Van Benthem and M.R. Keenan, % ``Fast algorithm for the solution of large-scale non-negai...
f0a5c2a444a75f80cbe32d68ce53243d2b1d86d003e3db59a4926412c533ceca
MATLAB
4,194
82
function [PFE, act] = nk_ProbalisticFea_config(PFE, parentstr, defaultsfl) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = 0; end tPFE.flag = 0; % Perform PFE tPFE.Mode = 1; % Perform PFE tPFE.Perc = 90; % Absolute number/Percentage of CV1 feature mask agree...
31c0e62734ed91e715ae24086db38e7ac6e27808d2f37ffad1e7825641d55597
MATLAB
4,196
149
function [exactp_ersp,maskersp,alpha2] = boostat_eeglab_J(P,f,alpha,naccu,isim,mcorrect,varargin) %BOOTSTAT_EEGLAB_J Bootstrap statistics on time-frequency data % [exactp_ersp,maskersp,alpha2] = boostat_eeglab_J(P,f,alpha,naccu,isim,mcorrect,...) % Performs bootstrap statistics using BOOTSTAT function o...
d1071be0f74fe1804ce2e6bcbfb5868047c99d9294ccad819e2ba569d43ede16
MATLAB
4,198
113
function machine = train_lin_rbm(X, h, eta, max_iter, weight_cost) %TRAIN_RBM Trains a Restricted Boltzmann Machine with Gaussian hiddens % % machine = train_lin_rbm(X, h, eta, max_iter, weight_cost) % % Trains a first-order Restricted Boltzmann Machine on dataset X. The RBM % has h hidden nodes (default = 20). The t...
dc01fcb37ee3c469a5659ec809091605286d52eee3c5d5e1bcd26891d4107813
MATLAB
4,202
83
function runOptickaTests(varargin) %> Run all Opticka class-based unit tests and display results. %> %> Usage: %> runOptickaTests %> run all tests %> runOptickaTests('verbose') %> run with verbose output %> runOptickaTests('HSMOption1Test') %> run a specific test class %> %> This script is...
d345c229b125a18294ca516e5a64d175d5f2cbf44cd8ee7d4d5b7225cc407fc2
MATLAB
4,205
121
function [f_out,fit_data,plot_data] = fit_spectrum(model,target_f,target_P,prior_pp,initial_values,npoints,target_state,skip_fit,debugmode) % Take in a model, spectrum, prior distribution, initial values, and chain length % Return a feather object % The posterior distribution correctly reflects the skip_fit state of...
f25615e46f1a17bd0631301a5b574a7e16e4ddd831e9d11c6355e085c506ce86
MATLAB
4,209
109
function [mappedX, mapping] = kernel_pca(X, no_dims, varargin) %KERNEL_PCA Perform the kernel PCA algorithm % % [mappedX, mapping] = kernel_pca(X, no_dims) % [mappedX, mapping] = kernel_pca(X, no_dims, kernel) % [mappedX, mapping] = kernel_pca(X, no_dims, kernel, param1) % [mappedX, mapping] = kernel_pca(X, no_...