sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
481a7bf82e385ece05ed9a8788a75df21c2b884bccbd1febc98ac506ecdc13d3
MATLAB
2,507
76
% eNDM General w/ Directionality % % Evaluate eNDM General predictions [y] at desired time stamps. % % Input: % x0 = Initial Condition (n_ROI x 1) % time_stamps = provided in units given by experiment (1 x n_t) % C = connectivity matrix (n_ROI x n_ROI) - SHOULD BE % ...
103e729b0220492321d82fca73e33d0c861f17673a1e8ce5e3a0d4aef93c5627
MATLAB
2,509
103
function [H, binsUsed] = HistISI(T, varargin) % H = HistISI(TS, parameters) % H = HistISI(TS, 'maxLogISI','maxLogISI',5) for fixed upper limit 10^5 msec (or 100 sec) % % INPUTS: % TS = a single ts object % % OUTPUTS: % H = histogram of ISI % N = bin centers % % PARAMETERS: % nBins 500 % ma...
1d9d415aa8f71b35d8b65937f3f4af334c11c9a21e3cfa74409238498e48f5eb
MATLAB
2,511
81
function [cij,flag] = makerandCIJdegreesfixed(in,out) %MAKERANDCIJDEGREESFIXED Synthetic directed random network % % CIJ = makerandCIJdegreesfixed(N,K); % % This function generates a directed random network with a specified % in-degree and out-degree sequence. The function returns a flag, % denoting wh...
794718c74ae67056a52d13e2b5af382f7e7eafb6095a407114a8a9dca8c94ac6
MATLAB
2,513
72
function T = spm_type(x, arg) % Translate data type specifiers between SPM & MATLAB representations % FORMAT T = spm_type(x, arg) % x - specifier % T - type % arg - optional string argument, can be: % - 'maxval' - return maximum allowed value. % - 'minval' - return minimum allowed value. % ...
8bf29dcf85f8548ab3da71874a1c5f888165aceda0e861e277560cf4d146d028
MATLAB
2,519
131
function [n] = card_3inter(L1, L2, L3, l1, l2, l3) % count cardinalities of subsets L1&L2&L3 (n(7)), L1&L2\L3 (n(4)), L1&L3\L2 (n(5)), L2&L3\L1 (n(6)), % L1\(L2|L3) (n(1)), L2\(L1|L3) (n(2)), L3\(L1|L2) (n(3)) % Li - a set % li - number of elements in Li % Author: Nino Shervashidze - nino.shervashidze@tuebingen.mpg.d...
1c0e683efda458ebbf5a056c031236065e29cb3a139dea22be46c25b9b2b6bc0
MATLAB
2,524
85
% ======================================================================== classdef alyxManagerHarness < alyxManager %> @class alyxManagerHarness %> @brief Test-only subclass exposing protected alyxManager seams. % ======================================================================== properties nextStatusCode do...
ac9eb6e8ecab86e1da8ed9d145db882dc4b9b6f37ff673b9184a4c32b7489ff7
MATLAB
2,524
109
function [W, info] = MTFLC_ADMM_WSolver... (X, y, Th, Z, rho, lambda1, lambda2, opts) % % Multi-Task Feature Learning with Calibration - ADMM % Subproblem: W % % Objective % min_W { rho/2 sum_i^m ||theta_i/rho - z_i + y+i - X_iwi|| % + lambda2/2 ||W||_F^2 + lambda1 ||W||_{1,2} % } % % IN...
996813b4cc0857d5231e9632646ba857e82326ecf85f6b04536743c772666ff5
MATLAB
2,527
79
function [mappedX, mapping] = isomap(X, no_dims, k) %ISOMAP Runs the Isomap algorithm % % [mappedX, mapping] = isomap(X, no_dims, k); % % The functions runs the Isomap algorithm on dataset X to reduce the % dimensionality of the dataset to no_dims. The number of neighbors used in % the compuations is set by k (defau...
f7804f6c8731cd94f747f8567125e32f4f1bb8387724322a937cebd9873b53b6
MATLAB
2,527
101
function [K,elapse] = constructKernel(fea_a,fea_b,options) % function [K,elapse] = constructKernel(fea_a,fea_b,options) % Usage: % K = constructKernel(fea_a,[],options) % % K = constructKernel(fea_a,fea_b,options) % % fea_a, fea_b : Rows of vectors of data points. % % options : Struct value in Matlab. The f...
ee488cddc1c2de3dda2c312ae2f9439c983d36a98a5c893faa4c338e910bdcae
MATLAB
2,530
82
% This is an example of how to extract features using kernel-NMF %%%% % 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 published by % the Free Software Foundation, either version 3 of the License, or %...
40eed8620eff17a0a682960dcab94d3597608d396a6f44d027a4bb58b7f44b56
MATLAB
2,531
83
%% file example_Dirty.m % this file shows the usage of Least_Dirty.m function % and study the group sparsity patterns. % %% OBJECTIVE % argmin_W ||X(P+Q) - Y||_F^2 + lambda1*||P||_{1,inf} + lambda2*||Q||_{1,1} % s.t. W = P + Q % %% LICENSE % This program is free software: you can redistribute it and/or modify % ...
fc5d559122a8e474b015e525beee6383ba00bb638ee1164e4595cfd4eb37a7bb
MATLAB
2,531
86
function [ind, R] = nk_FEAST(Y, label, k, params) global MODEFL VERBOSE [~,n] = size(Y); switch params.cmd case 'discretize' if VERBOSE; fprintf(' Discretize [ %g : %g : %g ]... ', ... params.DISCRET.binstart,params.DISCRET.binsteps, params.DISCRET.binstop); end ...
e9d5e8895e921c5c357ac99ebce448fcc25ef9362d2f5237d7c44a0520a42d80
MATLAB
2,533
83
function [varargout] = MIToolbox(functionName, varargin) %function [varargout] = MIToolbox(functionName, varargin) % %Provides access to the functions in MIToolboxMex % %Expects column vectors, will not work with row vectors % %Function list %"joint" = joint variable of the matrix %"entropy" or "h" = H(X) %"Conditional...
364d00731a5bcb66c78e3ae9eef077931b7c9c4da69d8cff6f850e4efbc7ab1c
MATLAB
2,534
62
function TEMPL = nk_GenTemplParam(PREPROC, CV, MODEFL, RAND, Y, inp, kbin, paramfl, act) if ~exist("act","var") || isempty(act), act = 'params'; end % For factorization methods: TEMPLATE MAPPING if PREPROC.BINMOD ukbin = kbin; SrcParam.binmult = 1; else ukbin = 1; SrcParam.binmult = 0; end SrcParam.CV...
074353d80f8b67868f0824dc769e673aafe2bf744ebfcac2baf8edb1dbef18cc
MATLAB
2,536
95
function [cc,A,B,U,V,lW] = palm_cca(varargin) % Do CCA via QR & SVD. % % Usage: % [cc,A,B,U,V] = palm_cca(X,Y,df) % % Inputs: % X and Y : Arrays with N rows. The number of columns % in each may differ. The ranks of X and Y % are not checked for speed. % df : Optional. Degrees of freedom (N - ra...
db8005691b497c2374b7e2bb80fa1404769ef805d957c8cb7f8d6fb8a547bae4
MATLAB
2,548
87
function [KKexpected] = RunOneKKwik(KKfn, FILEno, nKKFeatures, minClusters, maxClusters, varargin) % % [status, KKexpected] = RunOneKKwik(KKfn, FILEno, nKKFeatures, minClusters, maxClusters, varargin) % % Parameters % USECONDOR = false % SubSetRate = 1 % for 1/10 use 0.1 % for 1/100 use 0.01 KKwikName = 'Klust...
3f40e8af271997a9d4e927502d28432476aed02d7b86cb37a4700179cf039443
MATLAB
2,552
63
function PD_SSRT_MAIN(rootdir, filesdir) % PD_SSRT_BEHAV_MAIN Main function for analysis of Stop Signal % Reaction Time task of Parkinsonian patients implanted with deep brain % stimulator. % % Input parameters: % ROOTDIR path to directory to save results % % FILESDIR path to directory c...
4143b553edba0d5961a2610a7b7b1b7af8432d670ad3750d1be827887f5c7881
MATLAB
2,553
84
classdef awsManager < handle % Use aws CLI command from MATLAB % Can install cross-platform with pixi: % > pixi global install awscli % % Secrets can be kept locally using setSecret('AWS_ID') % and setSecret('AWS_KEY'), then passed with getSecret % e.g. % aws=awsManager(getSecret("AWS_ID"),getSecret("AWS_KEY"...
1d460b5a09484a9acdc9768f140f3989b13c9911d7c39959c0f904bedabc180e
MATLAB
2,556
79
function err = reconstruction_error(O, R) %RECONSTRUCTION_ERROR Computes the reconstruction error up to affine transformations % % err = reconstruction_error(O, R) % % The function computes the reconstruction error of the dataset R (given % the original dataset O) up to all linear transformations. The % function do...
b197ec94bc203bdc248c75b17132b26fa7fc3705a3772e17521dc4d4e3f1bfb9
MATLAB
2,560
79
function [T, VO] = nk_ResizeImg(P, Voxdim, BB, FileName) % nk_ResizeImg -- resample images to have specified voxel dims and BBox % nk_ResizeImg(P, voxdim, bb) % % Output images will be prefixed with 'r', and will have voxel dimensions % equal to voxdim. Use NaNs to determine voxdims from transformation matrix % of inpu...
6228996bb600ee54af02bc0267853b29cd2eb5a82aab2b1c61757c5e99721414
MATLAB
2,572
66
function [WCData, WCNames, WCPars] = feature_WaveletCoeffs(V, ttChannelValidity, ~) % MClust % [WCData, WCNames] = feature_WaveletCoeffs(V, ttChannelValidity) % Calculate wavelet coefficients for each channel % % INPUTS % V = TT tsd % ttChannelValidity = nCh x 1 of booleans % % OUTPUTS % Data - nSpikes x (NC*n...
fdc32a585f1fc44a615810a6d7e4f82bf288d6957a06c6c3a04080b3d700e1da
MATLAB
2,572
62
function [ParcellationAtlas, act] = cv_ExtGraphConstr_config(ConstructionMethod, ParcellationAtlas, defaultsfl, parentstr) global NM if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if (~exist('ParcellationAtlas','var') || isempty(ParcellationAtlas)); Parc...
c2e6d19aea04cb9ee819c503e1d29ea99c37f9481e6c8e8c672fc14e4bdcc060
MATLAB
2,577
86
function p = tcdf(x,v,uflag) %TCDF Student's T cumulative distribution function (cdf). % P = TCDF(X,V) computes the cdf for Student's T distribution % with V degrees of freedom, at the values in X. % % The size of P is the common size of X and V. A scalar input % functions as a constant matrix of the same siz...
bb99cd469049d4870cd84598579a93ae46dad3dc2744419b887d85eb70880106
MATLAB
2,580
96
function [t, wv] = LoadTDT(varargin) global hTTI; global TTICurrentServer TTICurrentTank TTICurrentBlock TTICurrentEvent TTICurrentChannel; TTI_ext = '.mc'; filename = ''; flag = 0; if nargin == 1 filename = varargin; elseif nargin == 2 if strcmp(varargin{1}, 'get') switch (varargin{2}) c...
62fea2b8110e0dc7ea93871580d1b851b4193afa2addf8957c77f4f3462d1c62
MATLAB
2,581
88
function [ out ] = predictBBQ( bbq, PTE, option ) % This function used for calibrating the probabilities % Input: % - bbq: the BBQ model % - PTE : vector of Uncalibrated probabilities % - option: 0 use model selection, 1 use model Averaging % Output: % - out : vector of calibrated probabili...
1cfc61a74d8592843024d069b59c528798aa7f757a87d44cba4d31f7c52c2ab8
MATLAB
2,587
106
function [W, funcVal] = Least_NCFGLassoF1(X, Y, lambda, gamma, opts) % Non-Convex Fused Group Lasso with Least Squares Loss (Formulation 1). % By Jiayu Zhou (jiayu.zhou@asu.edu) Dec. 2011 % Objective (Non-Convex): % argmin_W { \sum_{i=1}^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + lambda * \sum_{i=1}^d...
e06f72c8fa55b180ac344bfd061e7535f7c6d38cfb4c8617426a5dea412b2a9a
MATLAB
2,590
82
%% photometryPriProcess % This function reads the csv file and cut before and after movie recording % fit data to correct the drifting effect: two term exponential % correct movement flactuations by 405 ch % get zscore of 470 % Inputs: % ca_file: data of 405 and 470, 2nd column is the data % event_file: d...
4952f9b555156b81b73a70975ff9a612c32351c13deacac13e501986317324cd
MATLAB
2,599
91
% demonstration file for NMFLibrary. % % This file illustrates how to use this library. % % This file is part of NMFLibrary. % % Created by H.Kasai on July 24, 2018 % Modified by H.Kasai on July 30, 2018 clc; clear; close all; %% generate synthetic data of (mxn) matrix m= 150; n = 150; V = rand(m,n); %% Initialize...
c6903bdc4d0f07eb9ee98794e5647701ba560b6ad7c384d119ecd1507a31476d
MATLAB
2,599
72
function corrmapfig(coefD,pvalD,normtype,times,timinx,f,patnm,condi,side,event,evty,act_chan,figdir,correct, varargin) % CORRMAPFIG Correlation map figure % CORRMAPFIG(coefD,pvalD,normtype,times,timinx,f,patnm,condi,side,event,evty,act_chan,figdir) % Generates a figure of correlation map COEFD, contours signifi...
49b79e10393b99244dacc782115958b7a7f7a8019b15ec3901a6ba5bfd339976
MATLAB
2,606
82
function [id, rect] = CreateProceduralPseudoYellowGrating(windowPtr, width, height, color1, color2, color3, color4, radius) % Global GL struct: Will be initialized in the LoadGLSLProgramFromFiles % below: global GL; % Make sure we have support for shaders, abort otherwise: AssertGLSL; if nargin < 3 || isempty(window...
33d5269c0a9e3714f575c4f41090e10c6f9a6d10d212b473fad2fcd872b03604
MATLAB
2,617
108
% Test file for GNMF and SDNMF % % Created by Deng Cai % Modified by H.Kasai on July 21, 2018 clc; clear; close all; dataset = 'COIL20'; %dataset = 'PIE'; %% load CBCL face datasets fprintf('Loading %s dataset ... ', dataset); if strcmp(dataset, 'COIL20') load('../data/COIL20.mat'); fea = AllSet.X'; ...
edd5da2c27f8b0c9537f14ac5afadaa8aeb9355dd00755c3ddee852a95c71625
MATLAB
2,622
106
function [R2,out]=rsquared(x,y,kmax,method,h) %RSQUARED calculates the R-squared value of the robust or classical PCR/PLS analysis. This function % is used in rpcr.m and rsimpls.m. % % The Robust R-squared is described in: % Hubert, M., Verboven, S. (2003), % "A robust PCR method for high-dimensional regressor...
8d6a0a44b4f8533068a41e7937419b481c05eb29e9d901aaa6d897af8315e1a2
MATLAB
2,623
87
function [f, ax] = barMLI(casenum, MLIcont, feats, refdata, sortfl, uiaxes, uiaxes2) %newdata if exist('uiaxes','var') ax = uiaxes; f=0; else f=figure; f.Position = [100 100 750 750]; ax = gca; end hold(ax,'on'); nF = numel(feats); y = MLIcont.Y_mapped(casenum,:); y_ciu = MLIcont.Y_mapped_ciu(case...
1b276ae6c25bdbc70690c500980c291e70884133b77b68f7501b03ad2b6b92a9
MATLAB
2,626
97
function demo_nenmf() % % demonstration file for NMFLibrary. % % This file illustrates how to use this library. % This demonstrates NeNMF with multiplicative updates (MU) algorithm and % hierarchical alternative least squares (Hierarchical ALS) algorithm. % % This file is part of NMFLibrary. % % Created by H.Kasai on...
81aa2dfb88ea181987d34e377a45c8b8c53c0703c0ad24ae9356cc9232c93bcc
MATLAB
2,626
74
function [idx_feat, weights, score] = gflip(X_train, Y_train, extra_param, cpus) % [idx_feat, score] = gflip(X_train, Y_train, extra_param); % % input: X_train(i,j) is the value of feature j in training instance i. % Y_train(i) is the label of training instance i. % extra_param is a struct that may conta...
f616e00904dae93ec313b5a77cf66c21fe496c3506ddf9594decea57dcb272b7
MATLAB
2,626
108
%Demonstrates the mvrvm algorithm on a toy example. Part of the code was %derived from Tipping's matlab code for top down rvm for sing variate %output. % @file mvrvm_example.m % Author Arasanathan Thayananthan ( at315@cam.ac.uk) % (c) Copyright University of Cambridge % % This library is fre...
022726fdbe4507c90a3df33b55cab87853b035df07de89da6dc42b23d4e21906
MATLAB
2,627
105
function [W, funcVal] = Least_NCFGLassoF2(X, Y, lambda, beta, opts) % Non-Convex Fused Group Lasso with Least Squares Loss (Formulation 2). % By Jiayu Zhou (jiayu.zhou@asu.edu) Dec. 2011 % Objective (Non-Convex): % argmin_W { \sum_{i=1}^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + lambda * \sum_{i=1}^d \sqrt{ \|R...
fd4b36c1d72991b301a566c3389992c6b2f6deed93bfebba7a8da76425d50f07
MATLAB
2,637
67
function [ PRUNE, PX, act ] = nk_Prune_config(PRUNE, PX, parentstr, defaultsfl) PruneZero = 1; PruneNan = 1; PruneInf = 1; PrunePerc = []; if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if isfield(PRUNE,'zero'), PruneZero = PRUNE.zero; end if isfield(PRUNE,'n...
fc1349390b8cd178942a34fd07131ad154356ab838a5eef5707dee0eb6a2ba76
MATLAB
2,640
76
function [ param, act ] = nk_DECTRE_config(prog, param, modefl, defaultsfl) if strcmp(modefl,'classification'), modefl = 'binaryclass'; end if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = true; end probflag = 0; cachesize = 500; shrinkheur = 1; termcrit = 0.001; weighting = 0; act = 0; if isfield(...
c620787efda2946761977b5349168ac95c0e44ad25859eaf5c35fc7bc28cb28e
MATLAB
2,641
90
function varargout = dtype(varargin) % file_array's dtype property % FORMAT varargout = dtype(varargin) % For getting the value % dat = dtype(obj) % % For setting the value % obj = dtype(obj,dat) %__________________________________________________________________________ % Copyright (C) 2005-2017 Wellcome Trust Centre ...
d37ab0c8d0a482b13290b224eb456fd8ee4a6eb0f2e4bd218e5c37c343beb31b
MATLAB
2,649
78
function [imputed_data]=SeqkNN(data, K, traindata) % SeqKNN: Sequential KNN imputation method % This function estimates missing values sequentially from the gene that has % least missing rate in microarray data, using weighted mean of k nearest neighbors. % % <Usage> % imputed_data=SeqKNN(data, k); % % <Arguments> % da...
5f659afee0837ff383cee088a700633d38569b578ddeb31dad2c1a1a616f1369
MATLAB
2,652
67
classdef full_b_ratio < 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_b_ratio() % Constructor sel...
17576441f0a2770d8d7639c99a95c93c11cc4dabd0395bef0f9f9255c1eaf97d
MATLAB
2,653
91
function K=dynamicSystems_kernel2(D1,D2,param) % Dynamical system kernel function % D1,D2: 3-way tensors, each frontal slice is a sample % param: row vector, [rank,lambda] % K: matrix, the kernel matrix % Reference: % K.M. Borgwardt, Class prediction from time series gene expression % profiles using dynamical systems k...
662aed952586ab20a5099a3bdfc49b7ee452cae1ab4776ef18c4c853380a7a21
MATLAB
2,659
84
%% file example_Trace.m % this file shows the usage of Least_Trace.m function % and study the low-rank patterns. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 \|W\|_*} % where \|W\|_* = sum(svd(W, 0)) is the trace norm % %% LICENSE % This program is free software:...
dbfc37f2df1b4925463f39c052b020539707da26615bd1afd36e8a5996297030
MATLAB
2,661
117
% plot full face frame and selected ROI function PlotFrame(h) kc = h.whichfile; k = h.whichview; wROI = h.wROI; % smoothing constants sc = h.sc; tsc = h.tsc; axes(h.axes1); h.vr{kc}.currentTime = double(h.cframe-1) / h.vr{kc}.FrameRate; frame = readFrame(h.vr{kc}); if size(frame,3) == 3 isRGB = 1; els...
067d4e5ccd4b44071822c1115e307bb1ab9695d269a5413336ce6f0a719232ca
MATLAB
2,662
72
%% FILE INSTALL.m % mex the C files used in the MALSAR package. % %% 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 Free Software Foundation, either version 3 of the License, or % (at your option) any ...
076dab2857cdaccf4ecab363dfbb01be5f14f4384e641ca359756bb46789dba6
MATLAB
2,662
65
function [f,F]=motif4struct_bin(A) %MOTIF4STRUCT_BIN Frequency of structural class-4 motifs % % [f,F] = motif4struct_bin(A); % % Structural motifs are patterns of local connectivity in complex % networks. Such patterns are particularly diverse in directed networks. % The motif frequency of occurrence arou...
ac4fceed19d0d3fdcf3395dfc387002afce5d4eaaef97b0fecc7350c72af2735
MATLAB
2,663
80
% This is an example of how to select features using NMF % 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 published by % the Free Software Foundation, either version 3 of the License, or % any later ve...
134d74a9c069ba6be1a45fe34ec805c538dab64bc3348da2abce3fa5aa770886
MATLAB
2,665
94
function plotnumbers(x,y,number1,number2,ask,z,number3); %PLOTNUMBERS marks the points (x,y,z) on a plot with their index number. % % Required input: % x : x-coordinates of the plotted points % y : y-coordinates of the plotted points % % Optional input: % number1 : number of points with largest distance on ...
21f6c4f511560ea2307dc1b6a47e813100bed32c09a75c267807a25d1a0701bd
MATLAB
2,666
82
function [early, respt, early2, respt2, situation, ARD_time,... ARD_time2, MTL_time, MTL_time2] = default_cycle(flipTime, ser, win) %DEFAULT CYCLE % [EARLY, RESPT, EARLY2, RESPT2, SITUATION, ARD_time, ARD_time2]... % = DEFAULT_CYCLE(FLIPTIME, SER, WIN) % Waits for user keypresses. If a keypress occures, ...
9db1b0d597e428429e67747bc6923af3edd620425f90bec833a2ff0fff8ed7d6
MATLAB
2,676
80
function [R,eff] = randmio_und_signed(W, ITER) % RANDMIO_UND_SIGNED Random graph with preserved signed degree distribution % % R = randmio_und_signed(W,ITER); % [R,eff] = randmio_und_signed(W,ITER); % % This function randomizes an undirected network with positively and % negatively signed connections, whi...
2f193b2722fabc7cc0839643fec8319512459919051e0413a4586b3842605d72
MATLAB
2,677
79
%Plot avg component map in a cluster %ver 200904 %pre_ver: none %% set parameters (initialize) try close(2041); end clear all; SL = '\'; FilePath = ''; if isunix mypath; FilePath = '~/liang/'; %directory SL = '/'; end DR_PBase_setup; %load setup file MN = 'motion'; if strcmpi(MN, 'motionles...
f30cdb7ee6c7ceb3cfbf01d9eeee236ae05a99e34ed7e8e634b67acb0ac535b5
MATLAB
2,686
90
function get_SSDs_RTs(conditions) %GET_SSDS_RTS Stop Signal Delay and Reaction Time values for each patient % % Input parameters: % CONDITIONS Nx2 cell array of task conditions to compare % -first column corresponds to recording time, second column to % DBS stimulation condi...
5f7e71844b6679a97dab7565d8606ebbc092c47054038d4ec90f1fbb465d1960
MATLAB
2,687
80
function [R,eff] = randmio_dir_signed(W, ITER) % RANDMIO_DIR_SIGNED Random directed graph with preserved signed % in/out degree distribution % % R = randmio_dir(W, ITER); % [R,eff] = randmio_dir(W, ITER); % % This function randomizes a directed weighted network with positive...
f229f3ebf949871da963f542ce9c8c2398315ff26ba6cf5826ba720c77054be2
MATLAB
2,687
116
function [a, b] = isintent(this,intent) % Correspondence between fieldnames and NIfTI intent codes % FORMAT ind = isintent(this,intent) % this - GIfTI object % intent - fieldnames % a - indices of found intent(s) % b - indices of dataarrays of found intent(s) %_______________________________________...
c3e27bdafd958c53a021b163839f989cedc513c71e5d48ac0025f2032c51487c
MATLAB
2,688
88
function [sY, mI, mIG, H] = nk_MultiCentIntensNorm(Y, V, G, B, mI, mIG, flags) % This function performs variable normalization for multi-center studies % Inputs: % Y = data matrix for offset correction % V = overlap search variable % G = Group index vector % B = binwidth for histogram analysis of V if ~exist('flags','...
c7fc258f85e8de96d9cf9e3bd1285cf1fe8edf57568a8f1b15f5f93a9895bac0
MATLAB
2,688
81
function [A,Y,numIter,tElapsed,finalResidual]=seminmfrule(X,k,option) % SemiNMF based on update rules: X=AY, s.t. Y>0; % X, dataset, matrix, each column is a sample, each row is a feature, each column of X is a sample % k, number of clusters % option: struct: % option.iter, max number of interations % option.dis, boole...
009ada627b001a9c76a860c178e8a7be364c0c4ed4e373137325395cfe0ea17d
MATLAB
2,689
80
% SB1_RVM Kernel specialisation of sparse Bayes model (RVM) % % [WEIGHTS, USED, BIAS, ML, ALPHA, BETA, GAMMA] = ... % SB1_RVM(X,T,ALPHA,BETA,KERNEL,LEN,USEBIAS,MAXITS,MONITS) % % OUTPUT ARGUMENTS: % % WEIGHTS Parameter values of estimated model (sparse) % USED Index vector of "relevant" kernels ...
e3aa24d162ebb249983f84e083bc61441bb52342624243526e3509565a4550cb
MATLAB
2,691
89
function [varargout] = MIToolbox(functionName, varargin) %function [varargout] = MIToolbox(functionName, varargin) % %Provides access to the functions in MIToolboxMex % %Expects column vectors, will not work with row vectors % %Function list %"joint" = joint variable of the matrix %"entropy" or "h" = H(X) %"Conditional...
6fe421a6c42f7de4c5dfde955adb14358ede2f94efd9cd6f3204eead0b5d0ae6
MATLAB
2,692
82
function [epoch_p f] = load_TFblocks(curr_resdir,act_chan,powphas,tf_dir,blocknr); %LOAD_TFBLOCKS Loads wavelet coefficients of epoched channel data % [epoch_p f] = LOAD_TFBLOCKS(curr_resdir,act_chan,powphas,tf_dir,blocknr) % Loads time-frequency matrices of complex wavelet coefficients derived from % ...
3ce83713602bd39a5ddbb23135bd67554d83a69179b5701f503b204f3f192bee
MATLAB
2,693
79
function [data, labels, covars] = nk_SynthPCAGauss(realData, realLabels, realCovars, IN) if ~exist("IN","var") || isempty(IN) numSyntheticObservations = 100; else numSyntheticObservations = IN.numSyntheticObservations ; end fprintf('\nGenerating synthetic data using Gaussian random interpolation.'); fprintf('...
79a7171ff994cc54b930ef2fb37aefe080c52611dee05072fe13f5a3a465d402
MATLAB
2,696
75
function daplot(x,group,center,covar,classic,method) %DAPLOT plots 97.5% tolerances ellipses of the bivariate data set x, which % consists of several groups defined by the input argument 'group'. % Center and covar are estimates of the center and covariance matrix of each group, % obtained with a classical ('CDA') o...
571db8d65bfde8b934a5f649e0dc9404274be464ac05de8bda31165a65856db9
MATLAB
2,700
76
function E=efficiency_bin(A,local) %EFFICIENCY_BIN Global efficiency, local efficiency. % % Eglob = efficiency_bin(A); % Eloc = efficiency_bin(A,1); % % The global efficiency is the average of inverse shortest path length, % and is inversely related to the characteristic path length. % % The local efficie...
c433b027aa4f8e0e664476b6a19dc5ef315f9a4087b3ecd3a41ac9f0e03882b9
MATLAB
2,703
70
function SVR_NFolds_Sort_Permutation(Subjects_Data_Path, Subjects_Scores, Times, FoldQuantity, C_Range, ResultantFolder) % % Doing permutation test to create the distribution of random model. % Because permutation is pretty slow, here we parallized the jobs using % PSOM (http://psom.simexp-lab.org/). % % Subjects_Data...
18aca9639973a71cb31c6381f18b570a3b3203925e11ae504675e6dd5a7832e4
MATLAB
2,704
102
function [polim sign p_vals mrl Z ftm] = PC_polar(allsp_ph,binnr,stat,isfig,varargin) %PC_POLAR Distribution of phases associated with unit spikes % [polim sign p_vals mrl Z ftm] = PC_POLAR(allsp_ph,binnr,stat,isfig,...) % draws a polar histogram of phase values in ALLSP_PH. The histogram is % divided to BI...
40ec0c9928afb33a10acb14ae3047b05ed167cdc3ea6cee048a05d506438eebe
MATLAB
2,704
84
function gui_cg() % % This function is needed by FASTICAG % This file just removes the global variables % that are used in FASTICAG from the memory % @(#)$Id: gui_cg.m,v 1.2 2003/04/05 14:23:57 jarmo Exp $ clear global c_FastICA_appr_strD; clear global c_FastICA_appr_strV; clear global c_FastICA_dMod_strD; clear glo...
d165c4d62a9f9aebff687ba1e1be6f481ae185490f7346d71916c6846129fd09
MATLAB
2,705
81
function [D, ni] = find_nn(X, k) %FIND_NN Finds k nearest neigbors for all datapoints in the dataset % % [D, ni] = find_nn(X, k) % % Finds the k nearest neighbors for all datapoints in the dataset X. % In X, rows correspond to the observations and columns to the % dimensions. The value of k is the number of neighbors t...
0fb16eb011f694061e74f869eefda06bab2328a9c81db92ce211a5b0ee1c9197
MATLAB
2,706
120
%% %nested cross validation for testing the logistic rMTFL model %The stratified cv are integrated into method to handle %"not_enough_data_sample" problems and privide more accurate estimator %Han Cao %24.02.2017 %% clear; clc; close; addpath('../MALSAR/functions/rMTFL/'); % load function addpath('../MALSAR/utils/')...
544bdb535275d2c160b08ab908d2cf9cd4c9fb3a0561ed6151115b7a8fb0d98f
MATLAB
2,713
112
function [Y] = LaplacianScore(X, W) % Usage: % [Y] = LaplacianScore(X, W) % % X: Rows of vectors of data points % W: The affinity matrix. % Y: Vector of (1-Laplacian) Score for each feature. % % Examples: % % fea = rand(50,70); % options = []; % options.Metric = 'Cosine'; % options.NeighborMo...
c6e5f3e209b6086ce82411ea79ee0c741ffd8a2a005e8616262f0e4b3b9aba52
MATLAB
2,715
105
% compute mean of videos on a subset of frames % only use videos that are in multivideo SVD or ROI1-3 function h = subsampledMean(h) nviews = numel(h.nX); nvids = size(h.vr,2); nframes = zeros(nvids,1,'single'); for j = 1:nvids nframes(j) = h.vr{1,j}.Duration * h.vr{1,j}.FrameRate; end nframes = floor(nframes); ...
95d85fb706578823c78649c361938ebd158f7305e9078fdd2150d237b57e7a88
MATLAB
2,723
74
function [A,Y,numIter,tElapsed,finalResidual]=kernelnmfdecom(X,k,option) % Kernel semi-NMF based on decomposing kernel matrix: XtX=AY, s.t. Y>0. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=kernelnmfdecom(X,k) % [A,Y,numIter,tElapsed,finalResidual]=kernelnmfdecom(X,k,option) % X: matrix of mixed signs,...
e26f49432bdf4081e53ab07a6096ab1c70539d7794183466b1868fa592de4984
MATLAB
2,724
77
function [Y, label, I, NanStats] = nk_ManageNanCases(Y, label, I, act) % ========================================================================= % FORMAT [Y, label, I] = nk_ManageNanCases(Y, label, I) % ========================================================================= % Removes cases that consist only of NaN ...
e995776cde89e6cb396460da3ac148bd7ec0be59971210eda6d7c3b0ef6a6513
MATLAB
2,725
129
classdef dummy < bt.model.template properties means std end methods function self = dummy() % Constructor self.name = 'dummy'; self.electrodes = {'Electrode'}; self.n_params = 4; self.param_names = {'Unimodal','Unimodal','Exponential','Bimodal'}; self.param_symbols = {'Unimodal','Unimod...
fff86a05ab13a595a8931880510a3b920c86db3386971c72371887f08b9e5252
MATLAB
2,725
70
function nk_MLOptimizer_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 % ===================================...
91edb54c0765e836409ddaa9dac1b52e59d5f212ede5e8230cbfc9097d5a6f26
MATLAB
2,729
100
function [V, indvol, vox] = nk_WriteVol(Vdat, fname, dim, spacimg, badcoords, label, labelop, indvol, roundfl, verbose) % ================================================================================================== % FORMAT nk_WriteVol(Vdat, fname, dim, spacimg, badcoords, label, labelop, indvol, roundfl, verbose...
aac3997cee82946d7952b02b69615798d0b50b43d1cbfac196d0ac7d9c6ce03f
MATLAB
2,732
95
function palm_hemimerge(varargin) % Merge data for lh and rh (left and right hemispheres) into a % single file. Various input files can be given, starting with % 'lh' and/or 'rh'. The script finds the correct pair, removes % repeated files, and merges them into files beginning with 'bh'. % % palm_hemimerge <files> % % ...
32948f2f24085400403b4e8fd6578007296c2ec0b4977e2fa2161f71c27fbdb3
MATLAB
2,734
88
function msCNMFEVideo(ms, cell_ID, frameLimit, downSamp,is_write,is_plot) %MCNMFEVideo Visualize and/or save video of traces % INPUTS: % ms: ms structure % cell_ID: cell to plot identify (will appear white instead of magenta) % frameLimit: vector indicating the first and last frames (eg [10 205]). % If left e...
5a3e419160cf533bbaf9875345066c8e56199698a38de691197b6b7eeb0a0d3c
MATLAB
2,734
74
function [featmat,emptfl] = nk_GenCVresultsMaster(datid, mastermat, tdir, basename, savefl) global SAV if exist('savefl','var') && savefl, saveflx = true; else saveflx = false; end if ~exist('tdir','var') || isempty(tdir) || ~exist(tdir,'dir'), tdir = pwd; end emptfl = false; if (~exist('mastermat','var') || ~exist(m...
1659655c637a07595831a67cebbe772de6910a075d0e470a8f743889119ded9f
MATLAB
2,735
85
function [f, ax] = CARE_barMLI(casenum, MLIcont, feats, refdata, origdata) % casenum = index of subject of interest in oocv dataset (if I understood % it correctly this will always only include one subject (?)) % MLIcont = the results of the MLInterpreter % feats = feature names % refdata = trainings dataset % origdata...
865aad30bc71ad497ee8dca78f96a57689cd7bc8aec0c635a14aa7d11d49c99f
MATLAB
2,737
90
function h = nifti(varargin) % Create a NIFTI-1 object %__________________________________________________________________________ % Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging % % $Id: nifti.m 7147 2017-08-03 14:07:01Z spm $ switch nargin case 0 hdr = empty_hdr; h = struct('hdr',hdr,'da...
9288f6911b248f9cb24fd8cff6d53b1e381a3c86e511a7006edf5343a7385d65
MATLAB
2,741
90
classdef spatial_emg_xyz < 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 function...
ad65d950671cce52045dd66b5d1f799f7095cdeb7c5fc3d838ca7209f4d54286
MATLAB
2,744
77
function pvals = palm_datapval(G,Gvals,rev) % 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, or using a custom cdf. % % Usage: % pvals = palm_datapval(G,Gvals,rev) % % Inputs: % G ...
e2dae0c4c7eabe0af64562932aeb7a92bd201b8712b302cd057ec097042ef11c
MATLAB
2,744
99
function [verts,faces,rois,data] = checkVertsFacesRoisData(varargin) ip = inputParser; validationFcn = @(x) (isnumeric(x) && ismatrix(x)); addOptional(ip, 'verts', [], @(x) validationFcn(x)); addOptional(ip, 'faces', [], @(x) validationFcn(x)); addOptional(ip, 'rois', [], @(x) validationFcn(x)); addOptional(ip, 'dat...
5ef4e9c2f75af0b6f70662d61a77b8094a60ada60f94420ec5c6199987795a1e
MATLAB
2,745
102
% plot full face frame and selected ROI function PlotROI(h) nROIs = numel(h.plotROIs); kc = h.whichfile; k = h.whichview; tstr = {'running','ROI1','ROI2','ROI3','pupil 1','pupil 2','blink1','blink2'}; % smoothing constants sc = h.sc; if ~isempty(h.indROI) indROI = h.indROI; axes(h.axes4); frames = ...
2386882f4912a5e22b65024b820c24ddf3bf57657c62bd4687c6a4d87db67532
MATLAB
2,748
80
function [P_pos, P_neg, mindist_pos, mindist_neg, marginList, dists] = gflipHelper(X, Y, dists, changed_feat, added, cpus, labelsSet) % [P_pos, P_neg, mindist_pos, mindist_neg, marginList, dists] = gflipHelper(X, X_square, Y, alphas, inds, dists, add_feat, rem_feat); % % This function finds the nearhit and nearmiss f...
7b91a9a5413edb2e53975ea7a3a69bcd545caa9079d912438bccbcafcb472780
MATLAB
2,755
92
function RecalculateProjection(self) % Recalculate Projection (self) % Projection plan 0 % % Modified from Jadin Jackson's original code. % Simplest projection path 1 MCD = MClust.GetData(); nFeatures = length(self.Features); iPath = self.projectionPath.GetI(); %fprintf('Recalculating using projection path %d\n', i...
e94e6784f398c0dfcdc619e52b50a0d0bfbe9f386862f9406c07224eca28ffb7
MATLAB
2,756
91
function result = removeObsMcd(data,i,inputH0,inputFull,csteps); %REMOVEOBSMCD is an auxiliary function to perform cross-validation with MCD % (see cvMcd.m). % % The input: % data : the original data % i : the index of the observation that has to be removed. % inputH0 : a structure that contains the f...
2b7ce1e71a457c632eb90b8db7701044d59b8125344a09346bb31504854232a4
MATLAB
2,757
84
function [Y,numIter,tElapsed]=kurnnls(XtX,AtA,AtX,option) % Kernel UR-NNLS: phi(X)=A_phi Y, s.t. Y>0 % XtX, kernel matrix, k(X,X). % AtA, kernel matrix, k(A,A). % AtX, kernel matrix, k(A,X). % option.iter, max number of interations % option.kernel, string, kernel function % option.param, scalar or column vector, the pa...
9e1a3080db73dffc86d4f4a1af18bd25991f25ddb05a84f798de501b03b68a1c
MATLAB
2,757
98
function [infY, alpha, sig, infYPerm,symY, binY] = nk_FilterInfo(Y, labels, SymFlag, InfoType, nperms, alphacut) % % function [infY, alpha, sig, infYPerm, symY, binY] = nk_FilterInfo(Y, labels, SymFlag, InfoType, nperms) % % Inputs: % ------- % Y: Data (rows = observations, columns = features) % labels: ...
ccb5f5238352552b709c5cca003e5893583350e5e17ce4ba30a6e1c117339d04
MATLAB
2,762
101
function [res] = runsvm(Ks,lk) % Copyright 2012 Nino Shervashidze, Karsten Borgwardt % runsvm(Ks,lk) % K = 1 x h cell array of kernelmatrices (n*n) % lk = vector of class labels (n*1) % cv = number of folds in cross-validation % independent scheme % best c addpath('~/code/libsvm'); n=length(lk) % size of the dataset ...
6767384c93e388c61c1df06ab535a94d973ac4822a6cffb43505252de6b42a5e
MATLAB
2,776
89
% General point of this code is to reorganize the tables for graphing in % prism; final output from a chunk is a cell array called "format_final" % which contains cell arrays for the responses of the odors (rows are % ordered best to worst). %% prism re-org; stand-alone behavior table, average by trialN clear ...
7ec60285d3526060f9f0564848626472c224c19e45c5d545b2c4f3327e6ed89e
MATLAB
2,776
81
% ========================================================================= % FORMAT permmat = nk_PermInd(nPerms,Labels,Constraint) % ========================================================================= % % Generate 'nPerms' within-group permutations of class membership indices % 'Labels' and guarantee that repli...
8a85f7fb1f311fdc0a861369c2a68e7a72f3ddf6a966a9acf865915aa7cbd52d
MATLAB
2,780
97
function topoplot_fig(alldata,chanlocs,sr,plot_win,topobin,cLim,topodir,maskdata,suptit,savetit) %TOPOPLOT_FIG Plot scalp maps % TOPOPLOT_FIG(alldata,chanlocs,sr,plot_win,topobin,cLim,topodir,maskdata,suptit,savetit) % draws a series of scalp maps (topoplot.m by Delorme A & Makeig S (2004)), % splitting PLO...
5aed51b43a8aa9a3d86d5d96d660807522b9b8a3eacaffcd046a71e52e172d6c
MATLAB
2,782
86
function [buttoncode, ARD_time, MTL_time] = ser_read(serial, duration, Start, win, flipInx) %SER_READ Keypress detection with FGETL_NONBLOCKING % Detecting buttonpress timestamps % Returning pressed button code, ARD timestamps, MTL serial read time global cue global RectSize global backup_buff buttoncode = []...
118933d0f727eb9b1fff8e12c3da0d2c982f8165dca5b29188b7ebc9b20636ed
MATLAB
2,791
91
function [Rlatt,Rrp,ind_rp,eff] = latmio_dir(R,ITER,D) %LATMIO_DIR Lattice with preserved in/out degree distribution % % [Rlatt,Rrp,ind_rp,eff] = latmio_dir(R,ITER,D); % % This function "latticizes" a directed network, while preserving the in- % and out-degree distributions. In weighted networks, the function...
822cda8ab0714523b09f0966a6db89360660c9c44b0f7f59f3408b8eb25bcc88
MATLAB
2,791
83
function [P_pos, P_neg, mindist_pos, mindist_neg, marginList, dists] = nk_simbaHelper(X, X_square, Y, alphas, inds, labelsSet) % [P_pos, P_neg, mindist_pos, mindist_neg, marginList, dists] = simbaHelper(X, X_square, Y, alphas, inds); % % This function finds the nearhit and nearmiss for the instances in X(inds,:) wit...
70398640db8414ec3904f0650d6f348bc594d9f767f1f505a761810239b559f7
MATLAB
2,796
103
function P = Permutationmatrix4 % graphlet kernel % @author Karsten Borgwardt % @date May 11th 2007 % calculate results for pairs of graphs % %for i = 1:size(graph,2) %% %i %% am1 = graph(i).am; %% sp1 = floydwarshall(am1); %% sp1(find(sp1 == Inf)) = 0; %% graph(i).sp = sp1; % %m = size(graph(i).am,1) %am = graph...
75264897b142201998050bbc39b4d1e311f52214b7742b0424d615aaa3ffb01b
MATLAB
2,800
72
function [sY, IN] = nk_PerfImputeLabelObj(Y, IN) % ========================================================================= % FORMAT function [sY, IN] = nk_PerfImputeLabelObj(Y, IN) % ========================================================================= % Performes imputation using either single-subject median rep...
5b41e05fa5219aff5b3445a45694ab6a720d88b4a391e710edaec4d741904b01
MATLAB
2,801
95
function C = decompose_signal(y, method, params, Fs) %DECOMPOSE_SIGNAL Wrapper for 1D decomposition methods. % C = decompose_signal(y, method, params, Fs) % % Inputs: % y : 1 x T or T x 1 noisy signal % method : 'VMD' | 'SSA' | 'DWT' | 'CEEMDAN' % params : struct with method-specific fields % Fs : s...
2bc627a8dbea7de16d6a5375dcd886092f3598178fc52dcdc616d9b9262907d5
MATLAB
2,809
121
%% %nested cross validation for testing the logistic dirty model %The stratified cv are integrated into method to handle %"not_enough_data_sample" problems and privide more accurate estimator %Han Cao %24.02.2017 %% clear; clc; close; addpath('../MALSAR/functions/dirty/'); % load function addpath('../MALSAR/c_files/...