sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
68ec84b5dfcaed54c1d23eeca686c3420a84a7740b46a48b3c05cc2051be679a
MATLAB
3,135
102
function M = clique_communities(A, cq_thr) % CLIQUE_COMMUNITIES Overlapping community structure via clique percolation % % M = clique_communities(A, cq_thr) % % The optimal community structure is a subdivision of the network into % groups of nodes which have a high number of within-group connections % and a...
ee6b05d17bd6db6a989d8c5c9e81518d269211fa2e4fc819e165e022eaa4d92d
MATLAB
3,137
109
function [opt_hE, opt_E, opt_F, opt_D] = nk_DiversityMax(E, L, EnsStrat) global 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, k)...
2b7fa1c1d3d042b42b3e076768416228d284900cbb35a9ebd98f76346cf26893
MATLAB
3,139
104
function updrs_bursting_corr(avgBI, figdir) %UPDRS_BEHAV_CORR calculates correlation between UPDRS scores and bursting index % UPDRS_BEHAV_CORR calculates Pearson's correalation between preop and postop (DBS-on) % UPDRS scores (tested both with and without medication) and bursting % index of units. % Creat...
a3efe06d4e9d37bd6f2e6412e473172adb1690b324e131627cda400f064cf667
MATLAB
3,140
134
function result=halfspacedepth(u,v,x,y) %HALFSPACEDEPTH computes the halfspace depth of a (two-dimensional) point theta % relative to a bivariate data set. % % The algoritm is described in: % Rousseeuw, P., Ruts, I. (1996), % "AS 307: Bivariate Location Depth", % Applied Statistics (JRSS-C), 45, 516-526. %...
d798f8fe07ca2b4de2a527166a0872bf4ebc0ece3563f86ce3c9e0568ee6c946
MATLAB
3,140
99
function [mappedX, mapping] = lpp(X, no_dims, k, sigma, eig_impl) %LPP Perform linearity preserving projection % % [mappedX, mapping] = lpp(X, no_dims, k, sigma, eig_impl) % % Perform the Linearity Preserving Projection on dataset X to reduce it to % dimensionality no_dims. The number of neighbors that is used by LP...
b78d027ed23c2153a4ceb16f204ee5d4069fc466e3dc555de22a7e87bec40320
MATLAB
3,141
74
function setupOptickaCI() %> setupOptickaCI — Configure the MATLAB path for CI without PTB's interactive %> SetupPsychtoolbox (which fails on CI). %> %> This script is the CI equivalent of: %> 1. Cloning/installing Psychtoolbox %> 2. Running SetupPsychtoolbox(1) %> 3. Running addOptickaToPath(true) — but s...
06d9b941aa91016b2b38ca9c72ac9bdc60a9cd56c2a566bc25d03530fa2c6a90
MATLAB
3,150
117
function res = JuSpace_noGUI_2D(list1,atlas,options,PET_list,image_for_size,dir_tool) % addpath(genpath('/opt/matlab/JuSpace_v1.3/')); list2 = []; if ~ischar(image_for_size) image_for_size = char(image_for_size); end % list1: cell with filenames % list2 (options % JuSpace directory % dir_tool = fileparts(whic...
d34d896a485610f3a1d6fa87d51e811710848368c8788435bc978dae95b8a9ac
MATLAB
3,152
75
function load_selModelMeasures(handles) l=1; switch handles.modeflag case 'classification' popupstr{l} = 'Classification plot'; l=l+1; case 'regression' popupstr{l} = 'Regression plot'; l=l+1; end predind = get(handles.popupmenu1,'Value'); predstr = get(handles.popupmenu1,'String'); if strcmp...
b719d6bb993150d96557f0dc7cb67fd2c1531a46e887f93cfaa84cdd38ba84ea
MATLAB
3,156
88
function param = nk_RGS_config(param, defaultsfl) % function param = nk_RGS_config(param, setupfl) % % Setup parameters for the RGS algorithm (kNN-regression) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (c) N. Koutsouleris 04/2015 epochs = 1; num_starts = 2; verbose = 1; if ~exist('d...
eceeda990c2a05e39cecf536ddfda4c209fd13d9a0dc2798e1f2475795056790
MATLAB
3,156
115
function [tform,Corr] = ManualAlignSessions(refFrame, frame,i,j ) %ManualAlignSessions Summary of this function goes here % % hLarge = fspecial('average', 40); hSmall = fspecial('average', 3); refFrame1 = refFrame; frame1 = frame; clf set(gcf,'units','normalized','outerposition',[0 0 1 1]) subplot(2,3,1) imagesc(refFr...
b5dc805ecf163040d4dee915ac8e9445cacdad071a51686efd2cdf63b52c2862
MATLAB
3,158
95
function [Y,numIter,tElapsed]=convexnmfruletest(X,outTrain) % map the test/unknown samples into the convex-NMF feature space, this % function is called by function featureExtractionTest % X: matrix, test/unknown set, each column is a sample, each row is a feature. % outTrain: struct, related options in the training ste...
d3d740cd083796e20656156749a85e3ed49bc3ee84e98e898191ed9ad2a408b5
MATLAB
3,159
75
function [dims, PercMode, act] = nk_ExtDim_config(RedMode, PercMode, dims, defaultsfl, parentstr) global NM if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if (~exist('dims','var') || isempty(dims)) || (~exist('PercMode','var') || isempty(PercMode)) [PercM...
a82b19de147e9fa37a3ecc227ca3ccfd2c5b062d851cc881906c0ad7bb38feef
MATLAB
3,168
53
function [act, SEQOPT ] = nk_SEQOPT_config(SEQOPT, defaultsfl) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = false; end if ~defaultsfl if ~isfield(SEQOPT,'C'), SEQOPT.C = NaN; end if ~isfield(SEQOPT,'PerfMode'), SEQOPT.PerfMode = 1; end if ~isfield(SEQOPT,'AnchorT...
0a4398d50efb9ad15e71e8247f49d562ebfaeb34067d8b5a4fc54268dca09af1
MATLAB
3,170
103
function [p, R] = polypredcicall_mod(x,y,lev,str,res) %POLYPREDCICALL Plot regression line with confidence interval. % POLYPREDCICALL(X,Y,LEV) calls POLYPREDCI with input coordinates X and % Y. Regression line is overlayed on scatter plot. Confidence interval is % plotted at a confidence level defined by LE...
bf63a3631ecc23bfd009a7feb01f2d22ec1760c727a08e54b8f087cb9989bed6
MATLAB
3,173
80
% ========================================================================= % FORMAT param = nk_OOCV_config(param, res) % ========================================================================= % NeuroMiner menu configurator for the OOCV runtime parameters % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
e9f0b9fdd1e13a82cdefa61681c422b51429979c6451aed4ad6680c722c4ba3a
MATLAB
3,174
86
function [mappedX, mapping] = charting(X, no_dims, no_analyzers, max_iterations, eig_impl) %CHARTING Performs manifold charting on dataset X % % [mappedX, mapping] = charting(X, no_dims, no_analyzers, max_iterations, eig_impl) % % Performs manifold charting on dataset X to reduce its dimensionality to % no_dims dime...
13fea449a1c71721ae08f49d4868c2c8b1c2b8c00d26195d6b97d089b5902c46
MATLAB
3,177
117
function [selection, OK] = nonmodal_listdlg(varargin) % [selection, OK] = nonmodal_listdlg(varargin) % % variables are chosen to match Matlab's listdlg box % code is modified from Matlab's listdlg code version 2012a ListString = []; SelectionMode = 'multiple'; ListSize = [160 300]; InitialValue = [1]; Name = ''; Prom...
71641dabd026a56a6989e00ddc101693a25450c57079909258b089946600aa52
MATLAB
3,177
98
function [mappedX, mapping] = landmark_isomap(X, no_dims, k, percentage) %ISOMAP Runs the Isomap algorithm % % [mappedX, mapping] = landmark_isomap(X, no_dims, k, percentage); % % The functions runs the Landmark Isomap algorithm on dataset X to reduce the % dimensionality of the dataset to no_dims. The number of nei...
b868e38a9794c5e39cc402a4f60b2ff7697fca5f07dec802cf580df4b0898f37
MATLAB
3,181
111
function [x, infos] = rnmf(V, rank, in_options) % Robust non-negative matrix factorization (NMF) with outliers (RNMF) algorithm. % % Inputs: % matrix V % rank rank % options options % Output: % w solution of w % infos information % % References: % Naiy...
a4a80accb9bd12ae1880528c23d35ad2f9f986b2f3bfc256adb05ffb1511303e
MATLAB
3,182
94
function robpcareg=robpcaregres(x,y,w,cutoffWeights) %ROBPCAREGRES is a function for robust multivariate regression, based on % the output from RSIMPLS and ROBPCA. % % Required input arguments: % x : Data matrix of the explanatory variables % (n observations in rows, p variables in columns...
0e855d0eeac9e88f50b245e25e308136a5dddf2133f2237d6b0467389f8dba3d
MATLAB
3,183
120
% create mex files all % %% list all c files % cd 'trainpredict' % trainpred_c = dir('**/*.c'); % trainpred_cpp = dir('**/*.cpp'); % % cd 'preproc' % preproc_c = dir('**/*.c'); % preproc_cpp = dir('**/*.cpp'); % % %% trainpredict c % error_count_trainpredict_c = 0; % for i= 1:size(trainpred_c,1) % cur_c = tr...
1eb6b2ff5e3a5c67b60c113928cf0bdb521713e1e040d4bb9c28471de85c5598
MATLAB
3,183
88
function W = weight_conversion(W, wcm) % WEIGHT_CONVERSION Conversion of weights in input matrix % % W_bin = weight_conversion(W, 'binarize'); % W_nrm = weight_conversion(W, 'normalize'); % L = weight_conversion(W, 'lengths'); % W_fix = weight_conversion(W, 'autofix'); % % This function may either binarize...
912a99ffa5dfd91f7f1a95cead8fb5bcb5a84a92402207804111707b7391a2bd
MATLAB
3,204
93
% ========================================================================= % FORMAT param = ALLPARAM(expected, predicted, invflag, tiedfun) % ========================================================================= % Compute all model performance parameters % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
3c67b84cb1db20318a2f9753fa970e67d90fc4165d6507b4fe69b2dcfca3615b
MATLAB
3,219
85
function [TimeStamps, WaveForms] = inodisc(data,ts,sr,thr,varargin) %INODISC Unit discrimination. % [T W] = INODISC(DATA,TS,SR,THR) performs threshold discrimination of % continuous timestamped (TS) unit data (DATA) sampled at the rate SR % using the specified threshold (THR). Peak times (T, 'TimeStamps') a...
c374f4478ebd239ba57cd856c7ef6b00b413535015471bf29fbb93d1e4dce4e0
MATLAB
3,220
88
function [sY, IN] = nk_PerfNormObj(Y, IN) % ========================================================================= % FORMAT function [sY, IN] = nk_PerfNormObj(Y, IN) % ========================================================================= % Percentage scaling of single-subject data to the group mean. The group is...
69e3e122011484f82e9d32834043f8bed67d0b7e71865ba68dd30b359dad0daf
MATLAB
3,225
90
function [f_fitted,P_fitted,idx,prob] = db_fit(exp_f,exp_P,db_data,constraint_data) % Fit a power spectrum to a parameter combination already in a database % Arguments are % f - experimental frequencies % P - experimental power % pp_f - database frequencies % pp - matrix of all power spectra in ...
20bd896de56459139988bf7fb031b6ac0d717c52acaa97309a4860127160f8be
MATLAB
3,226
93
function [ydata, mpp] = tsne(X, no_dims, perplexity) %TSNE Performs symmetric t-SNE on dataset X % % mappedX = tsne(X, labels, no_dims, initial_dims, perplexity) % mappedX = tsne(X, labels, initial_solution, perplexity) % % The function performs symmetric t-SNE on the NxD dataset X to reduce its % dimensionality t...
45a8f66cb38908258b8844ce26120d312a824bf9b58d03d1107c365d7cbc9cd1
MATLAB
3,228
85
function Y = sym_sne(X, d, perplexity) %SNE Implementation of symmetric Stochastic Neighbor Embedding % % mappedX = sym_sne(X, no_dims, perplexity) % % Runs the symmetric Stochastic Neighbor Embedding algorithm. The % high-dimensional datapoints are specified by X. The target dimensionality % is specified in no_dims...
8a955c1438838668c154a97da1d4a3d637ee066516961dc6b5dd06dc85c2e8b6
MATLAB
3,229
121
<<<<<<< HEAD function write_surf(fname, vert, face) % write_surf - FreeSurfer I/O function to write a surface file % % write_surf(fname, vert, face) % % writes a surface triangulation into a binary file % fname - name of file to write % vert - Nx3 matrix of vertex coordinates % face - Mx3 matrix of face t...
e1aa8cabc20998abc588b7e635d4fa8f65f16102180805984b096ab642a5d827
MATLAB
3,233
84
function Y = sne(X, d, perplexity) %SNE Implementation of Stochastic Neighbor Embedding % % mappedX = sne(X, no_dims, perplexity) % % Runs the Stochastic Neighbor Embedding algorithm using a Gaussian kernel % with fixed perplexity. The high-dimensional datapoints are specified by X. % The target dimensionality is s...
0b616d62d0394e4b6babe1dabea41ba67ce85af95a2f438e6244b4c73762f4bb
MATLAB
3,234
68
function [yl, ylb, yfun, ylbshort] = nk_GetScaleYAxisLabel(param) global PREPROC NM MULTILABEL if ~exist('param','var') OPTCRIT = NM.TrainParam.SVM.GridParam; elseif isnumeric(param) OPTCRIT = param; else OPTCRIT = param.GridParam; end switch OPTCRIT case 1 yl = [0 100]; ylb = 'Accuracy ...
736d7bdeb689ff725076a7e2f161a4f3b18475988a1a8b1ecc681b9611ffbe74
MATLAB
3,237
81
function [OOCVres, cases] = nk_ExtractPredictions(dat, analysis, dim) flgcv = nk_input('Display the CV data, too?',0,'yes|no',[1,0],1); labels = dat.label_oocv; cases = dat.cases_oocv; if flgcv if isfield(analysis{dim}.OOCV,'BinResults') frmwrk = 1; nclass = leng...
a3335643d8a2da46636755ed5bf14ec9d23bb4e963a8987edc986ff906e280b0
MATLAB
3,238
86
function network = backprop(network, X, T, max_iter, noise, lambda) %BACKPROP Trains a network on a dataset using backpropagation % % network = backprop(network, X, T, max_iter, noise, lambda) % % The function trains the specified network using backpropagation on % dataset X with targets T for max_iter iterations. Th...
468944093e0998a1d3328f6fe119994cd8e2e8b46b3ef1186427602942fed8bb
MATLAB
3,242
92
clear %% reorg behaviors to odor average for overall fig % deltas index load('ProcessedData\tables_compiled.mat'); final_output = cell(5,1); animals = unique(animal_ID); for i = 1:length(tables_compiled) day_now = tables_compiled{i,1}; trials_all = unique(day_now.TrialN); pull_day = zeros(length(tr...
04a52a58bf42e65d0b61adb80ee670abbbe13231e39f52521c47145e55138dfb
MATLAB
3,248
119
% load face file and compute SVD of motion and/or movie function h = computeSVDmotion(h) %% np = cumsum([0 h.npix]); tp = cumsum([0 h.tpix]); npix = h.npix; tpix = h.tpix; nframes = h.nframes; ntime = h.vr{1}.Duration; [nviews, nvids] = size(h.vr); wvids = []; for k = 1:nviews kmotion = h.avgmotion(tp(k) + [1:tpix...
89ef6390bdb8a777792b11ef2c6b5539526beb9ccf73199b94d698aa35a006cd
MATLAB
3,260
80
function [I,Q,F]=motif3struct_wei(W) %MOTIF3STRUCT_WEI Intensity and coherence of structural class-3 motifs % % [I,Q,F] = motif3struct_wei(W); % % Structural motifs are patterns of local connectivity in complex % networks. Such patterns are particularly diverse in directed networks. % The motif frequency ...
7a6ea7010e5c732654acee53310451795333351b218b9b8c274b7b898cb00dc7
MATLAB
3,262
91
function runMsCluster(path) %% Define parameters % path eval(['cd ' path]) %p = parpool('local',8); %% msRun2018 % Version 1.0 GE % Updated version of the msRun script originally proposed by Daniel B % Aharoni to analyse miniscope 1p calcium imaging data. % This version is build on top of the original package to max...
c705bee0cb8042cb1cadd5ccf734d0fa4fbca71e8ce18b01b8ec5bf13c49df7f
MATLAB
3,264
91
function [A,Y,numIter,tElapsed,finalResidual]=seminmfnnls(X,k,option) % 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 column is a ...
83ffe148c547f15f69486873d9c2d2150d6eb667f9d2ae76599aec3fd9fffc25
MATLAB
3,273
97
%% file example_SRMTL.m % this file shows the usage of Least_SRMTL.m function % and study the graph regularization % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * norm(W*R, 'fro')^2 + rho2 * \|W\|_1} % %% LICENSE % This program is free software: you can redistribut...
45ee4a797af51ecf1d0e614dc73371d8a3f6fc166df3e3010b9fceef886df73d
MATLAB
3,274
58
function [act, param] = nk_SA_config(param, defaultsfl, parentstr) SA.c = 0.01; % Sparsity constant SA.T = 1; % Starting temperature SA.T_stop = 0.005; % Stopping temperature SA.alpha = 0.9; SA.itt_max = 2000; % Max number of iterations SA.Rep_T_max ...
d62f3bd2bfbbd23b2a715c7f501c867893364ebfc138193c0115ffd4fc07670c
MATLAB
3,274
92
function [P_pos, P_neg, mindist_pos, mindist_neg, marginList, g_dists] = gflipHelperGpu(X, Y, g_dists, changed_feat, added, 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 ...
13bf728e2512b9e275dd5c9b510c90ab59d8dfd45ae43bf348d11041187ef284
MATLAB
3,289
74
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
3c14aa6542a10e623c2493b7560184f58e679c0828ee85e8010869ee685c18f4
MATLAB
3,291
110
classdef ctsd % ctsd object % % Rebuilt ADR 2011/12 % contains: % T0 - starting time % dt - timestep % D - data: n x .. array of data % % ctsd objects assume that % -> T is sorted in ascending order % -> dt is stored in seconds % -> D is in order and complete ...
2ac55981717db0818f70659c863f55139712f875b4cb3f1135f9b3f8fdc3c024
MATLAB
3,295
107
function [On,Wr] = reorder_mod(W,M) %REORDER_MOD Reorder connectivity matrix by modular structure % % On = reorder_mod(W,M); % [On Wr] = reorder_mod(W,M); % % This function reorders the connectivity matrix by modular structure and % may consequently be useful in visualization of modular structure. % % ...
4989f946882ad1b90cbfb0566179c68193ca1a49e358a17dca22f7f889e11ee9
MATLAB
3,296
126
function out = nk_Cluster(W, ACT) global VERBOSE % Find clusters (connected areas) in an image and return new image containing the % number for each cluster sorted by size. The largest cluster has number % one and so on. %spm_progress_bar('Init',n,'Cluster',' '); if VERBOSE, fprintf('\n\n========================...
cac2f68701f3e402c9ec710f1631e97b3eb143cad0da9716a92523e10f8bf17f
MATLAB
3,297
113
% choose which movies to process and how to process them function [filename, folders, namef] = chooseFiles(filename, folders, namef) filename0{1} = []; folders0 = {}; namef0 = {}; figpos = get(0,'DefaultFigurePosition'); figunits = get(0,'DefaultFigureUnits'); set(0,'DefaultFigurePosition',[1000 500 500 150]...
d06f2be7be94a29c3d0330f1ebda9b73da04f16a861453bc5cce3132cd5baf48
MATLAB
3,297
88
%% ================================================================ % Script: compute_foca_matrix.m % Purpose: % Construct Functional Topography Covariance (FOCA) matrices % based on individualized functional topographies. % % Description: % - Loads subject-level individualized topography maps % - Comp...
55c8218d27320ddc5385c90dc95094040ca2ce274817884d564d76e7ceeb9a5d
MATLAB
3,304
133
function demo(func, k); % demo; % demo(func); % demo(func, k); % % Demo for using the algorithms in this directory, developed or used 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 2005. % % the d...
302c639bfe781651ad4ff1e3fceaeed246c611493cae45871f8f64368bcc95b4
MATLAB
3,310
90
function [Xk,Uk]=l1QP(H,C,lambda) % solve 0.5*tr(X^THX) + tr(CX) + lambda|X|_1 % Yifeng Li, Feb. 21, 2012 option.tol=2^(-32); nV=size(H,1); % number of variables nP=size(C,2);% number of problems % Xk=H\(-C);%pinv(H)*(-C); Xk=zeros(size(C)); Uk=abs(Xk); Zk=[Xk;Uk]; W01=false(nV,nP); W02=false(nV,nP); W01(Xk>=0)=true;...
31444004b9ce06d8cff3f023d658b6062f514d51a3b3a2962af8c4e198802b93
MATLAB
3,313
87
% This script extracts frequency (and related) data from the "click" data % that came from digitizing spectrograms from xeno-canto.org % Define the path to your folder if necessary folder_root = ".\"; % Uncomment the animal category for which you want to extract data folder_rel = "Birds"; % folder_rel = "Frog...
3a9b5819c40e6afc54f250294652e87fad7f235685c1daad7e2e0b0b420591bb
MATLAB
3,315
105
function [mappedX, mapping] = lltsa(X, no_dims, k, eig_impl) %LLTSA Runs the linear local tangent space alignment algorithm % % [mappedX, mapping] = lltsa(X, no_dims, k, eig_impl) % % The function runs the linear local tangent space alignment algorithm on % dataset% X, reducing the data to dimensionality d. The numb...
5cdca059c204924b61727bdec78b1412ec1c6ed22f0b175322f8d038f211b456
MATLAB
3,315
106
%data = randn(1000,10); %batch = [1 1 1 1 1 2 2 2 2 2]; %mod = [1 2 1 2 1 2 1 2 1 2]'; function bayesdata = combat(dat, batch, mod) [sds] = std(dat')'; wh = find(sds==0); [ns,ms] = size(wh); if ns>0 error('Error. There are rows with constant values across samples. Remove these rows and rerun ...
c4d821db685b0805880b44eb1b06e74c53e91d0411c3dcaefc737f6cf623e735
MATLAB
3,328
95
% Produce Figure S2 % ( 10 s excerpts of firefly and cricket signals) % File to analyze: InputVideo = 'cricket_and_firefly_video.mp4'; firefly_data_file = 'firefly_flash_matrix.csv'; % Load info about frames per second (FPS) etc from video v = VideoReader(InputVideo); Nframes = v.NumFrames; Fs_vid = v.FrameRate; %...
e40ae29ff63565a0e6c9be70dd8595fb49437dca67b87c15876f31302908396c
MATLAB
3,336
100
function [selectedFeatures] = feast(criteria,numToSelect,data,labels,varargin) %function [selectedFeatures] = feast(criteria,numToSelect,data,labels,varargin) % %Provides access to the feature selection algorithms in FSToolboxMex % %Expects the features to be columns of the data matrix, and %requires that both the feat...
27d8a0c410164bbfdd8f4c9bea15fae3e28e544d2f416862de52271fe99b9d6c
MATLAB
3,338
98
function cuepair_trialtypes_2Evinx(sess2analyse,EventTypes) %CUEPAIR_TRIALTYPES_2EVINX saves trial/epoch indeces of trials with different level of conflict. % CUEPAIR_TRIALTYPES_2EVINX sorts trials into following groups based on cue pair: % % - ordered, i.e. numbers are in ascendent order: 12, 23 (level of % confl...
cd37379b93bfc8affb09d9bc67678e7d923abeb85180ea979fffcf6df8812efd
MATLAB
3,341
114
function unit_sorter(EventTypes,EvTy) %UNIT_SORTER Responsive/ predictive units % UNIT_SORTER(EventTypes,EvTy) % -Tests activation/ inhibition of units around events % -Statistically significant activation/ inhibition following an event % (responsive units) % or significant difference between partitioned ...
0f874deb7453802ffea9e7159d92a777d1c5d3cc35636a7d72399d9cf947ada6
MATLAB
3,349
107
function [A,Y,numIter,tElapsed,finalResidual]=sparseNMFNNQP(X,k,option) % linear sparse NMF based on NNQP: X=AY, s.t. A,Y>0. % Definition: % [Ak,A,Y,numIter,tElapsed,finalResidual]=kernelnmfrule(X,k) % [Ak,A,Y,numIter,tElapsed,finalResidual]=kernelnmfrule(X,k,option) % X: matrix of mixed signs, dataset to facto...
42e066a97bef0a90e97dcb437b4edc6afd9c08cc209e367a888a96e90dea08c1
MATLAB
3,350
94
clear load('ProcessedData\tables_compiled_noShift.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 n...
3e402bdd36f98f7a028495064cfc6ee3fea310a8a7d7a78abe82759589d94165
MATLAB
3,353
98
function estY = kNNreg(X_test, X_train, Y_train, weights, extra_param, sorted_dists, NNs); % Implementation of kNN regression algorithm, as used 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 2005...
2649196dc5114dcbfbd6d29995b44215e3bcf3074077099ce1c1cfa97dfd0e54
MATLAB
3,358
85
classdef spatial_express_xyz_all < 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 ...
30a9e6c61ae7e6ff3e08982b3bd642091935daae86bfe46493f70582076a036c
MATLAB
3,361
101
% ========================================================================= % FORMAT [R, nsigma, nlambda] = imreliefmain(Y, labels, SortInd) % ========================================================================= % This function provides an interface between NeuroMiner and the IMRelief % feature selection function....
e0cadcdbdb78f5a4f58ffa40c9a5b1467a443f9c1744450fea93b74900b9a5fd
MATLAB
3,363
152
function [S,P,t,kmax,med]= rstep(X,k,center,r); %RSTEP is an auxiliary function for 'rapca.m'. % % This function is part of LIBRA: the Matlab Library for Robust Analysis, % available at: % http://wis.kuleuven.be/stat/robust.html % % Created by Sabine Verboven and Mia Hubert (October 2000) % Part of the ...
c2f03af076b95e30ed8ffe88feb1bd6f45af65c462f6263667dbe8eae7669bb4
MATLAB
3,365
88
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 Odors_New = ["1","2","3","4",...
531949e062a942d4e8ed8609bca73db7b7a431b5b286aad09fa58b5d50e1c6b1
MATLAB
3,366
94
function RT_allgroupin(allpat_cntr,conditions,allpats,whichRT) %RT_ALLGROUPSIN1 draws boxplots of RT/SSDp0.5/SSRT values % RT_ALLGROUPSIN1(allpat_cntr,conditions,allpats,whichRT) plots % RT/SSDp0.5/SSRT values (ALLPAT_CNTR)of type WHICHRT, for each task % condition (CONDITIONS), including all patients inclu...
6fc4eba9cd3f16d35a19abbd728b8f191bb70312d6a52838f58d13f6cf67325f
MATLAB
3,366
122
function result=mscalelogist(x,varargin) %MSCALELOGIST is an M-estimator of scale with psi-function equal to % (exp(x)-1)/(exp(x)+1) and with auxiliary location estimate. % It is iteratively computed. It can resist 50% outliers. % If x is a matrix, the scale estimate is computed on the columns of x. The % result is t...
1241f9412b5bac99e663955b657151a85aa736b4a3210663f07c30311d8ec88b
MATLAB
3,367
101
function selected_features = fwd_sel(X_train, Y_train, extra_param); if ~isfield(extra_param, 'verbose'), extra_param.verbose=0; end if ~isfield(extra_param, 'k'), extra_param.k = ceil(log2(size(X_train,1))); if extra_param.verbose, disp(['k = ' num2str(extra_param.k)]); end; end k = extra_param.k; if ~isfield(extra...
14f40c68f0551fcc1d5c2511f2988bf5f4a4f77eaf98a90aa813ccb6d2f8ec65
MATLAB
3,368
103
%% file example_SRMTL.m % this file shows the usage of Least_SRMTL.m function % and study the graph regularization % %% OBJECTIVE % argmin_W { sum_i^t (0.5 * norm (Y{i} - X{i}' * W(:, i))^2) % + rho1 * norm(W*R, 'fro')^2 + rho2 * \|W\|_1} % %% LICENSE % This program is free software: you can redistribut...
668b95e340601783f1624fd3feb37b7e551561f37ac8ac24b176f795c518feeb
MATLAB
3,373
75
% % Edited so that eigenvalues can be extracted to separate aligned(+ve eigenvalues) and liberal(-ve eigenvalues) eigenvectors % Then we calculate the number of eigenvectors (k) that can give us 80%, 90% and 95% variance explained % Do this for all subjects then find group-level average number of k for 80%, 90% and 95...
b384b9d2e082344145ed50ef713c6c341a10c61551d94c6b9f26d8fe29945c65
MATLAB
3,375
106
% This is an example of how to draw learning curves % 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 version...
18db6820d3ba811697f71511350351c8d8aa29655a9495757a752a21742f47a7
MATLAB
3,379
89
%%% script for plotting spectrograms of the cricket chirping (audio signal) %%% and the firefly flashing (video) from our field recordings % File to analyze: InputVideo = 'cricket_and_firefly_video.mp4'; firefly_data_file = 'firefly_flash_matrix.csv'; % Load info about frames per second (FPS) etc from vide...
a02c28df2c009a6a934a289c3f4ce48fbc0bbaec16591a8ad39a550c38aab3de
MATLAB
3,383
53
function [act, WBLCOX ] = nk_WBLCOX_config(NM, WBLCOX, defaultsfl) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = false; end if ~defaultsfl if ~isfield(WBLCOX,'interval'), WBLCOX.interval = median(NM.time); end if ~isfield(WBLCOX,'MaxIter'), WBLCOX.MaxIter = 10000; end ...
b8f8315a04ebf8b00ad6ca63f29f34e6251f03a22d88dd9b5d03410a2fc807f1
MATLAB
3,383
88
clear %% load PreProcessed file load('PreProcessed_peakMag.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 Odors_New = ["1","2","...
2c9a908fe8e455e90dd7985d524129b2e54dfa5424026e59261ea4bd3bb8fa65
MATLAB
3,385
86
function sigArray = periEventSigArray(sig,behEvtTbl,fps) % This functions organizes ca signals into a periEvent array % Inputs: % sig: calcium signal matrix: nFrame x nCell % behEvtTbl: behavior event table: nEvent x nFeature % fps: calcium signal frame rate per second % Outputs: % sigArray:...
0bee1820134b9b4f7f674c94ad5c98d590e325abee56de2d5bf36ed531b3ba45
MATLAB
3,395
94
function [A,Y,numIter,tElapsed,finalResidual]=nmfnnls(X,k,option) % NMF based on NNLS: X=AY, s.t. X,A,Y>=0. % Definition: % [A,Y,numIter,tElapsed,finalResidual]=nmfnnls(X,k) % [A,Y,numIter,tElapsed,finalResidual]=nmfnnls(X,k,option) % X: non-negative matrix, dataset to factorize, each column is a sample, and ea...
94c9a608b5bb63c60c458181e362780a29f85322bf9f70875ae0367e05f350d2
MATLAB
3,397
104
function mappedX = ltsa(X, no_dims, k, eig_impl) %LTSA Runs the local tangent space alignment algorithm % % mappedX = ltsa(X, no_dims, k, eig_impl) % % The function runs the local tangent space alignment algorithm on dataset % X, reducing the data to dimensionality d. The number of neighbors is % specified by k. % % ...
b9d79ebb54adea7757e5ba3b558b0069d45216e9b6da57556f6014476da97171
MATLAB
3,398
91
function [OpenedFileName, Version, Freq, Comment, Trodalness, NPW, PreTresh, SpikePeakV, SpikeADResBits, SlowPeakV, SlowADResBits, Duration, DateTime] = plx_information(filename) % plx_information(filename) -- read extended header infromation from a .plx or .pl2 file % % [OpenedFileName, Version, Freq, Comment, Trodal...
b4200a06c737f83982e21583d1d609cbd0618789e7ae400a9fac0098c44ad478
MATLAB
3,400
63
function [GridParam, modeflag] = nk_EvalFunc_config(res, param, parentstr, modeflag) global EXPERT if ~exist('modeflag', 'var') || isempty(modeflag), modeflag = res.modeflag; end deffunc = 1; if exist('param','var') && ~isempty(param) if isfield(param,'evalfunc') deffunc = param.evalfunc; elseif isfi...
25a8ef604557d0832a3c9ac8a5ef00c47957057616cbb5473665d512a7c7bc17
MATLAB
3,405
84
function [param, act] = nk_DiscSym_config(param, parentstr) dscBinStart = 0; dscBinStep = 0.5; dscBinStop = 4; symMinBin = 3; symMaxBin = 25; symSeqLength = 4; symStdNum = 3; cmd = 'discretize'; methods = {'discretize', 'symbolize'}; if isfield(param,'DISCRET') &...
c9d665b517fa1652c34dd068c0cd3475ceff741be795da65a481531c7fbf57b4
MATLAB
3,406
106
function joinActivity(path,order,flag) % Function to join the raw trace and the calculated activity of each cell % across all the sessions concatenated.This function is part of the % pipeline ConcatMiniscope. % % INPUTS: % path: path of the folder containing the dataset to be treated. Outputs % will be loaded from ...
9a46b25fb1f68550e022d09bbf121b3df8d22b2d1172f10a1e5bdf47f1e8e023
MATLAB
3,411
109
% ======================================================================== %> @brief [WIP] staircaseManager links a taskSequence to Palamedes staircase %> %> Use a taskSequence to randomise a variable, then for each value of %> that variable, run a Palamedes staricase %> %> %> Copyright ©2014-2022 Ian Max Andolina — r...
27c243d88df7c854dfd02d8d9a8d08eef8aebf6879703ebbd79ff6db3c57e993
MATLAB
3,419
95
function OUT = DetrendFoldPerm(IN, OUT) global SVM MODEFL EVALFUNC if isfield(SVM,'Post') && isfield(SVM.Post,'Detrend') && SVM.Post.Detrend OUT.detrend.flag = true; else OUT.detrend.flag = false; end if OUT.detrend.flag PermVec = 1:IN.nperms; FoldVec = 1:IN.nfolds; ClassVec = 1:IN.nclass; ...
1b0fda0fce224d30fb18c714f593e222c07d810d9d5a8d656271b88690e9582a
MATLAB
3,429
153
function regresdiagplot3d(sdist,odist,rdist,cutoffsd,cutoffod,cutoffrd,k,class,multi,labsd,labod,labresd,labels) %REGRESDIAGPLOT3D is a 3D-outlier map which visualizes the orthogonal distance, % the score distance and the residual distance calculated in a PCR or PLSR analysis. % % I/O: regresdiagplot3D(sdist,odist,rd...
1d7d722f81558b01f9e87ce4f9be2c337166a0713776ac055f257a708119ea17
MATLAB
3,436
80
function [ act, PLS, PX ] = nk_PLS_config(NM, PLS, PX, defaultsfl, parentstr) algostr = 'pls'; UseLabel = true; V = nk_MakeDummyVariables(NM.label); cu = 1; cv = 1; act=0; if ~defaultsfl if isempty(PLS), [~, PLS ] = nk_PLS_config(NM, [], [], true); end algostr = PLS.algostr; cu = PLS.cu; cv = PLS...
a3e7de5434ad0b356210c1f35a6a1c095926ce93b1868e452a2a68060934d67f
MATLAB
3,441
108
%%% plotting arnold tongues for our system clear; colormap default; Nneurons = 6; % group size NumSeeds = 2; % number of random seeds to average over % making one neuron the driver of the system, with different frequencies omegas omega_0 = 2; % Hz NumOmegas = 71; %71 % number of detunings to explore (between freq ...
0d0c905dabaef8a7eb6ccbd1ee6842b5fd879965f64e64a3999a99e59a315e42
MATLAB
3,444
87
function [key qflag] = kbhit(cmd) % Returns the last key pressed in the command window % % kbhit('init') : initialise listening % key = kbhit : last character typed % key = kbhit('struct'): struct for last character typed (including ctrl, % shift, alt and ascii code information) %...
38ee4bf0745908dc995a5bfea8673d62e8dfad5ed233b0ccbd686eb85ae48e3a
MATLAB
3,447
64
function [ LABELIMPUTE, act ] = nk_LabelImpute_config(LABELIMPUTE, parentstr, defaultsfl) IMPUTEDEF_K = 7; IMPUTEDEF_METH = 'none' ; if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if isfield(LABELIMPUTE,'method'), IMPUTEDEF_METH = LABELIMPUTE.method; end...
30afd7e04439b0cf0dc92b67c2a2068fb3d573af0ebb99f9bdfe9a4be3ed500c
MATLAB
3,451
73
function [W_ACT, PX] = nk_WAction_config(W_ACT, PX, datadesc, brainmask, defaultsfl, parentstr) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl = 0; end softflag = 1; threshvec = [25 50 75]; absvec = [ 0.25 0.50 0.75 ]; clustfl = 2; exppar =...
72b0c2496418bb595436dbdc0abef2c5bcbaa5155d93f1f85d7695e35f602fa9
MATLAB
3,455
103
function [mappedX, mapping] = em_pca(X, no_dims, max_iter) %EMPCA Run an EM-based implementation of (probabilistic) PCA % % [mappedX, mapping] = em_pca(X, no_dims) % % Performs probabilistic PCA on dataset X in order to reduce its % dimensionality to no_dims. The dimensionality reduction is performed by % means of an...
158dcc6449e3c600968666601289a92f7d886b4d2bf477953a8bd92ca3f6dbdb
MATLAB
3,456
92
function weights = RGS(X_train, Y_train, extra_param) % weights = RGS(X_train, Y_train, extra_param); % % Implementation of RGS 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...
dc55d72fba19bcf06f1378ca6eb651ba389f4b8ff55937f132cf863c6acfe448
MATLAB
3,462
88
function [t, wv] = LoadTT_openephys(fn,records_to_get,record_units) %LOADTT_OPENEPHYS MClust loading engine for open ephys data. % LOADTT_OPENEPHYS loads open ephys data and fullfils all requirement for % MClust loading engines (see MClust 3.5 documentation for details on % MClust loading engines). % % Syntax...
7c2982f81ae69004a8d46a9acc68bbd841a0a02caeb06890974654ff63cfcedf
MATLAB
3,466
96
classdef spatial_express_superphase < 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...
d31edd21271236cd96db7a02a7835c6f7d180b65c77c8538c4c388126f9d76b9
MATLAB
3,466
126
classdef ListboxPair % A pair of listboxes, when an entry is selected it is moved from one % box to the other. (Typically used as a set of "available" and "use" % boxes. properties(Constant) leftTitlePosition = [0.05 0.85 0.4 0.1]; leftBoxPosition = [0.05 0.05 0.4 0.80]; rightTitlePosition = [0.55 0.85...
d7f50fd292459088316823e243a3442368a15e6d7e2d2aa249bbffa140956601
MATLAB
3,471
126
% ======================================================================== classdef joystickManager < optickaCore %> @class joystickManager %> @brief Manages the Simia Joystick %> %> Copyright ©2014-2023 Ian Max Andolina — released: LGPL3, see LIv12345c12345CENCE.md % ===================================================...
27ca8a49c9d53cc8f31e42f43f3e65a8250d4fb07efb96631f366340d305c997
MATLAB
3,473
107
function [R,eff] = randmio_und_connected(R, ITER) %RANDMIO_UND_CONNECTED Random graph with preserved degree distribution % % R = randmio_und_connected(W,ITER); % [R eff] = randmio_und_connected(W, ITER); % % This function randomizes an undirected network, while preserving the % degree distribution. The func...
8a7c8dd33b9706ee99ea313b520a50fdb61afb6f72bdc20920ca0767fa3c43e9
MATLAB
3,475
120
function [eigvector, eigvalue, elapse, Y] = KPCA(options, data, ReducedDim) %KPCA Kernel Principal Component Analysis % % Usage: % [eigvector, eigvalue] = KPCA(options, data, ReducedDim) % [eigvector, eigvalue] = KPCA(options, data) % % Input: % options - Struct value in Matlab. T...
1e65017d445dc11434a35ec32a366872344cafa1827c2c24b946da41dfe2d5f9
MATLAB
3,478
104
function [w_Brain, model_All] = W_Calculate_SVR_PCA(Subjects_Data, Subjects_Scores, Pre_Method, C_Parameter, Netnum,Netfea,Voxelfea,Indicatorfea,Reduction_Method,randNet,ResultantFolder) % % Subject_Data: % m*n matrix % m is the number of subjects % n is the number of features % % Subject_...
9e924fd0297cc26cc02af0f6c5d1bf63ecb49eebf02f86be88d532a31adbee25
MATLAB
3,479
90
%% ================================================================ % Script: behavior_prediction_neonatal_FOCA_GLM.m % Purpose: % Test whether neonatal internetwork covariance (FOCA matrix) % predicts 18-month developmental outcomes (Bayley-III: Cognitive, % Language, Motor). % % Description: % - Each ...
01cfb38239a986fbffe0108139c4ce61d99d36e4c98ca10a77563a2ab0b8abc0
MATLAB
3,480
107
function jzmqBatchServer(cfg) %> jzmqBatchServer — headless ØMQ server driven by JzmqCrossProcessTest. %> %> Runs in a secondary MATLAB instance (`matlab -batch`) and executes %> three sequential phases, each controlled by handshake files created %> inside cfg.tmpDir by the test process: %> %> 1. REP echo server boun...
77fb72f15448b9fc7a7a2ffedf8b6937798d9b3ca18692682e18e641703bb153
MATLAB
3,485
92
function nk_OOCV_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 % ==========================================...
0b6806cff2aa83f9fad3f1951d2e91ed712e1a6eeba1a7bc3d4979f82002cb79
MATLAB
3,486
114
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"...