sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
7abff2da6936beb935d64a50e3776e68da1d92c8e0b3a34381739f952b5cc557
MATLAB
2,824
98
function msPlotAnalysisSummary(ms,behav) %MSPLOTANALYSISSUMMARY Plot summar of your results % This is a quick function to get an overview of your results % Copyright (C) 2017-2018 by Guillaume Etter % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Publi...
b2ef71d72935987038b90af1ea820bfc8fb13e81b8afcfe3989540852e1bb201
MATLAB
2,829
75
function perftab = cv_extract_performanceMetrics_fromNMstruct(NMstruct, varargin) if nargin>1 analyses_status = nk_GetAnalysisStatus(NMstruct); analyses_ind = find(analyses_status.completed_analyses); if sum(analyses_ind) == 0 warning('no analyses completed'); exit; end oocv_fl...
d08ff3d0671d7c405689a7094e26ef99b8a381e68aa66d14e4fe07355fdeb744
MATLAB
2,834
82
function [Y,numIter,tElapsed]=orthnmfruletest(X,outTrain) % map the test/unknown samples into the orth-NMF feature space % X: matrix, test/unknown set, each column is a sample, each row is a feature. % outTrain: struct, related options in the training step. % outTrain.factors: column vector of cell of length 2, contain...
f1c33655c950532881dce8266c19877f63056888979d3da8ee02407e06ace94e
MATLAB
2,834
115
function nk_AdjustData spm5ver = 0; if strcmp(spm('ver'),'SPM5') || strcmp(spm('ver'),'SPM8') , spm5ver = 1; end if spm5ver brainmask = spm_select(1,'image','select brainmask'); else brainmask = spm_get(1,'IMAGE','select brainmask'); end Vm = spm_vol(brainmask); if spm5ver P = spm_select(Inf,'image','S...
9da5fd172c67077c994cd9f26d390eca5d06caf853f067d8d96e9dcea9c17e35
MATLAB
2,835
82
function [ param, act ] = nk_ROBSVM_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(...
dfb725e7e6cf02ba943e0f14582cf026472ecb97cea67317dc74b87f9b4226ed
MATLAB
2,836
112
function [ W, info ] = MTFLCd_Subg( X, y, lambda1, lambda2, opts ) % % Multi-Task Feature Learning with Calibration % Subgradient descent. % % OBJECTIVE % min_W { sum_i^m ||Xi wi - yi|| + lambda1 ||W||_{1,2} + lambda2/2 ||W||_F^2 } % % % INPUT % X - cell array of {n_i by d matrices} by m % y - cell array of {n_i b...
acfd5b445348d2a277c5fac9897e287b80db038b24392b8106bbb1d853e03787
MATLAB
2,837
90
function make_motif34lib %MAKE_MOTIF34LIB Auxiliary motif library function % % make_motif34lib; % % This function generates the motif34lib.mat library required for all % other motif computations. % % % Mika Rubinov, UNSW, 2007-2010 %#ok<*ASGLU> [M3,M3n,ID3,N3]=motif3generate; [M4,M4n,ID4,N4]=motif4gen...
95063d7ecd3b31b2cf30635af2907241f6bea10b3afa55ce0a8585563adbe535
MATLAB
2,842
82
function [newVectors, whiteningMatrix, dewhiteningMatrix] = whitenv ... (vectors, E, D, s_verbose); %WHITENV - Whitenv vectors. % % [newVectors, whiteningMatrix, dewhiteningMatrix] = ... % whitenv(vectors, E, D, verbose); % % Whitens the data (row vectors) and reduces dimension. Return...
3d051ad317da3d31fc24bbc27f03d2c7e699d8527b3cce1bf01583f5d02c402b
MATLAB
2,844
65
function cParams = nk_PrepMLParams(Params, Params_desc, i) global SVM GRD CMDSTR % Pull parameters according to the algorithm selected switch SVM.prog case 'matLRN' cParams.val = Params(i,:); cParams.desc = Params_desc; case 'GLMNET' % Use only the first 5 params cParams.val = ...
ef4af6457d4465ec41b0ebcaf2988ff33562c3c838ca34b6651e30875e5094dc
MATLAB
2,849
88
function varargout = avg_psth_plot(psth_R1,psth_R2, alignevent, colors,varargin) %AVG_PSTH_PLOT Average peri-event time histogram % AVG_PSTH_PLOT(psth_R1,psth_R2, alignevent, colors,...) draws averaged % PSTHs with standard error for data in PSTH_R1 and PSTH_R2. % % Required inputs: % PSTH_R1, PSTH_...
067bba8b8e753924462471fe625a16215cca6d04627a218fc8996043b5998477
MATLAB
2,851
109
% SB1_EXAMPLEREGRESS Example of Sparse Bayes Regression % % SB1_EXAMPLEREGRESS(N,NOISE,KERNEL,WIDTH,MAXITS) % % INPUT ARGUMENTS: % % N Number of training points % NOISE Noise standard deviation to be added % KERNEL Kernel function to use (see SB1_KERNELFUNCTION) % WIDTH Kernel lengt...
10efa0ff1cb4cbd9d38e290008842c90be6af85cb0063131b796c16457d1ced1
MATLAB
2,853
76
function BC=betweenness_wei(G) %BETWEENNESS_WEI Node betweenness centrality % % BC = betweenness_wei(L); % % Node betweenness centrality is the fraction of all shortest paths in % the network that contain a given node. Nodes with high values of % betweenness centrality participate in a large number of shor...
0c9c4adcce4699ef21af792752627f252dc96c53efe9a6f8249d8cfa64b977e1
MATLAB
2,856
79
function [CUSTOMPREPROC, PX, act ] = cv_customPreproc_config(CUSTOMPREPROC, PX, parentstr, defaultsfl) funcFile = ''; funcParams = []; if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if isfield(CUSTOMPREPROC,'filename') && ~isempty(CUSTOMPREPROC.filename) ...
0e24fbb863c9914326c6e0dc88821ed70040274c1081fc8fc26b50ec22f40fcc
MATLAB
2,858
97
function component_PC_RT_correlation % COMPONENT_PC_RT_CORRELATION Finds clusters using spike-phase-coupling strength (MRL) and reaction time value pairs. % COMPONENT_PC_RT_CORRELATION fits mix. model of Gaussian distributions % on delta spike-phase-coupling strength (MRL) and reaction time value % pairs and ...
f4ee7ff98103fd8b3099468c88a401d60d5fab3d60e8a0470512d2a4d1282767
MATLAB
2,860
122
function [result,mean_accuracy,std_accuracy] = runIndependent(K,lk) % Copyright 2012 Nino Shervashidze, Karsten Borgwardt % K = kernel matrix (n*n) % lk = vector of labels (n*1) % cv = number of folds in cross-validation % standard deviation % independent scheme % best c addpath('~/code/libsvm'); % randomly permute k...
2728dcca38957f8652bccda03ba28fd7f737d9e877123be7de4f20535747703c
MATLAB
2,862
96
function result=mahalanobis(x,locvct,varargin) %MAHALANOBIS computes the (squared) distance of each observation in x % from the location estimate (locvct) of the data, % relative to the shape of the data. % % Required input arguments: % x : data matrix (n observations in rows, p variables in co...
a04c015bcdbb8c879626b4a99e4c477b4595640d9202f539073801afa27da034
MATLAB
2,864
94
function [act, GridAct] = nk_CVGridSelector(ix, jx, GridAct, proceedfl) if ~exist('GridAct','var') || isempty(GridAct) GridAct = false(ix,jx); end if ~exist('proceedfl','var') || isempty(proceedfl) proceedfl = true; end print_grid(ix, jx, GridAct) menustr = ['Select all CV2 positions|' ... 'Select single singl...
5eb14a4584ea1a763a7ad97e847dab17404b0605e88b16f704ca439ba029a4fc
MATLAB
2,866
69
function Thresh = nk_DataIO3_SpaceDefImage_config(Vm, Lm, datatype) if ~exist('datatype','var') || isempty(datatype), datatype = 'nifti'; end switch datatype case {'nifti','spm'} % Read-in space-defining image and check number of unique values if ~exist(Vm.fname,'file') if isempty(file...
2a8d775a58f09b6fe467e8c947db21759a486c07a8c51862a3212f9745279cd1
MATLAB
2,871
80
clear; clc; %% Load File %% data=readtable('...\Monkey_Behavioral_Data\Monkeys_Behavioral_Data_Analysis2',VariableNamingRule='preserve'); %% allSess=unique([data.Session]); colorSolo=[10 10 92]/255; colorJa=[.9 .1 .1]; faceAlpha=0.7; RT1_Solo=NaN(12,1); RT1_Ja=NaN(12,1); RT2_Solo=NaN(12,1); RT2_Ja=NaN(...
772bcde095f7010a461b1867932409f7bed1789721831a1138c21932f061d08c
MATLAB
2,871
80
clear; clc; %% Load File %% data=readtable('...\Monkey_Behavioral_Data\Monkeys_Behavioral_Data_Analysis2',VariableNamingRule='preserve'); %% allSess=unique([data.Session]); colorSolo=[10 10 92]/255; colorJa=[.9 .1 .1]; faceAlpha=0.7; MT1_Solo=NaN(12,1); MT1_Ja=NaN(12,1); MT2_Solo=NaN(12,1); MT2_Ja=NaN(...
1f6bd66501dcc7f16d984af0937de205cadcf83d69f8cfa11b40f28c15bba4a5
MATLAB
2,873
96
function [Ain,Cin,bin,fin] = sparse_NMF_initialization(Y,K,options) %beta,eta,X0,err_thr,max_iter) T = size(Y,ndims(Y)); if ~ismatrix(Y) Y = reshape(Y,numel(Y)/T,T); end defoptions = CNMFSetParms; if nargin < 3 || isempty(options); options = defoptions; end if ~isfield(options,'snmf_max_iter'); options.snmf_max_i...
39b7b509d0c4e36a118eff83d26942ee10ed228ddd83477d89323cb1fd661702
MATLAB
2,876
90
function [varargout] = WeightedMIToolbox(functionName, weightVector, varargin) %function [varargout] = WeightedMIToolbox(functionName, weightVector, varargin) % %Provides access to the functions in WeightedMIToolboxMex % %Expects column vectors, will not work with row vectors % %Function list %"entropy" or "h" = H(X) %...
e01131de93f4ddbaaa70cf8c6e56c9d3964099b2a4debb38a54831f8f8967412
MATLAB
2,880
104
function [M,IND] = combn(V,N) % COMBN - all combinations of elements % M = COMBN(V,N) returns all combinations of N elements of the elements in % vector V. M has the size (length(V).^N)-by-N. % % [M,I] = COMBN(V,N) also returns the index matrix I so that M = V(I). % % V can be an array of numbers, cells or strings. % %...
877d70e561553da261aada38fbe4487881238a5fc88e6c0b69e03bed7acfd3d6
MATLAB
2,882
73
function [tscounts, wfcounts, evcounts, contcounts] = plx_info(filename, fullread) % plx_info(filename, fullread) -- read and display .plx or .pl2 file info % % [tscounts, wfcounts, evcounts, contcounts] = plx_info(filename, fullread) % % INPUT: % filename - if empty string, will use File Open dialog % fullread - ...
10c3dd654eb9d8933de50438f6c628d6942edad160a51979909b348317e4b708
MATLAB
2,885
98
function [P, Perf, Sim] = nk_MultiDecideDAG(H, Y, Classes, ngroups) % function [P, Perf, d, crit] = nk_MultiDecideOneVsOne(H, Y, Classes, % maxfunc, weightflag) % % Perform One-Vs-One multi-group classification % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (c) Nikolaos Koutsouleris, 01/2...
3def2492ea9b9dfc2fd0ba54fc8d93c6888d648bddb953bfcd9e46afb09e8a71
MATLAB
2,885
86
function test_symm_clustering() % % demonstration file for NMFLibrary. % % This file illustrates how to use this library. % This demonstrates Symm-ANLS algorithm and Symm-Newton algorithm. % % This file is part of NMFLibrary. % % Created by H.Kasai on Jun. 26, 2019 clc; clear; close all; %% generate ...
ed0adc923e432cf236c92c425565d84f3bba6b46b6b00498a6e9e75692429758
MATLAB
2,887
114
function check_resp_pvalues(EventTypes) % CHECK_RESP_PVALUES Q-Q plot of observed and expected p values obtained by testing unit responsiveness. % check_resp_pvalues(EventTypes) gets p values resulting from testing % unit responsiveness to events included in cell array of EVENTTYPES, % plots observed and expe...
d6ab37c058dbf8e1abdf54aab625ca33c7cdaef6f80c737f08623949b5b0f110
MATLAB
2,889
104
%%% Analysis of correlation ICD vs activity %%% clear; clc; load('...\LFPdata_Fig5D_S1.mat') X_name='ICDmean'; Y_name='RMSja'; condPD=3; colore=[.7 0 0]; % Red dir=NaN(2,2,79); posLayout=[1,3,4]; for dset=1 iter=0; figure() set(gcf,'position',[0 0 825 935]) mkToEval=1:2; f...
2d83c4ecb30b93b50c61f8b286b8e3e03fb8f23ade11c8a7e894b29747c9587d
MATLAB
2,896
94
function [FeatureTimestamps, Features] = CalculateFeatures(featuresToCalc) % [FeatureTimeStamps,Features] = CalculateFeatures(featuresToCalc) % % input string list of featurenames % % output % FeatureTimeStamps = timestamps % Features = set of features MCS = MClust.GetSettings(); MCD = MClust.GetData(); nFeat = ...
ceb000f792539bf912d6475ad2eda6a52919da5f52b72d6966c44765901dc62c
MATLAB
2,896
90
classdef ZeroCluster < MClust.ClusterTypes.DisplayableCluster % returns all spikes properties(SetObservable) ShowUnaccountedForOnly = false; end methods(Static, Access=public) function bool = Modifiable() bool=false; end end methods % --...
de9d23a441432c3df97cad1da4d0a44672e890bb7be2364625454ee1a873ae03
MATLAB
2,900
99
function [CompleteVideo,concatInfo] = ConcatVideos(path,concatInfo,dsFOVflag) % INPUT: % Path: String with the path for the videos to be concatenated. The videos % should be already motion corrected and named in the right order (e.g.: % "msvideo1.avi", "msvideo2.avi", etc). The Alignment file should also be % placed ...
75c5d57d7a6fa665f37c5e54d9d0b5c64da7a8acbff62269b91ed79366130969
MATLAB
2,905
123
% SB1_KERNELFUNCTION Compute kernel functions for the RVM model % % K = SB1_KERNELFUNCTION(X1,X2,KERNEL,LENGTH) % % OUTPUT ARGUMENTS: % % K N1 x N2 kernel matrix. % % INPUT ARGUMENTS: % % X1 N1 x d data matrix % X2 N2 x d data matrix % KERNEL Kernel type: currently one...
71f9b303dec0e5b7c43bc41b9b7fb0bdf8693935e59b9b35e38f5f9fc18510ed
MATLAB
2,907
59
function [curr_dat_sz, curr_lab_sz] = store2hdf5(filename, data, labels, create, startloc, chunksz) % *data* is W*H*C*N matrix of images should be normalized (e.g. to lie between 0 and 1) beforehand % *label* is D*N matrix of labels (D labels per sample) % *create* [0/1] specifies whether to create file newly ...
01ffa3e08e16ae075185bdbc0b85a5fe8ee3fe83d4ffcfffe93a6aa88bb88270
MATLAB
2,910
89
%% file example_Robust.m % this file shows the usage of Least_RMTL.m function % and study how to detect outlier tasks. % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * \|L\|_* + rho2 * \|S\|_{1, 2}} % where W = L + S % \|S\|_{1, 2} = sum( sum(S.^2) .^ 0.5 ) % ...
1a9b6daae14816c015d148b8ad7a30d83ddbd5c2d94242c30a27b27401cbf04b
MATLAB
2,910
78
classdef spatial_express_t0 < 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 funct...
1df2ac10d8f831a9c6602761692a1fee90568c1b06238e44218e115af4dd6b8d
MATLAB
2,911
77
%% ================================================================ % Script: age_effects_neonatal_FOCA_GAM.m % Purpose: % Model age-related trajectories of internetwork covariance (FOCA matrix) % during the early postnatal period using mass univariate GAMs. % % Description: % - Input: precomputed F-statis...
4072a23151118b15ed262b7c037d24ec032e1905afd8f2ed45ad6f725e1732ae
MATLAB
2,914
71
function [D,B]=distance_wei(L) % DISTANCE_WEI Distance matrix (Dijkstra's algorithm) % % D = distance_wei(L); % [D,B] = distance_wei(L); % % The distance matrix contains lengths of shortest paths between all % pairs of nodes. An entry (u,v) represents the length of shortest path % from node u to node v...
0df6a3bd8733b6d78693828fd4c7f2da2ef5064c73c5183a56e5e6c08f0fca2d
MATLAB
2,930
94
function result = daisy(x,vtype,metric) %DAISY returns a row vector containing all the pairwise dissimilarities % (distances) between observations in the dataset. The original % variables may be of mixed types. % % The calculation of dissimilarities is explained in: % Kaufman, L. and Rousseeuw, P.J. (1990), % "Fin...
26daac66c2bbd5f30877915e01dd1790a2a2cd43d80962481ce13e6ea6bdeead
MATLAB
2,930
78
classdef Blob < handle % Wrapper class of caffe::Blob in matlab properties (Access = private) hBlob_self end methods function self = Blob(hBlob_blob) CHECK(is_valid_handle(hBlob_blob), 'invalid Blob handle'); % setup self handle self.hBlob_self = hBlob_blob; end fu...
bd0d78d83db6536c866a46eb406a44b8af92348601ad2a244bcd65fd0c22d393
MATLAB
2,933
81
function [handles, visdata, oocvdata, mlidata] = switch_analysis(handles) visdata = []; oocvdata = []; mlidata = []; analind = handles.curranal; handles.curmodal = 1; if strcmp(handles.selModal.Enable,'on'), handles.curmodal = handles.selModal.Value; end if handles.multi_modal && strcmp(handles.selModal.String{handle...
ac68d8df562840c819c53393383b29837dbf073315a0fc9f35a7b0f442496bb6
MATLAB
2,935
90
function ms = msNormCorre(ms,isnonrigid) % Performs fast, rigid registration (option for non-rigid also available). % Relies on NormCorre (Paninski lab). Rigid registration works fine for % large lens (1-2mm) GRIN lenses, while non-rigid might work better for % smaller lenses. Ideally you want to compare both on a smal...
b9ce039fb4a3d51751b05b36d494fd8f95ee91f529c12a1a257b5184a7fde648
MATLAB
2,940
117
function [model] = ml_binaryclass_SSVM(X,y,options) % ml_binaryclass_SSVM(X,y,options) % % Description: % - Fits a smooth support vector machine by minimizing squared hinge loss % % Options: % - addBias: adds a bias variable (default: 0) % - lambdaL2: strength of L2-regularization parameter (default: 0) % - k...
30fe892b997c71e919b877439838c11885bf1146701ca09fb772fe58914b4bcc
MATLAB
2,945
89
function plotBarError(Acc,std,dataSets,classifiers,xDescription,yDescription,saveFigName) % Plot bar with STD %example: % Acc=zeros(3,9); % Acc(1,:)=[0.8987,0.8945,0.8912,0.8863,0.8940,0.8893,0.8571,0.8467,0.8008]; % Acc(2,:)=[0.9708,0.9689,0.9689,0.9616,0.9683,0.9675,0.9604,0.9576,0.9155]; % Acc(3,:)=[0.9225,0.9252,0....
1312c7fd5e7e00d1a48fb9956a8fc65e27cceb7e2cb65dd49fa029f6fc7a74dc
MATLAB
2,951
106
function varargout = ds2nfu(varargin) % DS2NFU Convert data space units into normalized figure units. % % [Xf, Yf] = DS2NFU(X, Y) converts X,Y coordinates from % data space to normalized figure units, using the current axes. This is % useful as input for ANNOTATION. % % POSf = DS2NFU(POS) converts 4-element positi...
5087b1018f0885aa60fa0a215790277e0e3181fc14090193965d4d4dcaec7c41
MATLAB
2,953
101
function newmap = mbm_bluewhitered(ax,m) %BLUEWHITERED Blue, white, and red color map. % BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white % to red colormap, with white corresponding to the CAXIS value closest % to zero. This colormap is most useful for images and surface plots % with ...
b124c23bf5e10e7572b5e94c046631d50a543dfcb927e0fefc6bac005ef05630
MATLAB
2,955
93
function FEAT = nk_PerfCommonFeatExtraction(FEAT, param) global PREPROC [iy, jy] = size(FEAT); n = iy*jy; [d, nclass] = size(FEAT{1,1}.dat{1}.vol); switch param.mode case {1,2,3} Dx = false(d, nclass); param.mode = 1; param.thresh = 75; case 4 Dx = zeros(d, nclass); case 5 ...
5818358db60e221072ab94f09528330f140876e23f8604579a44a8257d75f8b5
MATLAB
2,956
96
clear; clc; load('...\LFPdata_Fig4C') %% figure() set(gcf,'Position',[-1151 411 1145 483]) tiledlayout(1,2) xTickLabels = {'Delta (1-4 Hz)', 'Theta (4-7 Hz)', 'Alpha (8-12 Hz)', 'Beta (13-30 Hz)', 'low-Gamma (31-60 Hz)', 'high-Gamma (61-100 Hz)'}; xTickValues=1:6; for mkID=1:2 switch mkID ca...
4cbbb4f835a618b7164c573fcc2cbf7dd5385c95e087b320aa79ef5fb3e9d5d4
MATLAB
2,991
43
%----------------------------------------------------------------------- % Job saved on 16-Dec-2020 18:48:24 by cfg_util (rev $Rev: 7345 $) % spm SPM - SPM12 (7771) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- matlabbatch{1}.cfg_basicio.file_dir.file_ops.file_...
b2f1b85436d667916728a840899bbc7f2986f4e8469c3ccf031ecb12a1595064
MATLAB
2,992
79
function [C, dC] = backprop_gradient(v, network, X, targets, lambda) %BACKPROP Compute the cost gradient for CG optimization of a neural network % % [C, dC] = backprop_gradient(v, network, X, targets, lambda) % % Compute the value of the cost function, as well as the corresponding % gradient for conjugate-gradient o...
5fa1331ac31876801a50be3657f6472f2103926311b06b49b432244c65a522e0
MATLAB
2,993
65
clc;clear;close all;clear gca %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Analyses\Data"); %d=load('Jupiter_test_data_TOJ_whole_period.mat'); %spikes=d.data.spikes; %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Data\PSTH_1_to_401_jupiter\PST...
0149621e08a0e7cb54012f1f50200f50fb717f38c034203988595d610db7629e
MATLAB
2,995
86
function [metaSample,metaClass]=computeMetaSample(trainSet,trainClass,option) % Compute metasamples for each class using SVD. This function is used by % MSRC. % trainSet: matrix, each column is a training sample % trainClass: numeric column vector, the class labels of the training samples % option: struct, with fields:...
9e43589c9c17e87e06ceab322976e33f58e8a5c97760b981bb17291169942bc6
MATLAB
2,996
57
function [act, param] = nk_PSO_config(param, defaultsfl, parentstr) PSO.N = 10; % Number of particles PSO.max_Iter = 100; % Number of iterations PSO.c1 = 1; % Cognitive factor PSO.c2 = 1; % Social factor PSO.w = 0.5; % Inertia weight PSO.lb ...
49504a301c5361acf28dc9968a879da19c24ac6c1bfb1f199f6482944b21b9d2
MATLAB
3,000
76
classdef spatial_express_gains < 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 fu...
ef2e28f790257edb8ddc32ec73bd5dcf3b8860a36ea61cf6fd1dae77af1d1863
MATLAB
3,003
79
function d = nk_mahalanobis(varargin) %MAHALANOBIS Computes the Mahalanobis distance. % D = MAHALANOBIS(Y, X) computes the Mahalanobis distance between % each vector in Y to the mean (centroid) of the vectors in X, and % outputs the result in vector D, whose length is size(Y, 1). The % vectors in X and Y ...
c93994177074715bf3cfa4a07314c5379284ad9bf068f018ba8a29655ebc32c3
MATLAB
3,004
77
function [ act, params ] = nk_FEAST_config( params, askFeatNum, parentstr ) NumFeat = 10; Method= 4; na_str='?'; if ~exist('askFeatNum','var') || isempty(askFeatNum), askFeatNum = true; end if isfield(params,'FEAST'), if isfield(params.FEAST,'Method'), Method = params.FEAST.Method; end if isfield(params.FE...
25256dad22db0b1cba6bdf241192e9623d0e626a426f195b65dc6aaf17114015
MATLAB
3,009
92
function scores = SKS(X_train, Y_train, extra_param); % scoress = SKS(X_train, Y_train, extra_param); % % Implementation of SKS algorithm, described in % % A. Navot, L. Shpigelman, N. Tishby, E. Vaadia. Nearest Neighbor Based Feature Selection for Regression and its % Application to Neural Activity. Submitted to NIPS ...
d6d07a9b1060f0536317b231da601c6206c49443206e2b921d8185a14f06893b
MATLAB
3,014
93
function [catarray, numelems] = nk_cellcat(arr, arr2, dim, F) [ix,jx] = size(arr); if ~exist('dim','var') || isempty(dim), dim = 1; end catarray = []; mx = 0; my = 0; cx = 0; cy = 0; sx = zeros(ix*jx,1); sy= zeros(ix*jx,1); % Determine output sizes of catarray cnt=1; for i=1:ix for j=1:jx if ~exist('arr2',...
bf812743cd91b18263044a7ceb5cc09205bbeb227e16e7c2582a95cde851c794
MATLAB
3,019
96
function [GridSelectorResults, ipos] = ... nk_GridOptimumSelector(TR, TS, C, MD, FEAT, Weights, CV2Pred, CV1Pred, P, Pdesc, combcell, act, perc) global SAV if ~exist('perc','var'), perc = []; end %%%%%%%%%%%%%%%%%%%%%%%% MAX SELECTION %%%%%%%%%%%%%%%%%%%%%%%%%% C(isnan(C)) = 0; [ipos, ind0] = nk_FindGridOpt(TR,...
b01e146d469cae4e04e5eb49cc814efa10eed7c59726522f2bff8b6382bc0038
MATLAB
3,020
81
classdef spatial_express_t0_noemg < 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 ...
abdc6d4063b3554a91b8cf8a21b118fb805994597c137781f0d2952a50905941
MATLAB
3,021
85
clear; clc; %% Load File %% data=readtable('...\Monkey_Behavioral_Data\Monkeys_Behavioral_Data_Analysis2',VariableNamingRule='preserve'); %% allSess=unique([data.Session]); colorSolo=[10 10 92]/255; colorJa=[.9 .1 .1]; faceAlpha=0.7; TD1_Solo=NaN(12,1); TD1_Ja=NaN(12,1); TD2_Solo=NaN(12,1); TD2_Ja=NaN(...
5d5adcca81f72a9c53cc8587dbe3374a41a73ee8de7433a65a8bcb526ae50644
MATLAB
3,025
79
%% ================================================================ % Script: visualize_developmental_difference_FOCA_CohenD.m % Purpose: % Visualize developmental differences in individualized FOCA matrices % between neonates (dHCP) and adults (HCP) using precomputed Cohen’s d. % % Description: % - Load p...
a51e58bfe2d39ee1f713a216d242f63515a31e58f5b8608f3ed814285bc9fcab
MATLAB
3,028
94
function animate_fit load steve load pp_allstates [time_bar,tent_point,tent_trail,spec_axis,tent_axis,exp_plot,fit_plot] = init_plot(t,f,s); xyz_trail = zeros(length(t),3); constraint_data = []; for j = 1:length(t) [f1,P1,idx] = db_fit(f,s(:,j),db_data,[]); keyboard title(spec_axis,sprintf('Step %d/%d'...
6778ce92084fbbdafca6d9ffe5cac16abe91d552635b4a12dc0297c21b9a1246
MATLAB
3,030
89
clear load('ProcessedData\tables_compiled_shifterMag.mat'); %% classifier code; runs on increasingly larger random subsets of cells % % reorg main table if needed % re_org = vertcat(tables_compiled{:}); % tables_compiled = cell(1,1); % tables_compiled{1,1} = re_org; tic % run within days by iter; params fo...
36151db750de4aef38f69a5f508c4d43e821991e3dc5c852628c6b4c40a931ff
MATLAB
3,033
82
% this script performs the signal vector decomposition using graph signal % processing approach (Graph Fourier Transform) given Adjacency matrix %%%change this: p_dim = 126; % dimension of probability matrix (nROIs) %%%%aligned means coupled; liberal means decoupled %%%change this: choose_aligned_range = 12; % numbe...
b93d00fef796c5b325349e976a630d31760332a9a000c8c4a6799968ff9bd2fb
MATLAB
3,033
88
function [A,Y,numIter,tElapsed,finalResidual]=sparseseminmfnnls(X,k,option) % Sparse Semi-NMF based on NNLS: X=AY, s.t. Y>0. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=seminmfnnls(X,k) % [A,Y,numIter,tElapsed,finalResidual]=seminmfnnls(X,k,option) % X: matrix of mixed signs, dataset to factorize, each...
b971ca1bc2bcd31f011714b24c3078744c0d2732a568c9c815b31a6dd5f7bb62
MATLAB
3,033
87
function [w_Brain, model_All] = W_Calculate_SVR_CSelect(Subjects_Data, Subjects_Scores, Pre_Method, C_Range, ResultantFolder) % % Subject_Data: % m*n matrix % m is the number of subjects % n is the number of features % % Subject_Scores: % the continuous variable to be predicted,...
d46194c92e9ed92af45faa2281c81281114f31f6f88207b621d5f026e7d8a8ee
MATLAB
3,034
87
function read_inomed(varargin) %READ_INOMED Spike detection for Inomed data. % READ_INOMED loads Inomed continuous files, performs filtering, % censoring and spike detection of channels. Files are saved in Ch*.mat % files for clustering. To support MClust, 'fake tetrode' data is % generated by multiplyin...
e57c9de7bc1736385f442401310958ab25a80ff183793371250d31f75de0b683
MATLAB
3,034
96
function [varargout] = WeightedMIToolbox(functionName, weightVector, varargin) %function [varargout] = WeightedMIToolbox(functionName, weightVector, varargin) % %Provides access to the functions in WeightedMIToolboxMex % %Expects column vectors, will not work with row vectors % %Function list %"entropy" or "h" = H(X) %...
1b9234bed3576bd36de112d12f84db6666de051356d79dd4946a00e77c968399
MATLAB
3,035
97
function [VIn, MIn] = partition_distance(Cx, Cy) %PARTITION_DISTANCE Distance or similarity between community partitions % % This function quantifies information-theoretic distance (normalized % variation of information) or similarity (normalized mutual information) % between community partitions. % % VIn ...
a4ded3ab8e860493c5f39da0144a3f94befd76cc637ca82dd234d948c51d246c
MATLAB
3,041
88
function varargout = OpenEphysLoadingEngine(fn,varargin ) %MClust Loading engine for reading in tetrode data collected with %Open Ephys GUI software (http://open-ephys.org/#/gui/). Requires %pre-processing with Simpleclust (Jacob Voigts, %http://jvoigts.scripts.mit.edu/blog/simpleclust-manual-spike-sorting-in-matlab/...
9b24a76364d0bf1dff3801d4eeedc65b0595abc695948b16d22d5a346afe377b
MATLAB
3,043
86
function getActivity(path) % Function to project the raw and deconvolved activity of data acquired % through the CNMF-E algorithm using the ConcatMiniscope pipeline. % % INPUT: % path: path of the folder containing the dataset to be treated. Outputs % will be saved to the folder as ".mat" files with the name % "n...
20b3f5f9c82e17e7ddcf5aa0308c43597334c12320acc91483e2530b501052e6
MATLAB
3,044
98
function [D, max_k_val, no_dims] = find_nn_adaptive(X) %FIND_NN Constructs nearest neighbor graph using adaptive nbhd selection % % [D, max_k_val, no_dims] = find_nn_adaptive(X) % % Constructs nearest neighbor graph on the data in dataset X using adaptive % neighborhood selection. In X, rows correspond to the observati...
5af714f1530450b60763c00183bd5d2b5bb59ef99373b0fc059b9cb43f5dda7b
MATLAB
3,049
90
function ext = palm_checkprogs % Test whether some external programs or toolboxes % are available, namely, FSL, FreeSurfer, SPM and % Jimmy Shen's NIFTI toolbox. % % ext = checkprogs % % 'ext' is a struct containing one field for each % of these applications, each being containing % a 0 (false) or 1 (true) depending o...
71c744fba0a610b7c7a1e7a8beff8fc44513f2c0d13c2943419d2841402564de
MATLAB
3,052
115
function [A, iter, alpha] = nesterov_mnls_general(X, C, B, A_star, alpha, max_iter, func_type) % Accelerated proximal gradient algorithm for nonnegative constraint % min_A f(A) := 1/2 | X - C*A*B' |^2_F, % s.t. A >= 0. % % f(A)' = -C'*(X - C*A*B')*B = C'*C*A*B'*B - C'*X*B % tol_1 = 1e-2; tol_2 = 1e-2; ...
736d8874d58008e74bf6a404389aa69983c3b94578f7d22a71dbf8f5b0eb01f5
MATLAB
3,053
102
% SB2_PARAMETERSETTINGS User parameter initialisation for SPARSEBAYES % % SETTINGS = SB2_PARAMETERSETTINGS(parameter1, value1, parameter2, value2,...) % % OUTPUT ARGUMENTS: % % SETTINGS An initialisation structure to pass to SPARSEBAYES % % INPUT ARGUMENTS: % % Optional number of parameter-value pairs to specify so...
2ddd4b15a2f0d67d0b53242f5f0063e1fc9d2e79cb07e7ffd4a302ddced3a233
MATLAB
3,056
89
function [sY, params] = nk_Scale(Y, cv, i, j, kbin, params, labels) binmode=1; TrInd = cv.TrainInd{i,j}; TsInd = cv.TestInd{i,j}; if iscell(Y) sY=Y; end [iy,jy] = size(cv.cvin{i,j}.TrainInd); for u=1:kbin sY{i,j,u}.Tr = cell(iy,jy); sY{i,j,u}.CV = cell(iy,jy); sY{i,j,u}.Ts = cell(iy,jy); params...
6b2a66459acf8f25819f73b898610fc8e510bb2da8fe7649d607c60b1ced21a3
MATLAB
3,056
103
function cones(f) %if ~isnumeric(varargin{1}) %f = varargin{1}; xyz = f.xyz; fitted = isfinite(chisq); valid = [fitted(2:end)==1 & fitted(1:end-1)==1]; % This says % else % xyz = varargin{1}; % xyzdiff = varargin{2}; % valid = true(size(xyz,1),1); % end ...
5f5ce2e31edbb770bbbad119da621b7bfda941e0b89ae32939d3e4f5f4c3e97f
MATLAB
3,058
96
function [ best_param perform_mat] = CrossValidation1Param... ( X, Y, obj_func_str, obj_func_opts, param_range, cv_fold, eval_func_str, higher_better) %% Function CROSSVALIDATION1PARAM % Model selection (cross validation) for 1 parameter % multi-task learning functions % For usage see test_script.m % %%...
98b92b3909f696aeba6204435aab172a50ba43cd825914482283bc8a69c8f99f
MATLAB
3,058
116
classdef MClustData < handle % Settings used in MClust % % ADR 2012/12 % % contains data used in MClust that does change on a tetrode to tetrode % cycle properties(Constant) maxClusters = 98; end properties(Access = public) % constants ...
fe09f1e5312b51a2c3ef9f74edac3f6c39e6442411ecba1c5dca6048c5f0d8d0
MATLAB
3,061
114
function [G H w] = mnmf(X,r,labl,C,K) theta = C/K; str = ['-t', ' ', '0', ' ', '-c', ' ', num2str(C)]; fprintf('K = %f C = %f theta = %f\n',K,C,theta); MAX_ITER = 30; [siz_train_dim siz_no_fea] = size(X); Ginit = rand(siz_train_dim,r); Hinit = rand(r,siz_no_fea); [m,n] = size(X); G = Ginit; H = Hinit; % [aa b...
5e09f4dec7a2eab5317039ea3119f0400a479e35f016bd9866e7ab2fb0979d50
MATLAB
3,063
103
% 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, 2017 clc; clear; close all; %% generate synthetic data of (mxn) matrix m = 150; n = 150; V = rand(m,n); %% Initialize of rank to be factorized rank ...
050c2ee5dbb8c9e3fbfc523d11f442f6abd9b4f76e6fb5c393e1efce50e3ca9c
MATLAB
3,065
110
function [ W, info ] = MTFLCd_SSolver( X, y, lambda1, lambda2, opts ) % % Multi-Task Feature Learning with Calibration % diagnoal version for faster computation on small sample size. % smoothing -- using solver. % % OBJECTIVE % min_W { sum_i^m ||Xi wi - yi|| + lambda1 ||W||_{1,2} + lambda2/2 ||W||_F^2 } % % INPUT % ...
cf9db629b14643a3e0cf80370e9a58394b5e40f9a8676da7f4bf6cc6f4953711
MATLAB
3,068
106
function chain_diagnostics(model,out,posterior_out,j_burnin,automode) % Display diagnostics for the chain (trace plot and posteriors) % posterior_out is the probability (from model.probability) % j_burnin controls how much is displayed in red/in first segment % automode=false will pause with a keyboard prompt if ...
9db7101fbb7a06f76acd36577f452aec875c48d7b615e5e46616982624d3fd9e
MATLAB
3,074
68
% ========================================================================== function [mn_str, mn_act] = nk_matLearn_BuildMenu_config(param, opt) if isempty(opt), mn_str = []; mn_act = []; return; end nO = numel(opt.desc); desc = []; icnt=1; for i=1:nO opt_str = '?'; no_mnu = false; if isfield(param,'Params') &...
ca60abb80f3ee0be6ea8ebc3f984b157ee6254854b980de301b79a35f0ffd69f
MATLAB
3,074
89
clear load('ProcessedData\tables_compiled_behavior_retuned_021726.mat'); %% classifier code; runs on increasingly larger random subsets of cells % % reorg main table if needed % re_org = vertcat(tables_compiled{:}); % tables_compiled = cell(1,1); % tables_compiled{1,1} = re_org; tic % run within days by it...
eca7ad1922335cb8ab6aa190eb28c72025d7d18fa1b4bab388f862fef6fd4673
MATLAB
3,078
65
clc;clear;close all;clear gca %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Analyses\Data"); %d=load('Jupiter_test_data_TOJ_whole_period.mat'); %spikes=d.data.spikes; %cd("D:\DKU study\DKU\SRS 2021\Susan's work\TemporalContextCells-ECmonkey-master\Data\PSTH_1_to_401_jupiter\PST...
fbba764431bea4aea96f6a6d24dbe874122a96604cf9abc34894ae67e2093007
MATLAB
3,085
79
function [testClassPredicted]=repetitivenmfClassifier(trainSet,trainClass,testSet,testClass,option) % Repetitive NMF classifier. % Usage: % [testClassPredicted,sparsity]=repetitivenmfClassifier(trainSet,trainClass,[],testClass) % [testClassPredicted,sparsity]=repetitivenmfClassifier(trainSet,trainClass,testSet,testClas...
a7a39bfbc8509a434d8b3d311e690d01e67130ee62d7ddd4a193b614d5f38bfa
MATLAB
3,086
82
function [EBC,BC]=edge_betweenness_wei(G) %EDGE_BETWEENNESS_WEI Edge betweenness centrality % % EBC = edge_betweenness_wei(L); % [EBC BC] = edge_betweenness_wei(L); % % Edge betweenness centrality is the fraction of all shortest paths in % the network that contain a given edge. Edges with high values of % ...
4a9bc79d5b449af599bdb285a064353b5f50fb93877ae5c0b39a5bf579ab4727
MATLAB
3,087
84
function [corrCoeffs,recon,betaCoeffs,fcCorr,fcRecon] = ... calc_eigenreconstruction(data,eigenvectors,method,modesq,params) % calc_eigenreconstruction.m % % Reconstruct data using eigenvectors and calculate the coefficient of % contribution of each vector % % Inputs: data : data [MxP] % ...
dfcc80771fb5e0b007b5c59870b8051bd1af59a967536006c7b8f7539d130d97
MATLAB
3,089
90
clear load('ProcessedData\tables_compiled.mat'); %% classifier code; runs on increasingly larger random subsets of cells % % reorg main table if needed % re_org = vertcat(tables_compiled{:}); % tables_compiled = cell(1,1); % tables_compiled{1,1} = re_org; tic % run within days by iter; params for number of...
7416afcfe3b7e764fb79a5a49d1374b652b413631ca7842aad7414d5451f55db
MATLAB
3,094
139
<<<<<<< HEAD function varargout = plot(varargin) % plot method for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: plot.m 7513 2019-01-15 15:17:29Z guillaume $ % if ishandle(varargi...
8f2e836d0087d565c7281784945fe0f5052d19fb5cb85ae60fe2f17f21d01c44
MATLAB
3,100
110
function [opt_hE, opt_E, opt_F, opt_D] = nk_EDMin(E, L, EnsStrat) global BATCH ind0 = L~=0; E = E(ind0,:); L=L(ind0); [m,k] = size(E); % Compute initial ensemble performance if EnsStrat.Metric == 2, T = sign(E); else T = E; end opt_hE = nk_EnsPerf(E, L); orig_hE = opt_hE; opt_D = nk_Lobag(T, L); orig_D = opt_D; ori...
d60e5e9765b00c8e47b61a48fd241a20c2f57977b564a6cc5c62880f55cc6cb3
MATLAB
3,105
90
clear load('ProcessedData\tables_compiled_shifterMag.mat'); %% classifier code; runs on increasingly larger random subsets of cells % % reorg main table if needed % re_org = vertcat(tables_compiled{:}); % tables_compiled = cell(1,1); % tables_compiled{1,1} = re_org; tic % run within days by iter; params fo...
e95cf7a9597bae217e0524215ecc70e0842a128067a3af289971a2e9bb582789
MATLAB
3,106
72
function runConcatStep1(path,equipment) %% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
aa48b2ef002d751cdccf624ea464f1b1db98846f7afcdca0e425b4e6ea380b69
MATLAB
3,107
96
function [gammaOptimal,KOptimal,scoreMax]=modelSelectionGammaK(D,classes,option) % Grid Search % usuages: %[gammaOptimal,KOptimal,accMax]=modelSelectionGammaK(D,classes,option); %[gammaOptimal,KOptimal,accMax]=modelSelectionGammaK(D,[],option); %[gammaOptimal,KOptimal,accMax]=modelSelectionGammaK(D); %%%% % Copyright (...
234dd9fe619046157bfa62e830859bc5c6fd619b0adeebd87504e8c2916290e9
MATLAB
3,111
78
function [f,F]=motif3funct_bin(A) %MOTIF3FUNCT_BIN Frequency of functional class-3 motifs % % [f,F] = motif3funct_bin(A); % % *Structural motifs* are patterns of local connectivity in complex % networks. In contrast, *functional motifs* are all possible subsets of % patterns of local connectivity embedded...
139b15026b1efcc274bbe783fcc2bc5f8ff3ac3f77efff76c88b124cf3e72222
MATLAB
3,114
78
function answer = checkMotionCorrection(BeforeCorrection,AfterCorrection) global ff % global answer ff=figure('units','normalized','outerposition',[0 0 1 1]); set(ff,'KeyPressFcn',@myfun); % colormap gray prompt1 = {['Frame # (from ' num2str(size(BeforeCorrection,3)) '):']}; dlgtitle1 = 'Start from...'; dims1 = [1 55...
4d269f163867d366dd4aa11c051c608070902e55a36a9d7a17c51cc844571316
MATLAB
3,125
73
function [ SPATIAL, PX ] = nk_Spatial_config(SPATIAL, PX, defaultsfl, parentstr) % Compute spatial consistency of discriminative effects if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = 0; end; if ~exist('PX','var'), PX = []; end; cubetype = 1; cubefwhm = 8; cubevoxres = 3; if ~defaultsfl ...
9d1bead296e6c4c30399eda5b2a91fa11b2549ec77ffab5ee712aeb6ef4815fd
MATLAB
3,130
109
function [opt_hE, opt_E, opt_F, opt_D] = nk_EntropMax(E, L, EnsStrat) global BATCH VERBOSE ind0 = L~=0; E = E(ind0,:); L=L(ind0); [m,k] = size(E); % Compute initial ensemble performance if EnsStrat.Metric == 2, T = sign(E); else T = E; end opt_hE = nk_EnsPerf(E, L); orig_hE = opt_hE; opt_D = nk_Entropy(T,[-1 1], m, ...
5e8cb9e89c43ef63e7566fc3b8249c7b1d2ec7dd9604dbf8a1bf0b8eb1b8b0ca
MATLAB
3,132
144
function [sc] = chkconv(filname,rthresh) load(filname); for nsc=1:11 if nsc==1 sc = [1 2 3 4]; elseif nsc==2 sc = [1 2 3]; elseif nsc==3 sc = [1 2 4]; elseif nsc==4 sc = [1 3 4]; elseif nsc==5 sc = [2 3 4]; elseif nsc==6 sc = [1 2]; elseif nsc==7 sc = [1 3]; ...