sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
1f7ab708d1c8dc48f6ad638745756e948ece359ec5f32890546d5164f4c2082b | MATLAB | 10,198 | 296 | function X = palm_miscread(filename,varargin)
% Read various scalar data formats based on the file extension.
%
% X = palm_miscread(filename,useniiclass,tmppath,precision,mz3surf);
%
% filename : File to be read.
% useniiclass : True/False. For NIFTI files, use the NIFTI class
% when reading them. It r... |
9e0247d164bc0fdb64b1724cb84e6e245a9780c6a92f84ded91942fba1c1745d | MATLAB | 10,218 | 268 | function map = viridis(n)
% Returns the "viridis" colourmap, i.e., the new default in matplotlib.
if nargin < 1
n = size(get(gcf,'Colormap'),1);
end
values = [
0.26700401 0.00487433 0.32941519
0.26851048 0.00960483 0.33542652
0.26994384 0.01462494 0.34137895
0.27130489 0.01994186 0.3472686... |
6bdabbb49bad2794abbe91c515ee263dc43b18e787635f6a0fbc8fa2a687099c | MATLAB | 10,252 | 302 | function partitions_avg_psth(pdcells,twinds,alignevent,partition,propname_resp,condition,isplot,varargin)
%PARTITIONS_AVG_PSTH
% PARTITIONS_AVG_PSTH(pdcells,twinds,alignevent,partition,propname_resp,condition,isplot)
% Selects units with significant predictive behaviour (see RESPSORT_PARTITIONS_PD) around ... |
d34301517f3c4e014a597898989d3dc72a245300fb3841afd77ef04a5b617af7 | MATLAB | 10,272 | 253 | function [ act, NM, inp ] = cv_ExportModelsPrep(NM, act, inp, parentstr)
global CV
% Detect completed analyses
as = nk_GetAnalysisStatus(NM); complvec = find(as.completed_analyses);
% Initialize runtime parameters
if ~exist('inp','var') || isempty(inp)
inp = struct( 'analind', complvec(1), ... % Index to analys... |
21df89a6461eeefa98369f287deb1c7622ad865fbfa604bcc89092825a10233e | MATLAB | 10,277 | 342 | function EvsI_avg_psth(pdcells,propname,alignevent,condition,isplot,varargin)
%EVSI_AVG_PSTH Average PSTHs, PSTH maps and pie charts
% EVSI_AVG_PSTH(pdcells,propname,alignevent,condition,isplot)
% Selects units with significant acitvation/ inhibition (see RESPONSESORTER_PD) to ALIGNEVENT.
% Groups units ... |
16fca50183a5d1a932247083dd6ec8ea5f8479ef4ed89650cd5850bfc038535c | MATLAB | 10,331 | 245 | function [GRAPHCONSTRUCTION, PX, act ] = cv_graphConstruction_config(GRAPHCONSTRUCTION, PX, brainmask, parentstr, defaultsfl)
global NM
% what method should be used for the construction of the networks?
ConstructionMethod = 'Normative network + 1';
% ParcellationAtlas = 'Hammers.nii';
% VariableTypesVec = '';
Reference... |
663271258c1300ee6cc8e775bca6b8b057d7dd6ff30a1b5b6bea46d768ef8d38 | MATLAB | 10,365 | 246 | function varargout = opx_ui(varargin)
% OPX_UI M-file for opx_ui.fig
% OPX_UI, by itself, creates a new OPX_UI or raises the existing
% singleton*.
%
% H = OPX_UI returns the handle to a new OPX_UI or the handle to
% the existing singleton*.
%
% OPX_UI('CALLBACK',hObject,eventData,handles,...) ... |
7519a5b5869f73c0fd39ec26c2c74a776c760208cc0e407b182609bd4e32effe | MATLAB | 10,401 | 242 | % Comparing power between motionless/motion + 2 of tonic/mixed/phasic
% Plot power increase in desired bands (each band / a plot)
% Plot all designated cluster in a plot
% rows: motionless/motion
% columns: cluster
% colors of traces: tonic/mixed/phasic
% This version: 200906 by poem
%% set parameters (initial... |
992557ff63c61b2e7d60ea64f7a973bc9a0b9edd999851bcab583450ca873fd5 | MATLAB | 10,401 | 327 | function allsessions = getdata2analyse(rootdir, varargin)
%GETDATA2ANALYSE creates a struct with details of data to analyse
% allsessions = getdata2analyse(rootdir,...) creates a struct with the list
% of directories that contain the data specified by name-value pair
% arguments.
%
% Required inputs:
%... |
de507f8388834a086d12f61b7190a1cf4598b9b484b65cfcef2934112c9400e6 | MATLAB | 10,430 | 464 | % @file mc_rvm_example.m
% Author Arasanathan Thayananthan ( at315@cam.ac.uk)
% (c) Copyright University of Cambridge
%
% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Lesser General Public
% License as published by the Free Softwa... |
26aed2d2eecabd618f788283802d4cb5db01b78824bacd9626cf96ab3b687ee2 | MATLAB | 10,434 | 259 | function [IO, mess] = SPMimport(IO, Thresh, act, mess)
if ~exist('mess','var'), mess=[]; end
if ~exist('ShowDesign','var') || isempty(ShowDesign), ShowDesign = true; end
try
if ~exist(IO.spm_file,'file'), return, end
load(IO.spm_file)
switch act
case 'check_matrix'
... |
1b727fdd07ea40844d7147d41f041fe2299d625390b0305310e96e11c181aeef | MATLAB | 10,457 | 255 | %% msRunCNMFE_large
% CNMFE source extraction, based on original work by Pengcheng Zhou. This
% version allows you to perform unsupervised analysis. It is recommended to
% first run a few manual analyses to establish your parameters, then use
% the CNMFE_large (patches analysis) with established parameters.
% Based on... |
3e5bf926a9cf3f91bfae733c87d07d0ffb67460795a81f2925c22500b0d9e527 | MATLAB | 10,458 | 178 | %% 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... |
e572d2c9ca6c61ce0e924a05f14977e4cbe9841e069d17ce7230fd01a4fbb63a | MATLAB | 10,476 | 300 | function [res,p_all,stats,data, D1,D2,data_PET,Resh,T1] = compute_DomainGauges_2D(list1,list2,files_PET,atlas,options,image_for_size,dir_tool,image_save)
% [res,p_all,stats,data, D1,D2,data_PET] = compute_DomainGauges(list1,list2,files_PET,atlas, options, image_save)
% Inputs:
% list1, list2, files_PET are cellarrays o... |
173767764b6d361a657b54168ad185b29521fe1bf8598169de6828bfaf197ef1 | MATLAB | 10,549 | 317 | <<<<<<< HEAD
function y = base64encode(x, eol)
%BASE64ENCODE Perform base64 encoding on a string.
%
% BASE64ENCODE(STR, EOL) encode the given string STR. EOL is the line ending
% sequence to use; it is optional and defaults to '\n' (ASCII decimal 10).
% The returned encoded string is broken into lines of no... |
8f92b8e10bedc61c5934011b4eb1e57801f0c2e0990d612e703486a5cc169d3d | MATLAB | 10,570 | 370 | function [eigvector, eigvalue, elapse] = LGE(W, D, options, data)
% LGE: Linear Graph Embedding
%
% [eigvector, eigvalue] = LGE(W, D, options, data)
%
% Input:
% data - data matrix. Each row vector of data is a
% sample vector.
% W - Af... |
ee0f3eca40755545bf8820b3c3d707adfc474db456d22550a9a40a65ce003236 | MATLAB | 10,582 | 339 | % ========================================================================
classdef minioManager < handle
%> @class minioManager
%> @brief use MinIO mc CLI command from MATLAB (mc alias-based auth)
%>
%> @section intro Introduction
%>
%> minioManager provides an S3-compatible file transfer interface using
%> the MinIO ... |
c66e992112b91fc9005482c0cd53fa98735063725cabdd70f1a90bf21731dbe9 | MATLAB | 10,610 | 276 | %{
This analysis was used to generate Figure S5.
In this analysis, spiking data is binned and sorted then used to train
and test a Linear Discriminate Classifier
This process is repeated as bins from earlier in the interval are dropped.
This demonstrates that temporal decoding can be performed across the
interval, even... |
6cacb24c7d9f8c8becd87e1334ae429634742d8e3159cf4d299bc7f07c24c21e | MATLAB | 10,642 | 282 | % ========================================================================
%> @class SpotStimulusTest
%> @brief Class-based unit tests for spotStimulus.
%>
%> Tests construction, property defaults, type list, flash mode, contrast,
%> colour handling. CI-safe tests run without PTB; hardware-tagged tests
%> exercise setu... |
432328fcd5610851ed059a25aa17805fc247d43981ef20cfa8d2c9a1fb9683bc | MATLAB | 10,658 | 344 | %% FUNCTION MultiSource_LeastR
% Incompletet Multi-Source Learning with Least Squares Loss (optimization)
% This function is not intended to directly called by users.
% See the Logistic_iMSF function.
%
%% OBJECTIVE
% see manual.
%
%% INPUT
% A_Set: {n * d} * t - input. The cell array of data. Each cell shoul... |
e6b16ed92f84b1db2bd101cce0fa567a32485ca6d6ee94037b40d98ed8a60a8a | MATLAB | 10,658 | 215 | % ========================================================================
%> @class HSMCompareTest
%> @brief Class-based unit tests comparing stateMachine (flat),
%> stateMachineHSM (Option 1), and stateMachineTree (Option 2) for
%> log-equivalence on flat inputs and HSM behaviour correctness.
%>
%> Converted from the... |
d431fe893c9ab8b84688e97d4d7d50aa15d5658ea1da1b1629f44ec0a10ea8d0 | MATLAB | 10,689 | 173 | function [I2, I1, filefound] = nk_VisXHelper(act, nM, nclass, decompfl, permfl, ix, jx, I2, inp, ll, nperms, I1)
global FUSION SVM
linsvmfl = determine_linsvm_flag(SVM);
filefound = false;
switch act
case 'init'
% Initialize arrays in data containers for CV2-level statistics
if any(permfl)
... |
6ecc9dde249392cf87127530aae1ecdc2ed0f51f1445923b2b7a9b84d7a9557e | MATLAB | 10,693 | 291 | allcomp = 1 : 30;
allchans = 30; %30-channel data
ClsLabel = {
'Frontal'; %1
'Left Frontal'; %2
'Right Frontal'; %3
'Central'; %4
'Parietal'; %5
'Left Somatomotor'; %6
'Right Somatomotor'; %7
'Occipital Midline'; %8... |
8cd4ec160b516d569539d38bfaa6f985622c1eb1425796f92a0dbc2be6708241 | MATLAB | 10,710 | 264 | % ========================================================================
%> @class RevcorStimulusTest
%> @brief Class-based unit tests for revcorStimulus.
%>
%> Tests construction, property defaults, typeList, pixelScale,
%> frameTime, trialLength, interpolation, and the standard stimulus
%> API (show/hide, reset, UU... |
2f8daf17a8a25c40dcd2c48a6c8c6e06282e03723f809889b5e1b2c240fd963d | MATLAB | 10,713 | 341 | function [x, infos] = pnmf_vb(V, rank, in_options)
% Probabilistic non-negative matrix factorization (NMF) with Variational Bayesian (VB).
%
% The problem of interest is defined as
%
% min || V - WH ||_F^2,
% where
% {V, W, H} > 0.
%
% Given a non-negative matrix V, factorized non-negativ... |
62ea4ab7ff08268ab66f00fcc956253205a706fedf8e58b81f63cc009300adec | MATLAB | 10,724 | 328 | %% analyze_XORSAT_5R5X_7R7X.m
% Analyze 5R5X and 7R7X XORSAT TTS scaling and plot them together.
% Run this script from the parent folder that contains:
% - XORSAT_5R5X/coarse_summary.csv
% - XORSAT_5R5X/coarse_instance_tts.csv
% - XORSAT_7R7X/coarse_summary.csv
% - XORSAT_7R7X/coarse_instance_tts.csv
clear; c... |
61ade0cf2609e504fb808385671c30b5ceee785d787b435b4dbbb3678bd82863 | MATLAB | 10,752 | 370 | function result = cdq(x,y,c,varargin)
%CDQ computes Censored Depth Quantiles for regression, as described in
%
% Debruyne, M., Hubert, M., Portnoy, S., Vanden Branden, K. (2008),
% "Censored depth quantiles",
% Computational Statistics and Data Analysis, 52, 1604-1614.
%
% Required input arguments:
% x : Data matri... |
7c0ebc1ac91f92db8aab0c02595be8a885d089107a6d5aaef273141a576c151f | MATLAB | 10,772 | 310 | % Final output is in a cell array called "best_day" for moving to prism.
% Regardless of which chunk you run, best_day is organized as a cell array
% for each day, which contains cell arrays for cells best responsive to
% each odor (nested). Odor always follows the order of Odors_All for arrays
% 1-6. Final numbers... |
bf2c83e843e27d170228cadd7ea40efd4b541a889b994a4e29c4c120ef1ec94f | MATLAB | 10,773 | 290 | % ========================================================================
%> @class AlyxManagerTest
%> @brief Class-based unit tests for alyxManager.
%>
%> Tests construction, validation, endpoint generation, secret assignment,
%> login/logout state, queue handling, helper methods, and read-only Alyx
%> operations. Li... |
ccf0a1f30b16ac3b13dd9b5f8de27ca6b848b2c07aa9aaf2b379bc38562ee8ab | MATLAB | 10,792 | 256 | %% msRunCNMFE_large
% CNMFE source extraction, based on original work by Pengcheng Zhou. This
% version allows you to perform unsupervised analysis. It is recommended to
% first run a few manual analyses to establish your parameters, then use
% the CNMFE_large (patches analysis) with established parameters.
% Based on... |
8b97ab829cd098a3cf1067b7dddc7850853c8de087f9a18d61d742776e2fa625 | MATLAB | 10,795 | 270 | % =======================================================================================================
% results = nk_ComputeEnsembleProbability(predictions, label, noscale, optcutoff, optcutoffperc, meanfun)
% =======================================================================================================
% ... |
fa4332b2583135d83b1d830fcbfd813cff733fb06c872aa762858bcbf0efebb9 | MATLAB | 10,835 | 352 | function [eigvector, eigvalue, bSuccess, elapse] = OLGE(W, D, options, data)
% OLGE: Orthogonal Linear Graph Embedding
%
% [eigvector, eigvalue, bSuccess] = OLGE(W, D, options, data)
%
% Input:
% data - data matrix. Each row vector of data is a
% sample vec... |
7d97aff75ff5c94c0325683778b06d6ff8ed353b275443bc0acee0b7443aebb2 | MATLAB | 10,867 | 233 | % Comparing power between 2 of the followings: baseline, whole epoch, and after dev_on [single subject]%This version: 2009/1 by poem
% ver 200901 by poem
%% set parameters (initialize)
clear all;
SL = '\';
FilePath = '';
if isunix
mypath;
FilePath = '~/liang/RS/'; %directory
SL = '/';
end
DR_PBase_s... |
ada3ee46f0a1359ebe4eb9f8fb57d2b6ac8157908d482f8b5455ddeece0def09 | MATLAB | 10,918 | 353 | function [eigvector, elapse] = SR_caller(options, data)
% SR: Spectral Regression
%
% [eigvector, elapse] = SR_caller(options, data)
%
% Input:
% data - data matrix. Each row vector of data is a
% sample vector.
% options - Struct value in Matla... |
3b8f4c121d7d302acc03832de99dce3cb94cf2434ae8289b9da8fbef8de2b758 | MATLAB | 10,939 | 204 | function param = nk_EnsembleStrategy2_config(param, SVM, MODEFL, defaultsfl, parentstr)
Ensemble.type = 0; % Aggregated ensemble
Ensemble.Metric = 2; % Decision values (if SVM), Probabilities if RVM
Ensemble.MinNum = 1; % Min # of classifiers
Ensemble.Perc = 75; % Min % o... |
57906220b65fe83db259fde15914376fdcdf05468f89dac7a29d924da8eecf0b | MATLAB | 10,940 | 321 | %% 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... |
fad9b0b6ba8436c7bcc7d7c0a5d817536da5a133d5e6e3e72274ff651fc54a55 | MATLAB | 10,972 | 355 | function [eigvector, elapse] = KSR_caller(options, data)
% KSR: Kernel Spectral Regression
%
% [eigvector, elapse] = KSR_caller(options, data)
%
% Input:
% data - data matrix. Each row vector of data is a
% sample vector.
% options - Struct valu... |
15a8769a62321bd03e68474c8bf752c61a91d1a1f5ff9ed8f6fab64154a73621 | MATLAB | 10,979 | 269 | 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'];
% ... |
ca11e7e70f9ad2035a4e010cf1d44205ddf7e662cbcf2107da3396f8b1edaaaf | MATLAB | 10,979 | 222 | function [RMAOV1] = RMAOV1(X,alpha)
% RMAOV1 Repeated Measures Single-Factor Analysis of Variance Test.
% One-way repeated measures ANOVA is used to analyze the relationship
% between the independent variable and dependent variable when:(1)
% the dependent variable is quantitative in nature and is measured ... |
3d3749e520822fa6805619621e1409768c5693638b5eafae4ec0a824890c47e5 | MATLAB | 10,991 | 371 | % ========================================================================
%> @brief colour test is a simple RGB colour blender for teaching
%>
%> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
% ========================================================================
classdef colourTest < spot... |
2ba0d0c7898cb22a35aa96e6da50854e6f95bad5d2fef07dca3a1fe3f01bfccc | MATLAB | 11,041 | 255 | %% Brainframe:
% a tool for visualizing per-voxel or per-region data, as well
% as connectome data, in a 3D surface representation of a brain. This
% function has been tested for and works using mice and human brain
% atlases, but may well work with other species' brains.
%% Syntax & Basic Use:
% The below creates a... |
9fb505ab0ddd196a566e681703c13b4c5bc9e464c5423ebc8cfa14778918e9a1 | MATLAB | 11,067 | 253 | function mp2rage_run_correct_T1(correctT1)
%MP2RAGE_RUN_CORRECT_T1 Executable job that estimates the quantitative
%T1map from the UNI image and the sequence parameters, and correct it for B1
%inhomogeneities. Quality control images will be also written.
%
% The core code of this function is an implementation of https:/... |
4197d5b2514bf983840f881112a5b12cb8ec3364e86d9785fd0ff21d8e5ce96e | MATLAB | 11,087 | 277 | % =========================================================================
% = REGRESSION PLOT =
% =========================================================================
function handles = display_regrplot(handles, markflag, oocvflag, oocvprepflag, binarizeflag,... |
c156ea7c8c8b61113619182d88265f7c4ffcf67483f70aaf703e7641555258fb | MATLAB | 11,087 | 302 | function nk_Initialize(action)
% =========================================================================
% nk_Initialize(action)
% =========================================================================
% startup script for NeuroMiner
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c... |
b1695b56334ab8da597cc614a1683277af3b0f406db80dee1db5bd1fa0c5d697 | MATLAB | 11,100 | 273 | % 2 FIGURE GROUND 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 stimul... |
70dcd91deb548f9b8aed76f18da7fc874e825ab43d99a7fcfc048db7255253a2 | MATLAB | 11,132 | 231 | function nk_AutomatePermOOCVSamples(tNM, act, M, analdim)
% =========================================================================
% AUTOMATION EXAMPLE 1:
% tNM : template NM structure
% act : action mode:
% 'create_M' => create permutation index array (see below)
% 'create_NM' => update ... |
261d7adebd0db452d2e08bb226ed5e730624488b90fbedefbc81e4361274baf4 | MATLAB | 11,159 | 361 | % ========================================================================
%> @brief colourManager manages colours wrapping the CRS Color Toolbox
%>
%> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
% ========================================================================
classdef colourManage... |
e02a13d9157838955c0cbd3065f23082b844614432af2b13c5969cd3cf5bb431 | MATLAB | 11,162 | 233 | function options = NoRMCorreSetParms(varargin)
% Struct for setting the NoRMCorre algorithm parameters. Any parameter that is
% not set gets a default value
% Author: Eftychios A. Pnevmatikakis
% Simons Foundation, 2016
Names = [
% dataset info
'd1 ' % number of rows
'd2 ... |
1b3fc8991b78614ac643d18ab0d4f2682f71a4389342a8d03bb19754b87a05e9 | MATLAB | 11,163 | 240 | function [DR, PX, act] = nk_DimRed_main_config(DR, PX, parentstr, defaultsfl)
if ~exist('defaultsfl','var') || isempty(defaultsfl); defaultsfl = false; end
CALIBUSE = 2;
if ~defaultsfl
if isempty(DR), [DR, PX] = nk_DimRed_main_config(DR, PX, parentstr, true); end
if isfield(DR,'RedMode'), RedMode = DR.RedM... |
66ec3546a3b7f4bd7bdce720e36eecc358dccab2b48827f919b256af5563dae4 | MATLAB | 11,174 | 277 | % ========================================================================
%> @class HSMBenchmarkTest
%> @brief Class-based unit tests for timing precision comparison across
%> stateMachine (flat), stateMachineHSM (Option 1), and stateMachineTree
%> (Option 2).
%>
%> Converted from the legacy function-based hsmBenchmar... |
ea3998d7471dd6ab327a95909c72282d37d2d1b356292d831d61e36bdd65390e | MATLAB | 11,240 | 246 | function [nexFile] = readNexFile(fileName)
% [nexFile] = readNexFile(fileName) -- read .nex file and return file data
% in nexFile structure
%
% INPUT:
% fileName - if empty string, will use File Open dialog
%
% OUTPUT:
% nexFile - a structure containing .nex file data
% nexFile.version - file version... |
4d847272f9917379b30449dae02e4c2cf9e56d5150a9b1db2f9ebbd757870df4 | MATLAB | 11,256 | 313 | %% 1. eNDM_mousedata.mat datasets
% Add library with eNDM functions to path
addpath('/Users/justintorok/Documents/MATLAB/Nexis/MATLAB/lib_eNDM_general')
datapath = '/Users/justintorok/Documents/MATLAB/Nexis/raw_data_mouse';
% Load dataset of interest
% load([datapath filesep 'Tasic_606.mat'],'outstruct_606','classkey... |
d77e311248c78038ccb6da7fc725ef88b4ccd7789c192f28253a3759d790b800 | MATLAB | 11,260 | 339 | <<<<<<< HEAD
function M = mvtk_read(filename)
% Read VTK formatted data from disk
% FORMAT M = mvtk_read(filename)
%
% filename - VTK-formatted file name
% M - data structure
%__________________________________________________________________________
%
% VTK File Formats Specifications:
% http://www.vt... |
6ee3ad157500cbb8507e4e99ddb9e9144c8b0260f12e634344b498376ab9247e | MATLAB | 11,261 | 346 | function EEG_LFP_Wcoh_compare_partitions(EventTypes,SubEventTypes,side,partition,patgr_nm,baseline_type)
% EEG_LFP_WCOH_COMPARE_PARTITIONS Compares partitioned trials of EEG-LFP coherence data.
% EEG_LFP_Wcoh_compare_partitions(...) gets and saves EEG-LFP wavelet coherence
% matrices for trials partitioned according... |
d916eedf5102a7354a8d2c99c7f075053fcd9bb1710d8e1b35c64e0ef80d098b | MATLAB | 11,289 | 354 | function [ bbq ] = buildBBQ( PTR, YTR, options )
% Input:
% PTR: Vector of predicted values
% YTR: Vector of true labels {0,1}
% Options: Structure of optional choices
if isfield(options,'scoringFunc')
scoringFunc = options.scoringFunc;
else
scoringFunc = 'BDeu2';
% Special case ... |
2883518db7ebcf6f4a5c9f71109c898b69c53559d44453e26007e6aedffa4db6 | MATLAB | 11,363 | 343 | % ========================================================================
%> @brief revcorStimulus stimulus, inherits from baseStimulus
%>
%> Copyright ©2014-2024 Ian Max Andolina — released: LGPL3, see LICENCE.md
% ========================================================================
classdef revcorStimulus < base... |
bcc3b9e4e53467570697057530b4007abaa124fc94b45ec82eeffe29e0c04863 | MATLAB | 11,404 | 279 | function acg_mod(cellids,window,varargin)
%ACG Auto-correlation.
% ACG(CELLIDS,WINDOW) calculates auto-correlations at 0.5 ms resolution
% for a given window size (WIN). For details on the algorithm, see XCORR.
%
% Required input arguments:
% CELLIDS: cells included in the analysis.
% WINDO... |
bf96119661d1b9bf23275883c26633735e28d60f9553825765743c106998e22b | MATLAB | 11,405 | 343 | % ========================================================================
%> @brief revcorStimulus stimulus, inherits from baseStimulus
%>
%> Copyright ©2014-2024 Ian Max Andolina — released: LGPL3, see LICENCE.md
% ========================================================================
classdef revcorStimulus < base... |
6f5c733212fb4a6eac2fd2e8afb540670239f128c569f7bf89c87b10ac976c16 | MATLAB | 11,408 | 306 | function [x, infos] = svrmu_nmf(V, rank, in_options)
% Stochastic variance reduced multiplicative update for non-negative matrix factorization (SVRMU-NMF) algorithm.
%
% Inputs:
% matrix V
% rank rank
% options options
% Output:
% w solution of w
% infos inf... |
681dbd6d93a2311f71d2ac77c76b54dcdc1e0e8c5869fbc799d35f55ea907d97 | MATLAB | 11,428 | 306 | function [wcoh_pats, wcavg, pats2,fff] = wcoh_avg(event,varargin)
% WCOH_AVG Average across patients
% WCOH_AVG(event,...) calculates and draws average MSWC map across patients.
% Johanna Petra Szabó, 05.2025
% Lendulet Laboratory of Systems Neuroscience
% Institute of Experimental Medicine, Budapest, Hungary
... |
07a36b242626f4637903bd4d98997a3d7602e0d82fec06e2ebaa32be35e04df2 | MATLAB | 11,556 | 332 | classdef MClustMainWindowClass < handle
% Main window of the MClust program
%
%
% ADR 2012/12
properties(Constant)
AboutString = {[MClustSettings.VERSION], 'By AD Redish', ' ', ...
' including code by ', ' ', ...
'F Battaglia; S Cowen', 'JC Jackson; P Lipa','NC S... |
564bc64e0c539a65a3f89eca2725a4b8ebcb75e2e9b98c364f18ac82890c71e1 | MATLAB | 11,580 | 274 | function [sY, IN] = nk_PerfRedObj(Y, IN)
% =========================================================================
% FORMAT [sY, IN] = nk_PerfRedObj(Y, IN)
% =========================================================================
% This function is the core dimensionality reduction interface of NM. It
% makes avila... |
a1c8e158955e29c6b5d7d4c1eb40676cfe7dc7d6b6b0a3605d456cccac368c59 | MATLAB | 11,624 | 314 | function nk_SpatialOP_config(PREPROC, parentstr, stepind )
ds = 'spatial operation';
actstr=[]; actmnu=[];
% Get description of parameters
d = nk_GetParamDescription2(NM, PREPROC, 'SpatialOP');
if isfield(PREPROC,'SPATIAL') && ~isempty(PREPROC.SPATIAL)
lact = length(PREPROC.SPATIAL);
%% Display cu... |
36d55a0f6533b3404c8ac5e15b7ba6e16ba4ed97d477311156535a7d56aa5ac0 | MATLAB | 11,637 | 300 | % ========================================================================
%> @class LogGaborStimulusTest
%> @brief Class-based unit tests for logGaborStimulus.
%>
%> Tests construction, property defaults, type list, sf/sfSigma,
%> angleSigma, contrast, seed, mask properties. CI-safe tests run
%> without PTB; hardware-... |
0ec9a24307407694fc323273ef0f41ce3d50b5e9c762431d57070285a47758a8 | MATLAB | 11,662 | 360 | function [eigvector, elapse, itn, Y] = SR(options, Responses, data)
% SR: Spectral Regression
%
% [eigvector, elapse, itn, Y] = SR(options, Responses, data)
%
% Input:
% data - data matrix. Each row vector of data is a
% sample vector.
% Responses ... |
aabe4b6be533cc60f6f58a66f46c53a624e7f28e8a9f23e66344a471b697bf6e | MATLAB | 11,665 | 285 | clear all
close all
setup_paths;
kk=0;
for monkey=1: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'];
filenam... |
0e1109eb567398142618eb26e1fa8e48f8dd2c4055bfe87c08ecba8dc9cd40d8 | MATLAB | 11,679 | 291 | % ========================================================================
%> @class NDotsStimulusTest
%> @brief Class-based unit tests for ndotsStimulus.
%>
%> Tests construction, property defaults, type/msrcMode/mdstMode lists,
%> custom properties, show/hide, off/delay time, colour/alpha, UUID,
%> fullName, and rese... |
d769c419b546924bcbfc760a34b85de49935b029abd05e98d2c6e616a1c48ea0 | MATLAB | 11,696 | 310 | % ========================================================================
%> @class DotsStimulusTest
%> @brief Class-based unit tests for dotsStimulus.
%>
%> Tests construction, property defaults, type/colourType lists, density,
%> dotSize, coherence, dotType, kill, mask, mask properties. CI-safe tests
%> run without ... |
7bf4bcd7e236993bc2f466b3c92c1a67ad0b5ce1cb25d91e9605c2ccd491b65f | MATLAB | 11,715 | 276 | function result=predict(x,y,inmodel)
%PREDICT is a function which computes regression results for new data based on
% the output from a RPCR or RSIMPLS analysis.
%
% I/O: result=predict(x,y,inmodel)
%
% Required input arguments:
% x: Data matrix of the explanatory variables of the new data
% y: Data matrix of the ... |
960e7fa07b61416659138c8706e8398dd9fb104706a816a79b1e5e3fd52f60f4 | MATLAB | 11,721 | 298 | function PC_cell_level(plot_win,freqs, fr_names,PCdir,EventTypes,SubEventTypes,varargin)
%PC_CELL_LEVEL Spike-phase coupling
% PC_CELL_LEVEL(plot_win,freqs, fr_names,PCdir,EventTypes,SubEventTypes,...)
% -Calculates mean vector length (MRL) and preferred phase of coupling
% between spiking activity and LFP/EE... |
e0783b669054e0519691a05eda4090fabe73a72da0cd72ca4cc6dda56a1fe084 | MATLAB | 11,733 | 288 | function Res = nk_SVMVisCVGrid(TempDir, CV, FEATSEL)
if ~exist('TempDir','var') || isempty(TempDir)
RootDir = spm_select(1,'dir','Select IMRelief root directory');
if isempty(RootDir), reutrn; end
end
[niy, njy] = size(CV.TrainInd);
[nix, njx] = size(CV.cvin{1,1}.TrainInd);
nclass = numel(CV.class{1,1});
Res.... |
4ec5d44eef8ee60b9d90e79efdd20df73062db712955acc02723e9291ed7ca3c | MATLAB | 11,752 | 357 | % ========================================================================
%> @brief single disc stimulus, inherits from baseStimulus
%> SPOTSTIMULUS single spot stimulus, inherits from baseStimulus
%> The current properties are:
%>
%> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
% ========... |
bebf84dd45a40f4de821e9e31d2be0921f44ff14d1aac1cb93749186900044a6 | MATLAB | 11,770 | 300 | % ========================================================================
%> @class CheckerboardStimulusTest
%> @brief Class-based unit tests for checkerboardStimulus.
%>
%> Tests construction, property defaults, type list, spatial/temporal
%> frequency, colour2, contrast, mask, phase, correctPhase, aspectRatio.
%> CI... |
6b867c5393daffb423cc69a594ed05013e2cfa8a477cb9bdf59984e0e27d4d10 | MATLAB | 11,818 | 303 | function result=mcdregres(x,y,varargin)
%MCDREGRES is a robust multivariate regression method. It can handle multiple
% response variables. The estimates are based on the robust MCD estimator of
% location and scatter (see mcdcov.m). The explanatory variables should be
% low-dimensional, otherwise robust principal c... |
137c16c69d621c1d4091471352a46f6681f2519f1d902f0a0ff9183cee0eef55 | MATLAB | 11,849 | 344 | function [X,ndx,dbg] = natsort(X,rgx,varargin)
% Alphanumeric / Natural-Order sort a cell array of 1xN char.
%
% (c) 2012-2020 Stephen Cobeldick
%
% Alphanumeric sort a cell array of strings: sorts by character order and
% also by the values of any number substrings. By default matches integer
% substrings and performs... |
0be98063c4bbed04a0808f4ad072ce962236acb06808a7c538140c48541a1ff4 | MATLAB | 11,851 | 232 | % ========================================================================
%> @class HSMOption1Test
%> @brief Class-based unit tests for stateMachineHSM (Option 1: struct + parent field).
%>
%> Converted from the legacy function-based hsmOption1Test.m to use
%> MATLAB's matlab.unittest.TestCase framework. Each original... |
1b6f61389c9b2a9143ac486957a4f07a862a457af6ccc0df6fe5d66c1e5d04c2 | MATLAB | 11,884 | 309 | function [x, infos] = nmf_mu(V, rank, in_options)
% Multiplicative upates (MU) for non-negative matrix factorization (NMF).
%
% The problem of interest is defined as
%
% min f(V, W, H),
% where
% {V, W, H} >= 0.
%
% Given a non-negative matrix V, factorized non-negative matrices {W, H} ar... |
8d923807a01a475f8260db6efd66c3be49eab9ebcccb2472722616100e3a961c | MATLAB | 11,904 | 317 | % #####################################################################
% This code does:
% 1) Feature selection using SA
% 2) This is a simple code working on 1 single shot only. That is, this
% code work with a set of trainin, cross-validation and test set.
% 3) If you want to make N-fold cross validation, you can c... |
3a5e2ab293cb41d8c7d5646470dfa9303d7c6ef0bb430c762c09212c47d3a045 | MATLAB | 11,958 | 318 | function output = dirPlus(rootPath, varargin)
%dirPlus Recursively collect files or directories within a folder.
% LIST = dirPlus(ROOTPATH) will search recursively through the folder
% tree beneath ROOTPATH and collect a cell array LIST of all files it
% finds. The list will contain the absolute paths to each f... |
b6441c992acf56a8487c74161e02272d9af7d5aeb640ede092c4c2f3ada9106a | MATLAB | 12,001 | 304 | function res = saveastiff(data, path, options)
% options.color
% : true or FALSE
% : If this is true, third dimension should be 3 and the data is saved as a color image.
% options.compress
% : 'no', 'lzw', 'jpeg' or 'adobe'.
% Compression type.
% 'no' : Uncompressed(Default)
% 'lzw' : lossles... |
fa4d003848edb22fea3f7397be8dea87d1a77484090a747bc917a52981471b52 | MATLAB | 12,023 | 222 | function [act, NM, A] = nk_InitAnalysisPrep(NM, A, parentstr, act)
disallow = false;
analdim = 1;
amode = 1;
ovrwrt = 3;
na_str = '?'; mn_str = []; mn_act = [];
Amodes = {'generate new','manage existing'};
Aovrwrt = {'delete', 'delete & wipe', 'complete reset', 'parameter reset', 'update paths and descriptors', 'overw... |
b4caaab21ff92195858e9e957f162455a7027b4ff94225b16f2843d02ed20538 | MATLAB | 12,037 | 350 | function [out_featuresSyn, out_labelsSyn] = ADASYN(in_features, in_labels, in_beta, in_kDensity, in_kSMOTE, in_featuresAreNormalized)
%this function implements the ADASYN method as proposed in the following
%paper:
%
%[1]: H. He, Y. Bai, E.A. Garcia, and S. Li, "ADASYN: Adaptive Synthetic
%Sampling Approach for Imbalan... |
51266e68f4d329632337310b3ad6dd36166214ca59d82e224fda21931f627407 | MATLAB | 12,060 | 389 | function nk_FeatSel_Cluster(dat, xs)
%
% function nk_FeatSel_Cluster(dat)
% ================================
% (c) 2009, Nikolaos Koutsouleris, last modified 02/10/2009
[ix,jx] = size(dat.cv.TrainInd);
brainmask = regexprep(dat.brainmask,',1','');
cv = dat.cv;
id = dat.id;
if strcmp(spm('ver'),'SPM5'),
spm5ver... |
a9ae7e013b90292636927ec4417e8fb94528fe5ec49c381d931552a8648033da | MATLAB | 12,073 | 358 | function [E, D] = pcamat(vectors, firstEig, lastEig, s_interactive, ...
s_verbose);
%PCAMAT - Calculates the pca for data
%
% [E, D] = pcamat(vectors, firstEig, lastEig, ...
% interactive, verbose);
%
% Calculates the PCA matrices for given data (row) vectors. Returns
% the eigenvector (E) and diag... |
ccd2d8081d48d6cf6eb1f49a279737b2512552fe3adb4af1dab21110bf935af0 | MATLAB | 12,122 | 352 | function update_temporal_parallel(obj, use_parallel, use_c_hat)
%% update the the temporal components for all neurons
% input:
% use_parallel: boolean, do initialization in patch mode or not.
% default(true); we recommend you to set it false only when you want to debug the code.
% use_c_hat: use the previous ... |
436d1d9b8b3ea29f6e87ca3adfbf13a476aa302fce8df9d5953eb4439fd91e54 | MATLAB | 12,161 | 325 | function [cmd,mutant] = ABA_CTRL_batch_bcv(data_path,varargin)
% inputs
p = inputParser;
p.addRequired('data_path',@(x) exist(x,'dir'));
p.addParameter('upload',[],@(x) exist(x,'dir'));
p.addParameter('run',true,@(x) islogical(x) || isnumeric(x));
p.addParameter('include',{},@iscellstr);
p.addParameter('overwrite',fals... |
f23e0f4c303d6fc65147f4ead05d6ed4d3d7bf9b1858ea844d28e5c241fe290a | MATLAB | 12,174 | 347 | function generate_clus_distr_TF(sess2analyse,epoch_win,baseline_win,varargin)
% GENERATE_CLUS_DISTR_TF Generates cluster distribution for cluster correction.
% generate_clus_distr_TF(sess2analyse,epoch_win,baseline_win,...)
% tests significant signal (EEG/ LFP/ WAVELET COHERENCE) change relative to baseline on m... |
87b05bdcd2721015e3cc2c097b8820cbcbdbe4014db877f49f8c8488c106bfab | MATLAB | 12,239 | 317 | function [M_final,shifts_g,template,options,col_shift] = normcorre_batch_even(Y,options,template)
% online motion correction through DFT subpixel registration
% Based on the dftregistration.m function from Manuel Guizar and Jim Fienup
% INPUTS
% Y: Input data, can be already loaded in memory as a 3D
% ... |
b3362ffb087713866969a086575511d643f7c1990deb0da5533ff0e97d4d5826 | MATLAB | 12,272 | 278 | function analysis = nk_MLOptimizer_main(inp, datid, PreML)
global SVM GRD MODEFL W2AVAIL VERBOSE BATCH
if ~isfield(inp,'batchflag') || isempty(inp.batchflag), inp.batchflag = false; end
if ~isfield(inp,'probflag') || isempty(inp.probflag), inp.probflag = false; end
if ~isfield(inp,'simFlag') || isempty(inp.simFlag), ... |
67995921ca72d1f389729be32b0e9c4f8683469ea4003b182d12f41a405a04c6 | MATLAB | 12,287 | 319 | function PC_group_subevs(plot_win,freqs,fr_names,PCdir,EventTypes,SubEventTypes,varargin)
%PC_GROUP_SUBEVS Compare spike-phase coupling of subevents
% PC_GROUP_SUBEVS(plot_win,freqs,fr_names,PCdir,EventTypes,SubEventTypes,...)
% -Compares phase distribution (stat. test: Watson's two sample test of homogeneity)
... |
165061b4d0dcefe56756ef5b8a7392c79602ce43c5c551a8aea11695f6b79185 | MATLAB | 12,326 | 305 | % ========================================================================
%> @class TimeLoggerTest
%> @brief Class-based unit tests for timeLogger.
%>
%> Tests preAllocate, addMessage, logStim, messageTable, calculateMisses,
%> removeEmptyValues, stderr, and loadobj. All tests run without PTB
%> (the constructor falls... |
89566e1b75915b9c95d6ac1fc6c2c9442b20e1b919e03abdb63a3286e8d0993a | MATLAB | 12,354 | 252 | function [GD, MultiBinBind] = nk_ModelNodeSelector(GD, MD, label, f, d, nclass, Ps, Pdesc, combcell, act)
global CV MULTI GRD SAV MODEFL RFE RAND MULTILABEL SVM xCV simFlag
if ~isempty(simFlag) && simFlag
tCV = xCV;
else
tCV = CV;
end
MultiBinBind = [];
nl = nk_GetLabelDim(MULTILABEL);
for curlabel=1:nl
... |
74e34480f71b7e71437102875990a628d136d304481c4ad2f12936d14d0300c0 | MATLAB | 12,389 | 307 | % ========================================================================
%> @class GaborStimulusTest
%> @brief Class-based unit tests for gaborStimulus.
%>
%> Tests construction, property defaults, type list, spatial/temporal
%> frequency, contrast, phase, driftDirection, aspectRatio, sigma,
%> rotationMethod, correc... |
e3c78394726b3efb0cf95f1826bcacea659940061442d7c753da1570049e6e17 | MATLAB | 12,418 | 401 | function editor(tree)
%XMLTREE/EDITOR A Graphical User Interface for an XML tree
% EDITOR(TREE) opens a new figure displaying the xmltree object TREE.
% H = EDITOR(TREE) also returns the figure handle H.
%
% This is a beta version of <xmltree/view> successor
%
% See also XMLTREE
%___________________________________... |
577ae06541cbda3b8619272827915e2375cdae6a801e49fbdeb49a2f97d1ea28 | MATLAB | 12,476 | 308 | %% ========================================================================
% 整合脚本:波形分类 (PS/TS/RS) 与特征提取 (最终优化版)
% ========================================================================
clear; close all; warning("off");
% --- 1. 路径与患者列表设置 ---
root_path = 'D:\930_paper_plotting\Unit_info\Unit_info\';
save_r... |
7335de58b395544702ec3b8460ec33dfb4fc7a0fb84c6f178c77d47c656be971 | MATLAB | 12,511 | 266 | function [sz_str, mess, IO] = CheckTabFile(IO, act, na_str, mess)
if ~exist('mess','var'), mess=[]; end
sz_str = na_str;
warning('off')
try
switch IO.groupmode
case 1
Mx = 'MATLAB workspace'; matrixname = IO.M_edit;
case 2
Mx = 'MATLAB file'; matrixname = IO.mat... |
0a452dd177381415da09dabb44b18c2ebfe33a8cecfedc28eb5a45e5ee31a7cf | MATLAB | 12,512 | 315 | % ========================================================================
%> @class ColourGratingStimulusTest
%> @brief Class-based unit tests for colourGratingStimulus.
%>
%> Tests construction, property defaults, type list validation, colour
%> and colour2 handling, contrast, correctBaseColour, phase, mask,
%> corre... |
910899404a42b3f4ce96a1d119e860244afb60b852a39989e146cabc91330c90 | MATLAB | 12,543 | 386 | function SSDp05_compare(groups_nm,whichSSRT,stat,conditions)
%SSDP05_COMPARE compares SDDp0.5 and SSRT values.
% SSDP05_COMPARE(groups_nm,whichSSRT,stat,conditions) plots
% the estimate of stop signal delay at 50% probability of stopping
% (SSDp0.5) or estimated stop signal reaction time (SSRT)
% for spe... |
fc26cd7824b5804484c204427459383b85eda4479608057e6e8b5dd53febf5a9 | MATLAB | 12,551 | 328 | function fighandle = palm_viewsub(varargin)
% Simple visualisation of subcortical surface results still in Octave/MATLAB.
% The principles are generally similar to those of the tool "dpx2map.m",
% described here:
% https://brainder.org/2013/07/28/displaying-vertexwise-and-facewise-brain-maps/
%
% Usage:
% h = palm_vie... |
66e02c4577ccd35650e47c704f0d773a22074ee91d9b3ba84a318c4fc8d19043 | MATLAB | 12,558 | 257 | function nk_AutomatePermLeaveSiteOutSamples(tNM, act, M, analdim)
% =========================================================================
% AUTOMATION EXAMPLE 2:
% tNM : template NM structure
% act : action mode:
% 'create_M' => create permutation index array (see below)
% 'create_NM' =>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.