sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
c0f88b28cd4ed100ebf42672967bfe7b3e6bf29dcad23f4d6b770daa4bcca78f
MATLAB
8,190
227
% ======================================================================== %> @class stateNode %> @brief a single hierarchical state node (handle) for stateMachineTree. %> %> stateNode is a handle class representing one state in a hierarchical %> state machine tree. Each node has a `parent` (another stateNode, or [] %>...
f08ed9b8c5481c4407b8cc7166de67fd1b93ba4be764f97d0d446376168daf83
MATLAB
8,207
238
function respsort_partitions_PD(pdcells,alignevent,partition, twinds, resdir, issave,excl_beforeEv) %RESPSORT_PARTITIONS_PD Tests activation/ inhibition predicting the behavioral outcome % RESPSORT_PARTITIONS_PD(pdcells,alignevent,partition, twinds, resdir, issave) % -Plots PSTHs and raster plots of partition...
07015d25c7d61321fc8ceaefdd8ea4f738345077e32ab0c964f2c6468b04485e
MATLAB
8,237
301
%% FUNCTION Logistic_TGL % Temporal Group Lasso Progression Model with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * \|W\|_2^2 + rho2 * \|W*R\|_2^2 + % + rho3 * \|W\|_{2,1} } % %% R encodes smooth relati...
aaf48ac515b794da1791fee6c107083ad371e17001bbd1fc75eb2029022b4759
MATLAB
8,240
160
function [ IMPUTE, act ] = nk_Impute_config(NM, IMPUTE, varind, parentstr, defaultsfl) IMPUTEDEF_K = 7; IMPUTEDEF_METH = 'euclidean' ; IMPUTEDEF_BLOCK = []; if ~exist('varind','var') || isempty(varind), varind=1; end IMPUTEDEF_HYBMETH1 = 'jaccard'; IMPUTEDEF_HYBMETH2 = 'euclidean'; IMPUTEDEF_HYBTHRESH = 3; if ~exist...
0f047d809bf06b62096c5ccb1469b823a57fc42b95a69d7f91626bf3de9dcc99
MATLAB
8,245
299
%% FUNCTION Logistic_CFGLasso % Fused Group Lasso Progression Model with Logistic Loss. % %% OBJECTIVE % argmin_{W,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}'*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * \|W\|_1 + rho2 * \|W*R\|_1 + % + rho3 * \|W\|_{2,1} } % where: % rho1: sparse....
6ccf74c1b65fc77ac2723e3a2d02696388a99947063faeb4bd8be83097eb60bb
MATLAB
8,253
236
function [model,OtherOutput]=classificationTrain(trainSet,trainClass,method,option) % Learn a classification model specified by "method" % Usage: % [model,OtherOutput]=classificationTrain(trainSet,trainClass,method) % [model,OtherOutput]=classificationTrain(trainSet,trainClass,method,option) % trainSet, matrix, the tra...
c79a2430a3f9c2d9d65e5bdece392ac7e1e48857c86cf3d700b048703187ff3c
MATLAB
8,254
156
function [X, fX, i] = minimize(X, f, length, P1, P2, P3, P4, P5, P6); % Minimize a continuous differentialble multivariate function. Starting point % is given by "X" (D by 1), and the function named in the string "f", must % return a function value and a vector of partial derivatives. The Polack- % Ribiere flavour of ...
0585382acef560d9e016b4e6db1f1a4b145f10d4ad8b0f63ea3dc20fc3520727
MATLAB
8,268
181
function [W0,R] = null_model_und_sign(W,bin_swaps,wei_freq) %NULL_MODEL_UND_SIGN Random graphs with preserved weight, degree and % strength distributions % % W0 = null_model_und_sign(W); % W0 = null_model_und_sign(W,bin_swaps); % W0 = null_model_und_sign(W,bin_swaps,wei_freq); % [W0 R...
7cba13056336c963865b1f3ee4a06ec8c5fb3501af38af3d69649e12092da503
MATLAB
8,301
203
function prep = sst_prepare_for_jags(csvFile) x = readtable(csvFile); req = ["subject","eventname","task","site","date", ... "sst_run","sst_primaryresp","sst_stimfile","sst_expcon", ... "sst_primaryrt","sst_ssd_dur","sst_choiceacc","sst_inhibitacc"]; miss = setdiff(req, string(x.Prope...
d653976f3c3f4dd1664ba238d8561edbef52a6c0e09bf9af5d4baa564e3c9d17
MATLAB
8,305
260
%% 0. Setup % Initialization % clear; close all; clc; % Add folder with raw data to path addpath('/Users/justintorok/Documents/MATLAB/eNDM/raw_data_mouse') % Add library with eNDM functions to path addpath('/Users/justintorok/Documents/MATLAB/eNDM/lib_eNDM_general') % addpath('C:/Users/chait/Documents/NOTES/CHAI/U...
68cbed16b45c9365266a8f577aa2946f9d1bbaa34b1003a34176f0eb1d86ae02
MATLAB
8,311
132
% CAT12 for Aging dataset % CL Septembre 2020, landelle.caroline@gmail.com // caroline.landelle@mcgill.ca % Toolbox required: Matlab, SPM, CAT12 Toolbox % Cat12: http://www.neuro.uni-jena.de/cat/ % Segmentation CAT12 /!\ expert mode: cat.extopts.expertgui to 1 in cat_defaults.m line 282 % Inputs:------------------...
a0b5b2a37ab5cfdadb44ef12aff5ce0b8d1f29255b9b0d637345a2c1e088e777
MATLAB
8,357
258
%% 0. Setup % Initialization clear; close all; clc; % Add folder with raw data to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/raw_data_mouse') % Add library with eNDM functions to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/l...
30f4ab75816d583476c512a8e5763167867947dca920b35cb06a671c04ed9d5a
MATLAB
8,387
243
%% mRVM2 % authors: Ioannis Psorakis psorakis@gmail.com, Theodoros Damoulas % theo@dcs.gla.ac.uk % Copyright NCR, 2009 % % Use of this code is subject to the Terms and Conditions of the Research License Agreement, % agreed to when this code was downloaded, and a copy of which is available at % http://www.dc...
e4b7b02a9934737081f8c55edf37800d48a79090e90de36d8d6a4b119de1b60d
MATLAB
8,398
267
function [c, s, b, g, smin, active_set] = thresholded_oasisAR1(y, g, sn, optimize_b,... optimize_g, decimate, maxIter, thresh_factor, p_noise) %% Infer the most likely discretized spike train underlying an AR(1) fluorescence trace % Solves the sparse non-negative deconvolution problem % min 1/2|c-y|^2 subject to ...
3fc4ccf6c74dca162c56e514657dd292cd882d5f0a28ac0b55092914cc84a145
MATLAB
8,413
264
%% 0. Setup % Initialization clear; close all; clc; % Add folder with raw data to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/raw_data_mouse') % Add library with eNDM functions to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/l...
ececf37b32db9370de01391154a992954cfc8f35f2c8f85395aefdb48bf2941a
MATLAB
8,414
330
function image_resized = resize_image_JuSpace(image_to_resize,image_for_size) Vi = {image_for_size;image_to_resize}; Vo = image_for_size; f = 'i2'; flags.dmtx = 0; flags.mask = 0; flags.interp = 0; flags.dtype = 4; if ~isstruct(Vi), Vi = spm_vol(char(Vi)); end %% part spm_imcalc if isfield(flags,'dmtx'), dmtx ...
6a8d5fbca09db2f7bae011d316c8bbd458e4a58dd6aac5a259986bb26a240cde
MATLAB
8,421
252
function spike_triggered_average_PD(sess2analyse,chanmean,frnm,freq,save_window,plot_window,EventTypes) %SPIKE_TRIGGERED_AVERAGE_PD Spike-triggered average % SPIKE_TRIGGERED_AVERAGE_PD(sess2analyse,chanmean,freq,save_window,plot_window,EventTypes) % -Saves spike-triggered LFP epochs for sessions specified in...
3caec260049f4379e48472485f6daeac1a638e3c601f00d5d662753194eaf3db
MATLAB
8,435
189
function eps2pdf(source, dest, crop, append, gray, quality, gs_options) %EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, dest, crop...
79c313b0264e4a1c6519645c133018f4454a29141eec93184123236b99d3caf7
MATLAB
8,447
203
clear all close all setup_paths; kk=0; for monkey=2 if monkey==1 monkey_name='Jupiter'; elseif monkey==2 monkey_name='Mercury'; end nn=0; [num,txt,session_name]=xlsread('Session_name.xlsx',monkey_name); filename_marker=[monkey_name,'_stage2_nonprimate_marker_organized.xlsx'...
9f0c4c3c9be6809755bfe242cbb6a76fdc40ebff17bc25f1c66b016ff12d6acb
MATLAB
8,463
83
set(0,'DefaultFigureWindowStyle','Docked') %close all hidden; close all; clear; clc tic %start a timer to see how long the algorithm runs %This script loads a .plx file, makes rasters from the plx, makes correlograms from the rasters, then analyzes data from the rasters and correlograms %Key metrics are plo...
95ef8cf779dbbe6b633cb7e05577ab5a1fcc41654486bbac856c97807d7e6968
MATLAB
8,494
233
% ========================================================================= % FORMAT [adapthresh, Crit, mx] = nk_AdaptiveThreshold2(Y, labels, V, adap, % Ynew, labelnew) % ========================================================================= % Determine adaptively the best threshold to extract features from Y, % b...
ec5dbf2ffd9bb6205f62cca1bbf21da4db28db67326c7d1748631380b6505ddd
MATLAB
8,504
210
function IN = nk_PerfFeatRankObj(oY, IN) % ========================================================================= % FORMAT function IN = nk_PerfFeatRankObj(Y, IN) % ========================================================================= % Takes input matrix Y and ranks its features according to their relevance % ...
2ed28fbcf55455d2fec5e59cf2e8cbafd83ed295c0a837e65953c458ec4d2b09
MATLAB
8,517
236
function result = pam(x,kclus,vtype,stdize,metric,plots) %PAM is the Partitioning Around Medoids clustering algorithm. % It returns a list representing a clustering of the data into kclus % clusters based on the search for kclus representative objects or medoids among the observations of % the data set. % % The algori...
b0ce1fac81f68e4bc15cbec66f95bc3ff624f76dcc40e33ba13d9ece5179d05c
MATLAB
8,529
311
%% FUNCTION Logistic_CMTL % Convex-relaxed Clustered Multi-Task Learning with Logistic Loss. % %% OBJECTIVE % argmin_{W,M,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * eta (1+eta) trace(W (eta I + M)^-1 W') % subject to: trace (M) = k, M \preceq I, M \...
017f6f9ea2ab746a928f17e6056e0bbace13ffd7c4de0d6b99eec73116c2acbf
MATLAB
8,561
293
function [mappedX, mapping] = lmvu(X, no_dims, K, LL) %LMVU Performs Landmark MVU on dataset X % % [mappedX, mapping] = lmvu(X, no_dims, k1, k2) % % The function performs Landmark MVU on the DxN dataset X. The value of k1 % represents the number of nearest neighbors that is employed in the MVU % constraints. The val...
5a8eaf75126c95bb53601b73ab761c742fc58878e16879ec6d46bbf3490ac813
MATLAB
8,569
228
function [ ALTLAB, act ] = cv_Label_config(ALTLAB, defaultsfl) global NM altlabflag = 0; newlabel = 'no label defined'; newlabelname = 'no name defined'; newmode = 'no new mode defined'; newgroupnames = []; if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end if ~defaultsfl if isfield(A...
632978466f4bd54f8da64c39ebf462ca27090d2c318986ee001b53f5d9996dea
MATLAB
8,612
317
%% FUNCTION Logistic_CASO % Convex-relaxed Alternating Structure Optimization with Logistic Loss. % %% OBJECTIVE % argmin_{W,M,C} { sum_i^t (- sum(log (1./ (1+ exp(-X{i}*W(:, i) - Y{i} .* C(i)))))/length(Y{i})) % + rho1 * eta (1+eta) trace(W' (eta I + M)^-1 W) % subject to: trace (M) = k, M \preceq I...
41f5a81000c2cf34b80cf9920a4dbac95a15772780bce494ef13c6db3489215f
MATLAB
8,639
357
% ------------------------------------------------------------------------- % Function: out=preprocessing(X,method) % ------------------------------------------------------------------------- % Aim: % Data preprocessing % ------------------------------------------------------------------------ % Input: % X, matrix (n...
4f3e3b68696a7f2be718b64bda5f5a4cc7f085cbe40eb022d56db39d0bec9ea3
MATLAB
8,675
251
% ======================================================================== %> @class JzmqCrossProcessTest %> @brief Cross-process ØMQ tests using a secondary MATLAB instance. %> %> Spawns a detached headless MATLAB (`matlab -batch`, optionally under %> xvfb-run) running jzmqBatchServer as an independent ØMQ peer, then ...
d65216c9ba73df935617ce52876e933002771e7e4197e8928a2891d43e396b20
MATLAB
8,714
189
clear all; close all; fclose all; dbclear all; %================================================================= % environment setting %================================================================= %addpath /proj/weitangc/users/weitangc/matlab_lib/ice_master_vd13; addpath(genpath('/proj/weitangc/users/weit...
aec1a7087e9c8abdca1dfb6fa5963fb78f4065970f9446bf4cc8cc44bd682056
MATLAB
8,765
189
function [count] = countconnected5graphlets(A, L) % Count all 5-node connected subgraphs in an undirected graph % without node labels and with unweighted edges % Author: Nino Shervashidze - nino.shervashidze@tuebingen.mpg.de % Copyright 2012 Nino Shervashidze % % Input: A - nxn adjacency matrix % L - 1xn cell array ...
70b5590eb2ff2dc35812069b44b6534afba85eada5da77f1b48e9fd3c45e4e2f
MATLAB
8,773
154
function [ pl2 ] = PL2ReadFileIndex( filename ) % PL2ReadFileIndex( filename ): reads pl2 file index. % Displays error if the file does not exist. % This function is not called directly by PL2* functions. % Use PL2GetFileIndex(filename) instead. % PL2GetFileIndex caches file indexes so it works f...
446c3547f76b9a4eb0551b18eba092bcb0ee4ae51ae26730200da87d883af6b6
MATLAB
8,784
243
function varargout = subsref(opt,subs) % Subscript referencing % % Fields are: % dat - a file-array representing the image data % mat0 - a 9-parameter affine transform (from qform0) % Note that the mapping is from voxels (where the first % is considered to be at [1,1,1], to m...
d4f81d5cb7801140406b4f92c57e4204a80b6f43469168eeb93b9ee9057e670a
MATLAB
8,837
188
function [W0, R] = null_model_dir_sign(W,bin_swaps,wei_freq) %NULL_MODEL_DIR_SIGN Directed random graphs with preserved weight, % degree and strength distributions % % W0 = null_model_dir_sign(W); % W0 = null_model_dir_sign(W,bin_swaps); % W0 = null_model_dir_sign(W,bin_swaps,wei_freq);...
977369979a7fe21beedf50a0b9159ec749ab6f6d97256426b32f829e4b4d0008
MATLAB
8,849
200
function cv_ExportModels(inp) % ========================================================================= % FORMAT Results = cv_ExportModels(inp) % ========================================================================= % The export module saves optimally trained model and preprocessing structures % for each CV2 par...
4da1ef75c9deedd32d403211ce40bfa2eb375ad888c8c1f93976ab6cfbd57e9f
MATLAB
8,870
189
function [early, respt, early2, respt2, situation, ARD_time, ARD_time2,... STOP_ARD, STOP_MTL, stopTime, MTL_time, MTL_time2] = stop_signal(duration, win, stopdelay, S_time, red, serial, CUE_ARD) %STOP_SIGNAL % [EARLY, RESPT, EARLY2, RESPT2, SITUATION] = STOP_SIGNAL(DURATION, WIN, STOPDELAY, S_TIME, RED) % ...
96b9ef0b7c8a1e2a5d2223fac9d8eee5e6eb0a304282d27ef8edb844b80def31
MATLAB
8,883
222
%> HSMTEST state configuration file for runExperiment.runTask — a %> hierarchical (nested) version of DefaultStateInfo.m demonstrating %> parent/child states via the `parent` column. %> %> Hierarchy: %> %> trial (parent) one entry/exit per trial %> ├── fixate acquire fixation (inFixFcn -> ...
21a843904fafefd7fc330a23fa1ca2dc5f37450d980694deb96006ebd1385ba8
MATLAB
8,893
280
function practice_face_new (subject, window, screenNumber,width, height, session, pth, p1, p2, p3, ind, Practice_Matrix, Index_Matrix,h) % check for Opengl compatibility, abort otherwise: AssertOpenGL; KbName('UnifyKeyNames'); KbCheck; %escape = KbName('ESCAPE'); responseKey = 1; % X mouse button % load ...
b83ff3762e550133f815750636a701efc16493292f654a4a9dd4e8771e320d84
MATLAB
8,896
217
% ======================================================================== %> @class GratingStimulusTest %> @brief Class-based unit tests for gratingStimulus. %> %> Tests construction, property defaults, type list validation, contrast %> clamping, colour handling, and phase/TF/SF properties. CI-safe tests %> run withou...
c362e59f67f080c94b841e54e400c781ed07b9bfc8eee2f586a7593d70bcaad4
MATLAB
8,898
205
%component maps, dipoles and power spectra in a cluster (only one subject in a plot) %run after finishing running DR_PlotCompPowerDipole %% set parameters (initialize) clear all; try close(4001); %dipole (final) end try close(4002); %dipole (tmp) end try close(4003); %component map end try cl...
ecb005816f6c59d8c4a2021e9b33a8b31f993985c1b50e1043561fd9bbb5efcb
MATLAB
8,962
268
%DUMPMSGPACK dumps Matlab data structures as a msgpack data % DUMPMSGPACK(DATA) % recursively walks through DATA and creates a msgpack byte buffer from it. % - strings are converted to strings % - scalars are converted to numbers % - logicals are converted to `true` and `false` % - arrays are converted t...
4af4df304e14804c3deeeb8943bdf9c8540ed83dc4abadd8b63ee1f0166e3cc4
MATLAB
8,968
203
function [Emtx_all Emtx_perch] = gen_mb3d_encodemtx_i2k(sentiv_map, flag_ref, pae_idx, grp_idx, fe_idx, header, varargin) %function [Emtx_all Emtx_perch] = gen_mb3d_encodemtx_i2k(sentiv_map, flag_ref, pae_idx, grp_idx, fe_idx, header, varargin) % % Wei-Tang Chang, UNC-Chapel Hill % May 28, 2019 % % Usage : generate...
110543c6afd331046aff21c8fe105018c995aebbfee1b402721109bb50a1461a
MATLAB
8,993
227
function [VIS, act] = nk_Vis_config(VIS, PREPROC, M, defaultsfl, parentstr) global NM EXPERT if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl=0; end if ~exist('M','var') || isempty(M), M=1; end thresh = 0; fwhm = []; flgProj = false; PERM = struct('flag',0,'nperms',1000,'sigflag',0,'sigPthresh',0.05, ...
12f55c153a69dc418b1be532f4d55ba893ab07352a2cdaaa0b1a1f10b7226d2e
MATLAB
8,993
241
function no_dims = intrinsic_dim(X, method) %INTRINSIC_DIM Eestimate the intrinsic dimensionality of dataset X % % no_dims = intrinsic_dim(X, method) % % Performs an estimation of the intrinsic dimensionality of dataset X based % on the method specified by method. Possible values for method are 'CorrDim' % (based on...
1d83ec20881144f6ad3839ccc0ea00bcd4a805eae3d67c0a18713e37fa516241
MATLAB
9,049
280
function [Matching,Cost] = Hungarian(Perf) % % [MATCHING,COST] = Hungarian_New(WEIGHTS) % % A function for finding a minimum edge weight matching given a MxN Edge % weight matrix WEIGHTS using the Hungarian Algorithm. % % An edge weight of Inf indicates that the pair of vertices given by its % position have no adjacen...
056b776268343336a8e32c713d66e6bca762336e53d9ae54be64221515871b7e
MATLAB
9,058
204
function summarytable = Output2Table(outputs,writeout,filename,filepath) fldnames = fieldnames(outputs); if nargin < 4 filepath = cd; if nargin < 3 datestr = date; if ~ismember('endm',fldnames) filename = ['summary_Nexis_mouse_' outputs.ndm.Full.init.study... '_globa...
4ae5fe18eada967afbe89d3e0f9f644ee5659d22954e437098e1dd15183924f4
MATLAB
9,079
237
% ======================================================================== %> @class MetaStimulusTest %> @brief Class-based unit tests for metaStimulus. %> %> Tests construction, stimulus management (add/show/hide/showSet), %> cell indexing, n/nMask dependent properties, mask handling, %> stimulusSets, edit, and reset....
985cbcf2a05f60311e614c87624444fa0269eb0a6be5b5d0b823ae36ff8776da
MATLAB
9,079
237
function [sY, IN, dT] = nk_PerfAdjForCovarsUsingPCAObj(Y, IN, S) % ========================================================================= % function [adjT, IN] = nk_PerfAdjForCovarsUsingPCAObj(T, IN, S) % ========================================================================= % ----- INPUTS ----- % Y : ...
e397b421f2562f6ef2d149d3f5dad413db409ddfad091399ecb3ba1479a05d32
MATLAB
9,085
196
function [ act, param ] = nk_GreedySearch_config(param, SVM, MULTI, defaultsfl, parentstr) % Minimum # of features GreedySearch.Direction = 1; GreedySearch.EarlyStop.Thresh = 50; % Early stopping criterion GreedySearch.EarlyStop.Perc = 1; % Early stopping mode = percentage GreedySearch.WeightSor...
062b146a03304ff21e61a16e89d95557b69e4ad9fa4759837648c41529550b48
MATLAB
9,094
250
classdef KKwikCutter < MClust.Cutter % % Select clusters from those generated by KKwik % % Version control: ADR-2013-12-12 properties figHandle_AvgWV = []; figHandle_ISI = []; whoHasFocus = []; whoHasComparison = []; nextClusterButton = []; ...
4a66e07564a5a126f7b4f6e880fe66aa7ade3c649ef8db83742faaee5e1d6bc4
MATLAB
9,138
122
function opts = palm_defaults % Set up PALM defaults. % % _____________________________________ % Anderson M. Winkler % FMRIB / University of Oxford % Oct/2014 % http://brainder.org % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % PALM -- Permutation Analysis of Linear Models % Copyright (C...
9644a13b00d00fbe47aabf0670cc6cd7944e8fb8692d27f2f6561345382c00c6
MATLAB
9,156
319
classdef parseOpxSpikes < handle %parseOpxSpikes Summary of this class goes here % Detailed explanation goes here properties stimulus end properties (SetAccess = private, GetAccess = public) sValues %stimulus list sMap %stimulus index sIndex %stimulus number sent to be strobed. trialTime thisRun = ...
854ff715c09ce3c57a30641d5e0fe08b6b5eff64128cb542c150340b7ec99095
MATLAB
9,166
294
function wcoh_map_RT %WCOH_MAP_RT Correlation map between reaction time and wavelet coherence map % WCOH_MAP_RT calculates trial-by-trial correlation (Pearson's correlation) % between reaction time and wavelet coherence map of each patient. % Significant correlation tested by TTEST on the level of individu...
f7914fa2ce5cf02387d5b32097785fff2f84136351914d6caa23e2837d7d2785
MATLAB
9,186
235
function PC_pie(event,plot_win,fr_name,downsamp,PC_win,alpha,rectype,chanmean,subregion,PCdir,groups) %PC_PIE Pie chart of significantly phase-coupled units % PC_PIE(event,plot_win,fr_name,downsamp,PC_win,alpha,rectype,chanmean,subregion,PCdir) % draws a pie chart respresenting the percentage of significantly % ...
308953e28a74830b092a62937f7c408cf9644427eb6a75b2caab62419097afa5
MATLAB
9,219
269
function varargout = splash(varargin) %SPLASH Creates a splash screen. % SPLASH(FILENAME,FMT,TIME) creates a splash screen using the image from the % file specified by the string FILENAME, where the string FMT specifies % the format of the file and TIME is the duration time of the splash % screen in millisecon...
3d7859fe859ae18b2b0486ec436bf13c99a5b796ff1a3d445a47c7566363f8f7
MATLAB
9,232
190
function CreateMainWindow(self, MCS, MCD) % MClustMainWindowClass : CreateMainWindow % self.MClustMainFigureHandle = figure(... 'Name','MClust', ... 'NumberTitle','off', ... 'Tag','MClustMainWindow', ..., 'Resize', 'Off', ... 'Units', 'Normalized', ... 'HandleVisibility', 'Callback', ... '...
f129ef37e4e9cdeeb32f6db2762bab147c99f3f0ad503ad220949d59f2680260
MATLAB
9,263
143
function runFaceNew() % to experimental trials via face_exp_new(...), to practice session via practice_face_new(...) sca; close all; clearvars; if strcmp(computer,'PCWIN') warning off MATLAB:DeprecatedLogicalAPI; end % check for Opengl compatibility, abort otherwise: AssertOpenGL; h = IOPort('O...
775fe310d63e2c1663f8c9ddedf4b231b4de985e855d3544f7f87291934917ae
MATLAB
9,283
289
%% analyze_TTS_3R3X.m % Analyze 3R3X TTS data and reproduce SBM-style scaling plots and table. clear; clc; %% Parameters scale_factor = 1e-8; % iterations -> seconds quantiles_q = [0.25, 0.50, 0.75]; % If you want to restrict which sizes N to use in the fit, set these indices. fitIdx_for_all_q = []; %...
ecc3d0caee11666f287632b7e160e8b7d31a19c1e6a990431d401aedc06d7b2c
MATLAB
9,287
173
function [act, param] = nk_Filter_config(act, param, SVM, MODEFL, MULTI, defaultsfl, parentstr) global NM % % Defaults: % --------- Filter.flag = 0; % Activate feature filtering Filter.MinNum = 1; % Minimum # of features % Default ranking method switch MODEFL case 'classification' Fil...
bfed4082769282be9003e11c44c59713250bd99cd2b25ad6c56804bd403cc95c
MATLAB
9,318
305
function beta = lars(X, y, method, stop, useGram, Gram, Cardi, trace) % This function is provided at % http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=3897 % I have made some small modifications -- Deng Cai, Feb/2008 % LARS The LARS algorithm for performing LAR or LASSO. % BETA = LARS(X, Y) performs...
b8f9553b08461993b21a83e2e8501b721a06eb9791bf6aeb13ed1586b67ae1e1
MATLAB
9,346
266
function [psth_RR] = norm_psth_map1(cellids,resptype,alignevent, varargin); %NORM_PSTH_MAP1 Normalized peri-event time histogram (PSTH) plot % [psth_RR] = NORM_PSTH_MAP1(cellids,resptype,alignevent,...) % Calculates smoothed PSTHs for each unit in CELLIDS (for details see ULTIMATE_PSTH). % Performs baseline no...
58f86281aec16bb72a72428787f018724107f6872b24906a001d7914c51f70b9
MATLAB
9,354
306
classdef audioManager < optickaCore % AUDIOMANAGER Connects and manages audio playback, set as global aM from runExperiment.runTask() properties device = [] fileName char = '' numChannels double = 2 frequency double = 44100 lowLatency logical = false latencyLevel = 1 %> this allows us to be used ev...
000888440a6680bf784a0116581f482bf25da08c327633d0972cd05198d00c66
MATLAB
9,384
222
function [auc, labels] = colAUC(X, y, varargin) %COLAUC calculates Area under ROC curve (AUC) for a vector or for each % column of a matrix. % % SYNTAX: % auc = colAUC(X, y) - calculates AUC for each column of X % auc = colAUC(X, y, alg) - calculates AUC for each column of X using % ...
576f91286897434499b327e9c9cf2fe6d2df8011ad463eb1df82e15795833a35
MATLAB
9,425
201
function [sY, IN] = nk_PerfImputeObj(Y, IN) % =========================================================================npu % FORMAT function [sY, IN] = nk_PerfImputeObj(Y, IN) % ========================================================================= % Performes imputation using either single-subject median replacemen...
38605c04fe8a812197f1ac4d6e8518a4fbf86cc27a136341aba0d5cab502b2ba
MATLAB
9,429
287
function [cluster,exp] = startleClustergram(exp,varargin) p = inputParser; p.addRequired('exp',@(x) isstruct(x) || exist(x,'dir')); p.addParameter('lights',{'on','off'},@iscellstr); p.addParameter('normalize',1,@(x) islogical(x) || isnumeric(x)); p.addParameter('normSearch',{'wt' '+'},@iscellstr); p.addParameter('overw...
1a37946c546ba6da1e60730e5798660338411ddb6273eb15d8985f02e8fe3de9
MATLAB
9,444
281
%JORDI RFMAP state configuration file, this gets loaded by opticka via runExperiment class % io = datapixx (digital I/O to plexon) % s = screenManager % sM = State Machine % eT = eyelink manager % lJ = LabJack (reward trigger to Crist reward system) % bR = behavioural record plot % me.stimuli = our list of stimuli % tS...
2444991c3b6c7d7e43bdbb8352fdb868f6ffc00df7f399ffe4665dca294c57b4
MATLAB
9,463
351
% SPARSEBAYESDEMO Simple demonstration of the SPARSEBAYES algorithm % % SPARSEBAYESDEMO(LIKELIHOOD, DIMENSION, NOISETOSIGNAL) % % OUTPUT ARGUMENTS: None % % INPUT ARGUMENTS: % % LIKELIHOOD Text string, one of 'Gaussian' or 'Bernoulli' % DIMENSION Integer, 1 or 2 % NOISETOSIGNAL An optional positive number to speci...
c61d1ad86348972b6c3c70da43b3eba46c973f9188de0419b72ea60fa92a7f84
MATLAB
9,474
287
function comp_vals = PC_RT_correlation(param,event, fr_name, chanmean, rectype, group, dominantfreq,PC_win, ds,plot_win,unit_group ) %PC_RT_CORRELATION RT/SSDp0.5 correaltion with spike-phase coupling (SPC) % PC_RT_CORRELATION(param,event, fr_name, chanmean, rectype, group, dominantfreq,PC_win, ds,plot_win ) ...
750a116a608391c3c34a3fa42fc94d7b4675f3ec2b378f4aa348803ddd953809
MATLAB
9,513
241
%DOT COLOUR state configuration file, this gets loaded by opticka via runExperiment class % io = datapixx (digital I/O to plexon) % s = screenManager % sM = State Machine % eT = eyelink manager % lJ = LabJack (reward trigger to Crist reward system) % bR = behavioural record plot % obj.stimuli = our list of stimuli % tS...
e778f33bc6b977d5e72abd2f043953248b6f56b31f3ae7697e935eb59cd62270
MATLAB
9,537
233
%power RT (single and clustered) %This version: 200903 by poem %% set parameters (initialize) clear all; SL = '\'; FilePath = ''; if isunix mypath; FilePath = '~/liang/RS/'; %directory SL = '/'; end DR_PBase_setup; %load setup file %datasets PLOT_SET = { 's01_061102'; %motionless ...
eb32b8a42a4d8d8e6b373b34a1a31bda719f06246ae38ef012be684a1080f713
MATLAB
9,568
253
function save(this,filename,encoding) % Save GIfTI object in a GIfTI format file % FORMAT save(this,filename,encoding) % this - GIfTI object % filename - name of GIfTI file to be created [Default: 'untitled.gii'] % encoding - optional argument to specify encoding format, among % ASCII, Base64Binary, ...
b9895f384e7754dc77a16a78b488ad1ac7e2270be75ffda5ffe95b4356962837
MATLAB
9,575
279
%% build_decomp_benchmark_dataset.m % Decomposition benchmark dataset builder (125 Hz, 2 s epochs). % % Required variables in workspace BEFORE running: % EEG_all_epochs [N_eeg x T_src] : clean EEG epochs % EOG_all_epochs [N_eog x T_src] : ocular artifact epochs % EMG_all_epochs [N_emg x T_src] : muscle artifac...
dcdb12075d42b65d16d31c8b8b35819e185deb11ee05c6a989cdba0530027a7c
MATLAB
9,580
258
clear all close all % for monkey=2 % if monkey==1 % monkey_name='Jupiter'; % elseif monkey==2 % monkey_name='Mercury' % end % n=0; % n2=0; % n_TOJ_only=0; % n_video_only=0; % n_video_TOJ=0; % data_name=[monkey_name,'_stepwiseGLM_result.mat']; % ...
a8cd2d1f586d40c92ec2de203e570b5bd0826c2b9d085135dd7682764c995b78
MATLAB
9,610
231
%% Dynamic coding using NDT: you need to download the Neural Decoding Toolbox from https://readout.info/ clear; clc; % add the path to the NDT toolbox_basedir_name = '...\ndt.1.0.4\'; addpath(toolbox_basedir_name); % add the NDT paths using add_ndt_paths_and_init_rand_generator add_ndt_paths_and_init_rand_gen...
aecd0e08ab4a3e1c086f07a9bce25efd04002a7816fe5cc0f7b333f900a92e8e
MATLAB
9,640
262
%% 0. Setup % Initialization clear; close all; clc; % Add folder with raw data to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/raw_data_mouse') % Add library with eNDM functions to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/l...
8ecb0b94230b950c664f796de2e5bcd0204f1efe700023adf5bda6ef0b0e1429
MATLAB
9,656
324
clear %% get all vals for shifts load('ProcessedData\PreProcessed.mat'); vals_corrShifter = []; for day = 1:5 for animal = 1:16 vals_corrShifter = [vals_corrShifter,Delay_byDay{1,day}{animal,1}]; end end vals_corrShifter(vals_corrShifter>34 | vals_corrShifter<2) = NaN; vals_corrShifter(val...
6d4b43fb655b5e8867dda693fc27c98e4c71fb3b5c2869d45bb4ecfbfaca8d40
MATLAB
9,665
205
function [X, L] = nk_CompatY(NM, varind, oocvind, FUSION, stacking_flag) % ========================================================================= % FORMAT [X, L] = nk_CompatY(NM, varind, oocvind) % ========================================================================= % This function extracts the feature space fr...
4f8f86e5a9d1107b85a5e0ae8b4a5f7e1f4358ad973a5897a40c4f513ff09644
MATLAB
9,770
344
function unit_bursting(EventTypes,partition,parttags) %UNIT_BURSTING Analysis of bursting properties of units % UNIT_BURSTING(EventTypes) % -generates an auto-correlogram map (with units % sorted based on bursting indeces (BI) ), averaged auto-correlograms and % a pie chart of bursting an...
1f378cb968bce22003d9a5f79f4941c65d9010ac0dddc5a8bd7614882acb74b4
MATLAB
9,846
250
clear all close all setup_paths; for monkey=1 if monkey==1 monkey_name='Jupiter'; elseif monkey==2 monkey_name='Mercury'; end [num,txt,session_name]=xlsread('Session_name.xlsx',monkey_name); filename_marker=[monkey_name,'_stage2_nonprimate_marker_organized.xlsx']; filename_spike...
b9a0fea11c7708a69dd74ad336f182d57a143a79b0eb2ee6fcde3ebcf19d23d8
MATLAB
9,882
269
%% 0. Setup % Initialization clear; close all; clc; % Add folder with raw data to path % addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/raw_data_mouse') addpath('/Users/justintorok/Documents/MATLAB/eNDM/lib_eNDM_general/'); addpath('/Users/justintorok/Documents/MATLAB/eNDM/raw_d...
cf653407ad552317c898b5bda33bda505312b68fc975d2b55fc6c17279423753
MATLAB
9,885
311
% ====================================================================== %> @brief DataPixx Communication Class %> %> The DataPixx (VPixx Technologies Inc.) is a robust stimulus timing tool, %> allowing microsecond precision of strobed words and TTLs locked to display onset. %> It also enables better contrast range m...
9db58266aaae3a1ed23566b0f8840286c3aef26f94a5983c48f054f26eab9fc5
MATLAB
9,917
209
function [out, fnd, out2, out3, out4] = nk_CheckLoadFile(pth, filetyp, f, d, ovrwrt, nclass) global FUSION % Check file type a = regexp(filetyp,'CVdatamat','ONCE'); if ~isempty(a), a=1; else a=0; end nvar = size(pth,1); % get number of variates out = []; fnd = false; out2=[]; out3 = []; if ~exist('ovrwrt','var') || ...
0bb4e39ba0d41b7b9c2f7aa7c173fbddd4def2617048593f52f33f8acf531372
MATLAB
9,928
301
function upd = textprogressbar(n, varargin) % UPD = TEXTPROGRESSBAR(N) initializes a text progress bar for monitoring a % task comprising N steps (e.g., the N rounds of an iteration) in the % command line. It returns a function handle UPD that is used to update and % render the progress bar. UPD takes a single argument...
d0af435dcf399afc8ade528ad58a153aa9da71b0fa09064299225b6c31f310d8
MATLAB
9,928
250
function t_point = out_of_sample(point, mapping) %TRANSFORM_SAMPLE_EST Performs out-of-sample extension of new datapoints % % t_points = out_of_sample(points, mapping) % % Performs out-of-sample extension of the new datapoints in points. The % information necessary for the out-of-sample extension is contained in % ...
1c6efee862327ee4e1948b03cf92a6726f8032d0eb4e67e933c5797dc3651432
MATLAB
9,943
258
function [propname_stat, propname_boxstat] = responsesorter_PD(pdcells, resdir, tag, twin, issave,excl_beforeEv,isfig) %RESPONSESORTER_PD Tests event-related activation/ inhibition % [propname_stat, propname_boxstat] = responsesorter_PD(pdcells, resdir, tag, twin, issave) % -Plots PSTHs and raster plot...
7fce8b4a64823607df12833e60d84bbe3374943bfe25ca8b4822b5086c356cc8
MATLAB
9,962
183
function [testClassPredicted,classPerform,OtherOutput]=classification(trainSet,trainClass,testSet,testClass,method,option) % Classification using NNLS, BNNLS, NMF, RNMF, KNN, SVM, Bayesian, Kernel-FDA (for future extension), or Optimal-Kernel-FDA (for future extension) classifiers. % Usage: % [testClassPredicted,classP...
e7dee515c076c936631352bf21513d2bfce8797bc6d71317d996d03529410f69
MATLAB
9,963
283
function Ptree = palm_tree(B,M) % Generates a tree that takes the dependence structure % between observations into account. From this tree, the % permutations can be generated later. % % Usage: % Ptree = palm_tree(B,M) % % - B : Multi-level block definitions. % - M : Design matrix. % - Ptree : Permutation...
15cda5dd615c1fac64873c4d7f4f02edf77a2d0233a10c4db7b24014ab2236c3
MATLAB
10,011
306
% DR_pop_loadcnt() - load a neuroscan CNT file (pop out window if no arguments). % NO EVENT % % Usage: % >> EEG = pop_loadcnt; % pop-up window mode % >> EEG = pop_loadcnt( filename, 'key', 'val', ...); % % Graphic interface: % "Data fomat" - [checkbox] 16-bits or 32-bits. We couldn't find in the % ...
0eb3dc16177876ff4211ccfd6e621075104be401598a8ca65cb82d9b9e8c5bf7
MATLAB
10,015
258
clear all close all setup_paths; for monkey=1 if monkey==1 monkey_name='Jupiter'; elseif monkey==2 monkey_name='Mercury'; end [num,txt,session_name]=xlsread('Session_name.xlsx',monkey_name); filename_marker=[monkey_name,'_stage2_nonprimate_marker_organized.xlsx']; filename_spike...
173d1a22e467b0411e3368dd9ef77405b488f6291d2f05660f190e37733478ac
MATLAB
10,015
249
% ======================================================================== %> @class AnimationManagerTest %> @brief Class-based unit tests for animationManager. %> %> Tests construction, property defaults, body management (addBody, %> getBody), nBodies/nObstacles dependent properties, massType %> initialization, and bo...
9eb4f8922fc35262f858b0e450ae7a960f3623f861b364b14817795fc7bf6a91
MATLAB
10,028
316
% ------------------------------------------------------------------------- % Laminar qT1 Profile and Derivative Analysis (CSF → WM) % % This script: % 1) Loads subject-wise laminar profiles (qT1, dqT1, ddqT1) across 8 bins. % 2) Flips LAYNII-order vectors (often WM→CSF) to CSF→WM for presentation. % 3) Plo...
b56db4b0e927779fcd3f244d8c75cd9f2203f2eab1d7880b1f76f4ca4d8709d8
MATLAB
10,058
245
function [trainExtr,out,time]=featureExtractionTrain(trainSet,testSet,trainClass,feMethod,opt) % Extract features from training set % Usuage: % [trainExtr,out]=featureExtractionTrain(trainSet,trainClass,feMethod) % [trainExtr,out]=featureExtractionTrain(trainSet,trainClass,feMethod,opt) % trainSet, matrix, the training...
11d4692f8a763d6c8932b4d007d83c4188eab46bd37a945bdb17762411e5046e
MATLAB
10,071
273
%% 请deepseek整合了一下代码 可以一起出6张统计图并print 25 50 75 100分位值 % STEP1 load data clc; clear; close all; filepath ='D:\930_paper_plotting\Unit_info\Unit_info\Unit_info_SU_patients_extend'; filenames = dir(fullfile(filepath, "*.mat")); fs = 25640; % 筛选以"Unit_info"开头的文件 filtered_files = filenames(startsWith({filename...
b455b5b9ba9d6ead13ce361ac71ff27af81df09bfc1ced585fa83ee969139061
MATLAB
10,074
275
%% 0. Setup % Initialization clear; close all; clc; % Add folder with raw data to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/raw_data_mouse') % Add library with eNDM functions to path addpath('C:/Users/chait/Documents/NOTES/CHAI/UCSF/Raj_Lab/NDM/eNDM-master_genes_new/l...
d4430b3854d7d3f29c499f027e27ab5df22546ec653a62e433ce3bcc82bc3910
MATLAB
10,090
252
function [bayesdata,estimators] = combat(dat, batch, mod, estimators) % This function was originally sent to Dom Dwyer from Russel Shinohara and % is based on the following papers and the git repo below: % Jean-Philippe Fortin, Drew Parker, Birkan Tunc, Takanori Watanabe, Mark A Elliott, Kosha Ruparel, David R Roalf, ...
4fbbf405f6523de9829c6c9d4d5b7a8dedea01512d1bc825644a02af14fb8d8c
MATLAB
10,091
174
%% Demo of a state-machine-driven Opticka Behavioural Experiment. % Opticka is an object-oriented framework for the Psychophysics toolbox % (PTB), allowing randomised interleaved presentation of parameter varying % stimuli specified in experimenter-relevant values. It operates under % Linux (PTB's preferred OS), macOS...
0e260bb67b4dad49c6c45cbfd55fd7dc86daaa9ec7de9addc6575d7f33c765b3
MATLAB
10,107
282
function [act,param] = nk_LIBSVM_config(res, param, defaultsfl, cvfl, parentstr, modeflag) if ~exist('defaultsfl','var') || isempty(defaultsfl), defaultsfl=0; end if ~exist('cvfl','var') || isempty(cvfl), cvfl = 0; end if ~exist('param','var') || ~isfield(param,'LIBSVM'), param.LIBSVM = []; end if ~exist('modeflag', '...
c46a4bf24cbe79678b08521eb2b2cd64ac4c364191dd8ac7b19440154c7c3b8b
MATLAB
10,116
301
% Plot deviation, for Drowsiness % Required input: event file (subj_ExpDate_event.txt) % Output: subj_ExpDate_driving_err.mat, containing moving averaged trajectory and latency % by poem, 20080430 % clear all; FilePath = ''; if isunix mypath; % FilePath = '~/Drowsiness/'; FilePath = '~/liang/'; SL = '/'; end %...
9fabc8b80642427ea9c6e75c9a9e7ea1cff2d6ec0497140d7e825660b0958f6a
MATLAB
10,117
259
function [A, bcol] = print2array(fig, res, renderer, gs_options) %PRINT2ARRAY Exports a figure to an image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % A = print2array(figure_handle...
7dad43e5189339e1110fab5691469634e50f1e2cb6989ecc80d189ac32df63bc
MATLAB
10,133
262
% ======================================================================== %> @class BaseStimulusTest %> @brief Class-based unit tests for baseStimulus base class behaviours. %> %> Tests the shared baseStimulus methods (colour, alpha, show/hide, %> setOffTime, setDelayTime, fullName, UUID, updatePosition, getP) %> usin...