sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a671fc3587fa5ad730b0273e647129035475af993da5bc6eeb3d0a6aa9c73b7c
MATLAB
4,763
168
function pp_prepare_format(BLOCKS,subject,session_label,ConditionFolder,behavior,Path,savedir,time) % % pp_prepare_format( BLOCKS, subject, session_label ) % Creates data structures in the desired format for processing. Groups % together sequentially-recorded blocks, indicated in input argument, % and make...
e549b65747ffbce1c27623a62130b6c47a62cb166f7f607745bb64b472b389af
MATLAB
4,768
129
function [ Faces ] = BuildFacesForSubdividedTriangle( VO, VA, VB, iAddedVerts, OverlappingVerts, InternalVerts) %BuildFacesForSubdividedTriangle VO, VA, VB defines a triangle which has %had a line drawn through the interior. %iAddedVerts contains a sorted list of all indicies that lie on the line %through the triangl...
e340ac20126d14781244558f5e6153ca47b1f92d83bcb7a49db81a11925c9632
MATLAB
4,773
119
function [fcoefs,cf]=MakeERBFilters2(fs,numChannels,lowFreq) % function [fcoefs]=MakeERBFilters(fs,numChannels,lowFreq) % This function computes the filter coefficients for a bank of % Gammatone filters. These filters were defined by Patterson and % Holdworth for simulating the cochlea. % % The result is returned...
dd52d74d7c343800a3af8c199ebe11d29c3028d30394086dbfe0ce6b75dbbffd
MATLAB
4,776
151
function [vx,vy,vfs,wvcfs] = optical_flow_model_gp_surrogate(data,fmin,fmax) % Sampling frequency (in Hz) Fs = 100; % Scale by which to downsample spatially mouseResize = 1; % Flag to use mask located in meta.traceMask useMask = 0; % Spatial selection of recording to keep (set to empty or zero to use full % recording...
1932d5d2c886f2f8dd03f5bdf4153edbe3cdab838db74dd9a3965ea6789bda22
MATLAB
4,777
208
% Generate a Dynamic Moving Ripple % % SSDMR(t,Xk) = P.M/2 * sin[2 * pi * Omega(t) * Xk + Phi(t)] % P.M = modulation depth (dB) % Xk = log2(fk/f1) octave frequency axis relative to f1 % Phi(t) = integral 0-t Fm(tau)d(tau) controls time-varying temporal % modulation rate Fm(t) % Spectral [Omega(t)] and temporal [Fm(t)] ...
125b4e8339c56e52f6c42149cfeb57020c45547f6784491c564b7bacf1f073a0
MATLAB
4,782
158
function [stats,st] = lme_fit_NR(X,Zcols,y,ni,e) % [stats,st] = lme_fit_NR(X,Zcols,y,ni,e) % % Linear mixed-effects estimation by Newton-Raphson optimization. % % Input % X: Ordered design Matrix (according to time for each subject). % Zcols: Vector with the indices of the colums of X that will be considered % as rando...
8af8a96f57d3c79e212fcfcca95fe1e52b8bdfa51d5394d3f162ab4c38fe34c1
MATLAB
4,785
180
function varargout = BasicClassifier(D,nReps,par) % R = BasicClassifier(D) % R = BasicClassifier(D,nReps) % R = BasicClassifier(D,nReps,par) % [R,Rshuff] = BasicClassifier(D,...) % % D is an MxN data matrix with M observations in N % categories. % % Optionally, the number of repetitions can be specified by the second %...
91ebb49dc33e31e56afe65f89ef7f066ec777095cd1459dca73961020d72b81d
MATLAB
4,788
125
% A tensor component-wise rescaling Metropolis-Hastings step. % Useful for slighlty faster HMC mixing - plain HMC doesn't force any components to be normalized/orthogonal and this explores the scaling dimension faster. % Important: This step assumes that the prior distributions are normal with mean 0! function [params,...
4e295b01581a4ee56fc69c089d8b2be895d7b8fa5cad15c6ca8635140fbb2e89
MATLAB
4,790
134
%% Setup util.clearAll; cur_save_dir = fullfile(util.get_paths().figs,'ANOVA_correlations'); util.mkdir(cur_save_dir) c = util.plot.getColors(); %% Anova analysis for the pairwise region correlations beta_tables_taste = util.load.all_taste_betas(); taste_names = beta_tables_taste.sep_table.Properties.VariableNames; %...
09a43d4831fcdd9f024f04543a4766574adb4ee87821b92ae38585da28002843
MATLAB
4,791
129
function Xhat = decodeCrossValidation(cfg0, X, Y) % [Xhat] = decodeCrossValidation(cfg, X, Y) % Implements k-fold cross-validation, in which a subset of trials is left out % in each iteration as testing data, while training on the remaining trials. % % cfg Configuration struct that can possess the foll...
19f52f401532416470b3fc876df360449a4083ce450a59b0725fda885d1e2302
MATLAB
4,791
73
function AnalParams=GetAnalParams(AnalType) % Retrieves parameters specific to each analysis type. % % INPUTS: % - AnalType: string label of the analysis to be conducted. % OUTPUTS: % - AnalParams: structure of analysis parameters. % % Default analysis settings are set for a standard 'Full' analysis o...
3675f0908934aee3ec7ad32233fc04e721dbd5f47801932fcbe88e419f78a092
MATLAB
4,792
118
% clc; clear; close function [Partial_coef, Yhat, pval] = MR_Heading(Y,X,selvar) % y = b1x1 + b2x2 + b3x3 + b4x4 + b5 % let's take data stored in matlab exemples % load hald; % Y=hald(:,5) ; % X=hald(:,1:4); X(:,[1,selvar]) = X(:,[selvar,1]); % get a solution, X = [X ones(length(X),1)]; B = inv(X'*X)*X'*Y; % ...
0415760bff8dce845c56dd8fccb4a29806fe4ffbf03e72b7900733b0e9589fcd
MATLAB
4,801
92
%-------------------------------------------------------------------------- function [val, formulaArray]= f_testsyntaxtype(FormulaArrayIn, whocall) val = 1; formulaArray = FormulaArrayIn; if isempty(formulaArray) return else formulaArray = strtrim(cellstr(formulaArray)); end nformulas = length(formulaA...
a4b4b2afa60d849198ea59bd6a585fa2b84651b62822271db18eb156a5de12ed
MATLAB
4,801
143
function [qe,Ee,Se,Sev] = qeq4e(En,Ge,Ue,Sn,Set,Xe) %*************************************************** % QeQ4E: % Evaluates the stress and strain for the current % displacements. Creates the element internal % force vector for elastic quadrilateral 4-node % element in plane stress or plane strain. % If Xe c...
ef0cc814adc8f3868866e665d067f5cac5c36dc44506637c1ef01559ece0802e
MATLAB
4,804
162
clc;clear;close all; Fig9a = figure(); N_mu=50; %There are \mu independent embedded patterns, 500 simulations (number of simulations) %R1: with pre-synaptic competition %R(1,1): 4 post-synaptic neurons %R(1,2): 5 post-synaptic neurons %R(1,3): 6 post-synaptic neurons %R(1,4): 7 post-synaptic neurons R1=z...
175c2517d114c94cd8254b9eb9e18971d22c6241bd40f54b792e622499cd8e24
MATLAB
4,811
147
function [checks,varargout] = dlRNN_Pcheck_transfer(activity,filt_scale,varargin) option = 'state_simple'; % trans_prob = 'non-linear'; trans_prob = 'pass-thru'; plotFlag = 0; reaction_time = 100; if nargin==2 reward=[1*ones(1,1600) 100*ones(1,1400)]; back_p_logic = 1; else reward = varargin{1}; back_...
fac8ea743f89ce23c9b9f06f7686837ab820dd203439ebdb7fd60133965b93c3
MATLAB
4,813
180
clc; clear; close all Fig8a_b=figure(); rng(2^23) N_psn=1; % number of post-synaptic neuron resy = 0.0; % resting potential threshy = 1; % threshold potential NN = 500; % number of afferents i_t=randi(500); %i'th trial (choose the i'th trial randomly.); p1=randi(20); percI = 0.2; % inhibitory...
c0ba6934fccb12ff89cc52345127f65bdc79a0df5d5b3823ebcfd36793601bf8
MATLAB
4,818
126
function Assemblies = MakebestSUAssems(RankIn_,ScoreIn_, Ltrials_,Rtrials_,MaxSize,DestroyNoiseCorrs,noTrials,nReps) %@TODO: add shuffling of trial labels between cells to non- trial-resampled version Areas = {'PFC','HP','Joint'}; InfoCriteria = 'max'; verbose = false; Ltr = size(Ltrials_{1}{1},1); noUnitsReal ...
cd948c160238b1f1800257f5ede1fd0aea2b5ec57aba49e083ca657d74fa0a47
MATLAB
4,820
203
function SCRATCH_DB_RRTF if isempty(which('circ_r')) a = repmat('*',1,60); fprintf('%s\n\tRRTF requires the CircStat toolbox for Matlab\n%s\n',a,a) return end %% IDs = getpref('DB_BROWSER_SELECTION'); st = DB_GetSpiketimes(IDs.units); P = DB_GetParams(IDs.blocks); %% win = [0 0.55]; awin = [0.0 0.52...
bc0271eba3218018c59d55affbb6bb10cf8900df94b8d60ef82f674567fdaea4
MATLAB
4,826
135
function [CVE,... time-dependent mean decoding score [No. Timepoints x 1] Score,... Time-averaged/Peak decoding score, depending on InfoCriteria [1 x 1] Score_Shuffled,... Median Time-averaged decoding score from shuffled trials, [1 x 1] Score_ShuffledCIL,... 5 percentile...
8c46f644e804a4cb7b67bd34a2e75f1d7c02c950ad055c4e2aa793d42997fa10
MATLAB
4,832
192
function [Hits,FA] = Population_Decoder_SVM_PSTH_v2(Data1,Data2,tau,prop_trials,convolve) if nargin < 3 tau = 10; prop_trials = 0.80; convolve = 0; end if nargin < 4 prop_trials = 0.80; convolve = 0; end if nargin < 5 convolve = 0; end Nogo = Data1; Go = Data2; num_iterations = 250; % number of decoder i...
8488cc456cce41efc04dda4d55773513e2789dfda514d723bacdb4f172733957
MATLAB
4,836
111
%NEED TO CHECK function [PARAMETERS,trials]=initialize_FlickerMemoryTask() %% Establish memory task parameters PARAMETERS=set_PARAMETERS(); %set to day 1 parameters %% Pick and images we'll need for practice, study and test: num_images=PARAMETERS.num_practice_images+PARAMETERS.num_study_image...
bdc1270033b9420c31c099aaf639ba0c8b2369c0fd7e4981e118f6bdab99d371
MATLAB
4,838
108
function out=driftcorrectbycorrelation(parameters, input) % DRIFTCORRECTBYCORRELATION - Perform drift correction by correlation % % DRIFTCORRECTBYCORRELATION(PARAMETERS, INPUT) % % PARAMETERS should be a structure with the following entries: % prompt_user (0/1) Should we prompt the user every tim...
01d10a9a4de53a247af1a2550750afceb4740dd21949d53b7af7dee4e81aaf61
MATLAB
4,840
159
function [go_indices,nogo_indices,varargout] = ... getIndices_SanesLab(TRIALS,remind_row,trial_type_ind,varargin) %Custom function for SanesLab epsych % %This function will update valid trial options based on the user's %selections in the GUI % %Inputs: % TRIALS structure % remind_row: index of the reminder tri...
6040b08360a69c24dd20d77ba2d1f95f564525ec2ce42cee9c0ea5dce76c96fc
MATLAB
4,840
122
function [endo] = import_endo_geom(direndo, fendo, cross_pl) % IMPORT_ENDO_GEOM Imports the nerve's endoneuria contours. % The code import the .STL files of the nerve's endoneuria and convert % the geometry file in a tomogrpaphy representation of the 3D scapes of the % endoneurium % All the imported contours ar...
9ab37fa49f4d3190a7b499b91a125be76f83a5fb34a8f538c3db9db6295c61f8
MATLAB
4,844
133
%% Multimodal IMS Multivariate Analysis Script % This script concatenates (registered) IMS matrices and exports them for % multivariate data analysis in SIMCA software. In a second step scores % images from MVA are reconstructed from SIMCA scores export. % % (1a) Supply at least one dataset and m/z vector for i...
56455ed18a5498b1ba4412eb21a8f6599200dd04164fb032778c5fb21d1dc8de
MATLAB
4,848
191
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% read in proc spreadsheet % filename = [ DD_PROC '/MamiNum_corrected_proc.txt' ] ; % ssheet = readtable(filename,'Delimiter','\t') ; % % animal_names = regexprep(ssheet.file_prefix,'...
79a6a52c16b31b8c439c3fe7b892d371c4a349c5d0dd1a2f45bc3c759c9cd91a
MATLAB
4,848
228
function varargout = DB_ManageAnalysisTools(varargin) % h = DB_ManageAnalysisTools(varargin) % Edit the above text to modify the response to help DB_ManageAnalysisTools % Last Modified by GUIDE v2.5 19-May-2016 08:43:44 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', ...
491c0efed744ffa1a1c3d07b6616d548333cbb824dfce39ed19efe303b49fe90
MATLAB
4,850
139
function TCS2 = initialize_TCS2_NI(samplingrate) % This function requires two NI devices (Dev{i} and Dev{j}, i \neq j % in {1,2,3}). % Allows to control the 5 stimulation zones of TCS2 separately. % %Analog OUTPUTS on DEV1 : %DEV1/AO1 : neutral temperature %DEV1/AO2 : active temperature zone 1 %DEV1/AO3 : ac...
88427477177250694e907144cc44de06f9e557fe74cbcd06178f56cc90a1bcaf
MATLAB
4,852
156
function p = DB_GetParams(id,type,conn) % P = DB_GetParams(id) % P = DB_GetParams(id,type) % P = DB_GetParams(id,type,conn) % % P = DB_GetParams(id) % Simply retrieves parameters from the protocols table into structure P. % If only the id is specified, then this function will assume it is a block % id. % % ...
0489e6d6cf05d612caae53b9f9d632aa058ba404a983fbef5343e8adac2c4747
MATLAB
4,854
155
% Note: very preliminary alfa version. Only for testing purpose. May 2008 % % Usage: % % >> [EEG com] = pop_emghunter(EEG, chan, evecode, newcod, twin, thres) % % HELP PENDING for this function % Write erplab at command window for help % % See analog2code() % % *** This function is part of ERPLAB Tool...
5144bbc5928cd61ce3e74ab6e32bf7a13a26800d5510b34c32544e3e1a779195
MATLAB
4,854
163
function my_histograms(data_struct, varargin) % Plot histograms of input data. % % used in TSL_fit_on_ratings. % % data_struct % Structure array with one entry per group of data, which will be % associated with a different histogram. Required fields: % 'x' for the data set. n_gr = length(data_st...
b9947fa6fbe3c7a2f04dd9a00296d9b8870861dac2ebfb8d0c90922f271b191c
MATLAB
4,863
171
function pp_plot_rasters(subject, session, channel, clu) % % pp_plot_rasters(subject, session, channel, clu) % Plots a raster and psth for each unique stimulus. Clu is the label % given by UMS (not an index), found in Spikes.sorted.labels. % % KP, 2016-04; last updated 2016-04 % set(0,'DefaultAxesFontSize',...
d588eec9cd2944f376bb8475661948920766627ab842440763908772eb143a17
MATLAB
4,864
106
function Assemblies = MakeAverageAssems(unitIDs,Ltrials_,Rtrials_,MaxSize) Areas = {'PFC','HP','Joint'}; ResampleTrials = true; InfoCriteria = 'max'; nReps = 10; % Draw from trials nDraws= 10; % Draw from unit pool noTrials = 20; % how many trials to use for each decoder verbose = false; Ltr = size(Ltrial...
8181491000289b37b128100af4d17c2f6b61bd9eb7e39a3d750a1a87202c1fbf
MATLAB
4,872
167
function [tfVMVariates] = vmrand(fMu, fKappa, varargin) % vmrand - FUNCTION Draw random variates from the Von Mises circular distribution % % Usage: [tfVMVariates] = vmrand(fMu, fKappa) % [tfVMVariates] = vmrand(..., M) % [tfVMVariates] = vmrand(..., M, N, P, ...) % [tfVMVariates] = vmrand(..., [M...
8a29b2902b93998d11d9a093e3ec37140d027ebac40e3f34122109b401edb1ed
MATLAB
4,877
132
function result=psignifitCore(data,options) % this is the Core processing of psignifit, call the frontend psignifit! %function result=psignifitCore(data,options) % Data nx3 matrix with values [x, percCorrect, NTrials] % % sigmoid should be a handle to a function, which accepts % X,parameters as inputs and gives back a ...
aa06e4962132629ee11934f6d5148c8254983862767fffd58b735bea06f9d340
MATLAB
4,877
181
function self = EvaluateNetwork(self) verboseLevl = self.VerboseLevel; if verboseLevl > 0 fprintf('Evaluating network...\n') end summaryT = table(zeros(3, 1), zeros(3, 1), ... 'VariableNames', {'Accuracy', 'F1'}, ... 'RowNames', {'Train', 'Validate', 'Test'}); classScoresS = struct; % TRAIN if verboseL...
26c41b9c27edadf64d40ace9e5d7dbd47044760ddc3a0ebad53eb8bb3dc9cab9
MATLAB
4,879
100
% % sourceSignal=PRODUCEEXPERIMENTSIGNALS(experimentType,duty_cycle_LED,duty_cycle_sound,sound_frequency,type_of_burst,sample_rate) % % Produces a structure that provides information about trials of sensory % flicker stimulation, to be eventually run on the NIDAQ. This is the % data that the apps "SafetyTesting" and "R...
85dde75af8b1fdbe4a89c51532442f10d18432bf4d09e1d8a6c0339d8557f6bd
MATLAB
4,888
155
% Nodes are somewhat similar to layers in that they have "activity" values, % have outputs, and can connect to layers via projections, but they are governed % by arbitrary functions or code. They typically provide control or timing % signals % % % Properties % vals - vector of values, analagous to activiti...
9a8afac8efe0926c91e4430aeb374bf3869fd2baeaf44d628e2ef542420f27f0
MATLAB
4,889
123
%% clear all close all run(['..' filesep 'def_local']) addpath(path_fieldtrip) ft_defaults %% load wsws_ERD elec = ft_read_sens(path_chanlocs); cfg_neighb = []; cfg_neighb.method = 'distance'; neighbours = ft_prepare_neighbours(cfg_neighb, elec); cfg = []; cfg.method =...
d63b6df31c441e770e2c4f58eed43e460cb02e1bcb1acf2caf9c2131e2d153df
MATLAB
4,889
189
function varargout = TC4controller(varargin) % TC4CONTROLLER MATLAB code for TC4controller.fig % % Daniel.Stolzberg@gmail.com 2016 % Edit the above text to modify the response to help TC4controller % Last Modified by GUIDE v2.5 28-May-2016 18:01:31 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_Sta...
6010c97fd02688129d1bc85376d60847cddcdb2e33bb05f79a98c1826d377906
MATLAB
4,891
165
function [results] = computeLogLikelihood_host_v2(obj, params, opts, results) obj.setupComputeStructuresHost(); if(nargin < 4 || isempty(results)) results = obj.getEmptyResultsStruct(opts); end LL_info = obj.LL_info; X_groups = obj.X_groups; X_lin = LL_info.X_lin; Y = LL_info.Y; dt = LL_info.bin_size; dim_N_r...
402cda2cbf059dd54261e51d240738e55cbf85cdb6af8e5a5a755b1efe2c8309
MATLAB
4,899
104
% Explores behaviour of Assemblies in Pre-sleep/Task/Post-sleep epochs % % Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk % % NB Run Explore_Factor_activations.m first for each of Pre/Task/Post datasets. % % NB currently this code assumes that FA Assembly detection is run for each % experim...
7b67e65de822b14834d541c34c39ed1c8bce9a52db3d916fdbe7b79ed28c6e41
MATLAB
4,900
130
% drawing violin plots for RMSE values across various surfaces, foot, % methods (Linear regression, ANN, and LSTM), and MoCap outputs (Flexion % and Inversion) % RMSE results are saved in a cell array (4,3) called "results", and each cell again is a cell array(1,2) for % keeping RMSE results from the right and left f...
08d190ad2b38628f112a0d1d2be97dda4f3fa296724372c93e6f5fc0131fca39
MATLAB
4,907
90
% % Reorders an electrode table or file according to the row order of channel names in a channels.tsv table or file % % This is relevant because the channels.tsv channel names match the electrophysiological data channels, but the rows in % electrodes.tsv are often arbitrarily sorted. Therefore the electrodes.tsv ...
814fea6623ed189947131cd1ff1d8171ce38e844aa2d8f96a7f05cf55ca88712
MATLAB
4,909
168
clc; clear; close all rng(1101) Fig1=figure(); i_t=randi(500); %i'th trial (choose the i'th trial randomly.) N_psn=1; %number of post-synaptic neuron desired_S = 2; % desired number of spikes r0 = 2 Hz w_max = 1; % maximum amount of synapsis. resy = 0.0; %resting potential threshy = 1; % thresh...
64c497e9d322f79ef40fc7d4a84b5f358eef362edcdfa7276ffdb1235802e739
MATLAB
4,912
180
function [w, infos] = shooting_lasso(problem, options) % Shooting algorithm for LASSO problem. % % Inputs: % problem function (cost/grad/hess) % options options % Output: % w solution of w % infos information % % This file is part of SparseGDLibrary. % % Created by H.Kasa...
4df15b5bd193d2c6019462858d26d4ffd9c1c8b25cbe48fc42f30b79c503e0e5
MATLAB
4,914
113
function m_tilde = get_M_9x9_from_d_c_SL(d,c,l,D0) % % returns the 9x9 form of the matrix M from the 3x3 and 3x3x3x3 tensors % dij = eye(3); dij_1x6 = convert_3x3_to_1x6(dij); DijDkl = D0^2 * convert_1x21_to_3x3x3x3(convert_1x6_to_1x21(dij_1x6)); % this is D0^2IijIkl - Mijkl % switching to Magnus convetion for the l...
85805339e5a8a1869ff746f4b3c255f07f2160ba55c0595d89d35cf802ad7815
MATLAB
4,917
149
function EyeTrackGUI(varargin) % EyeTrackGUI('Parameter',value,...) % % 'X_UB' ... X axis Upper Bound tag name % 'X_LB' ... X axis Lower Bound tag name % 'Y_UB' ... Y axis Upper Bound tag name % 'Y_LB' ... Y axis Lower Bound tag name % 'P_LB' .....
0dcb5d8e7c867ccd1288986d76545484c9657e3e7f573313d94327c23b08254d
MATLAB
4,929
118
clear Targets = {'SHORT','MEDIUM','LONG'}; Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; Dirs = {'Left','Right'}; bw=0.05; if ispc pat = 'C:\Analysis\AssemblyAnalysis\raw'; cd(pat) fileList=dir('allTimestamps\*.mat'); elseif ismac pat = '/Volumes/HDD2/DNMTP/raw/'; ...
433b93d9c9ecc13b6d44920450f04c1eec2b66b85e4c3f8eec3ef0ea43a4a633
MATLAB
4,930
132
function [result,indimages] = tpsinglecondition(dirname, channel, thetrials, timeint, sponttimeint, plotit,name) % TPSINGLECONDITION - Simple image math % % [RESULT,INDIMAGES] = TPSINGLECONDITION(DIRNAME,CHANNEL, % TRIALLIST,[T0 T1], [SP0 SP1], PLOTIT,NAME) % % Computes simple image math for twophoton imag...
009148527bf019bb917259748d47e893ed3b60c10caae33b4630fd5c4d800301
MATLAB
4,934
124
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(TABLE), VIOLINPLOT(STRUCT), VIOLINPLOT(DATASET...
2b8c5acb610ab372568f3d04800470a79f724437b094d8519200f68f3b933174
MATLAB
4,940
205
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); VIZIT = 0 %#ok<NOPTS> %% big loop for tDx = 1:length(THRDENS) %% filename = [ DD_INTERM '/con_mat_gn_repani_stack_thr' num2str(THRDENS(tDx)) '_.mat' ] ; ll = load(filename) ; c_aCon...
00db7194acd1e4a210bb64a07618a6fd99dd8f5d12ec203c70eed8e45fae23e4
MATLAB
4,943
144
function Phase_sync_metrics_reduced %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % LEADING EIGENVECTOR DYNAMICS ANALYSIS % % % Function to compute the META and VAR % anaysis for all subjects % % % Fran Hancock % Oct 2022 % fran.hancock@kcl.ac.uk % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Run seperately for run1 (CON) and r...
8d0b21f8f3779eebd357d14eba56bcf318a9dacd660bed5078a107595bae2256
MATLAB
4,944
156
%% % Compares continuous L/R discrimination during the delay period, % calcluated on short/medium/long delay trials independently %% %%%%%% PREAMBLE %%%%%% clear Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; DelaysDur = [4,8,16]; Target = 'LONG'; tlimsAll = [-30 30]; tlimsTrials = [...
ea28dcf4c8d7c4e1d464315c7ba225056d3580f78a16802802d3d4b64b107f83
MATLAB
4,947
153
%% %%%%%% PREAMBLE %%%%%% clear Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; Target = 'LONG'; shift = 0; plotOnline = false; bw=0.05; Nbs = 500; warning ('off') if ispc pat = 'C:\Analysis\AssemblyAnalysis\raw'; else pat = '/Volumes/HDD2/DNMTP/raw/'; end cd(pat) fileList=dir(sprintf('Mixe...
644f7e6989b826c867bdc8dc4d80e4e1dae6818e136063287947cae4c8e14f8e
MATLAB
4,953
105
% % Extract the conditions from the BIDS events % [stim_pair_nr, stim_pair_name, stim_pair_current] = ccep_bidsEvents2conditions(events_table, events_include) % % events_table = loaded table with bids events % events_include = optional vector with included trials, set to [] if using ...
4718035ffabea37e334a483dc9c15655d8febaeb5acb94b366ca718352f96fb2
MATLAB
4,964
169
function varargout = f_ERP_suffix_gui(varargin) % F_ERP_SUFFIX_GUI MATLAB code for f_ERP_suffix_gui.fig % F_ERP_SUFFIX_GUI, by itself, creates a new F_ERP_SUFFIX_GUI or raises the existing % singleton*. % % H = F_ERP_SUFFIX_GUI returns the handle to a new F_ERP_SUFFIX_GUI or the handle to % the exis...
157dd9a88ad880de61f4e3de34d6527de574e2bd2be8c80aea855ee38f15a0fb
MATLAB
4,965
139
% Example script % step 1. simulates activity over time in V1 in condition 1 and hMT+ in % condition 2 for a montage with 32 electrodes. [go directly to next steps % for examples in using the toolbox] % step 2. the templates corresponding to the 32 electrodes montage are % created using createCustomTemplates. (For ...
c83176fc03b63bcf242b087376374a4dfd4f2a5bdd9c250e257035703d1f45b3
MATLAB
4,966
102
function Parm = Parameters(DSETnum) % Paramaters for the DeepInsight-3D model Parm.Method = ['tsne']; % 1) tSNE 2) kpca or 3) pca 4) umap 5) lda (supervised) Parm.Dist = 'euclidean';% For tSNE only 1) mahalanobis 2) cosine 3) euclidean 4) chebychev 5) correlation 6) hamming (default: cosine) Parm.Blur = 'no'; % type '...
a9d48214ab09104108f0813669854d3c3157bf4c008270bfa2453e44dc6ae263
MATLAB
4,980
246
function varargout = ep_BoxFig(varargin) % ep_BoxFig % % Default figure for displaying behavior results during runtime. % % Daniel.Stolzberg@gmail.com 2014 % Last Modified by GUIDE v2.5 12-Aug-2014 14:20:27 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ...
95bd7f42e152905fb7e673f9cd518dad9ddd724698beed2728930bbed7831cf3
MATLAB
4,981
127
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(TABLE), VIOLINPLOT(STRUCT), VIOLINPLOT(DATASET) % p...
2839b08614a3e5f58f9918f08e990cfe4ae4ae20eddaf712f1ef53196f077e9f
MATLAB
4,982
198
function [phi, C] = solve_system(G, mesh) %[phi, C] = solve_system(G, mesh) % Set up matrix for phi A = set_up_phi_matrix(G, mesh); if strcmp(G.solver_type, 'iterative') [LA, UA] = ilu(A); end T_phi = 0; T_matrix = 0; T_c = 0; % Set up initial conditions if isfield(G, 'initial_states_set') c = G.initial_sta...
81de693e849e41895dfe577d51974c805246c066acc50ec5d4ac93908cfaff45
MATLAB
4,982
123
% pop_runhtb() - Run history template on multiple data files. % See runhtb for more details. % % Usage: % >> com = pop_runhtb(execmeth,HistFName,HistFPath,BatchFName,BatchFPat); % % Inputs: % execmeth - Execution method. "serial" = run batch serial mode using % for loop, "parallel" = r...
8b833faac95bec8841d9bd2ace4e284209d476dc11d479c95b0b30192b32115e
MATLAB
4,982
206
function NeighboursInd = findNeighbours(Index,MatrixSize ,conn) %%************************************************************************** % Module name: findNeighbours.m % Version number: 2 % Revision number: 02 % Revision date: 9-2018 %% % 2013 (C) Copyright by Patrick Granton, Maastro Clinic % Pe...
b4bc57ea7380585cdf3ed41ad08c0bef83a1aa34c6a5818a0942b2926c12f297
MATLAB
4,987
193
function [w, infos] = ista(problem, options) % Iterative soft (shrinkage)-thresholding algorithm (FISTA) for LASSO problem. % % Inputs: % problem function (cost/grad/hess) % options options % Output: % w solution of w % infos information % % This file is part of SparseGDL...
44281af9771cde4c641cc9c3834cf81c4ccba87deaa1b158901f7602a54bf3c3
MATLAB
4,990
144
function [] = write_latex_table_latencies(row_names, all_data, filename, ... col_names, col_header, caption_str, empty_nan, h_mask, h_mask_corr,... permission,table_label,varargin) % write in a txt file the data from all_data so that it forms a table when % pasted in latex. % % In: - row_names: string arr...
6198b990a2ecdcd8f24d9de3af4a5fc470b13c9974bbd7edf1aacb2fa600bdd4
MATLAB
4,996
206
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); VIZIT = 0 %#ok<NOPTS> %% big loop for tDx = 1:length(THRDENS) %% filename = [ DD_INTERM '/con_mat_gn_repani_stack_thr' num2str(THRDENS(tDx)) '_.mat' ] ; ll = load(filename) ; c_aCon...
d33bccb19ac4cf419b2d841bc250a963d32151cb4715eaf3a4092e1134cdef8b
MATLAB
5,008
160
function fstats = lme_mass_F(stats,CM,prs) % fstats = lme_mass_F(stats,CM,prs) % % Inference for the fixed-effects in the linear mixed-effects model. Allows % to test a different model at each voxel/vertex (Depends on the Statistics % toolbox). % % Input % stats: Structure array containing statistiscs for every voxe...
4d747353bcca08402aca9d45d03c9e053c605c0926e07526c8a3d22af55fd4db
MATLAB
5,009
199
function varargout = TDT_TTankInterface(varargin) % TDT = TDT_TTankInterface % TDT = TDT_TTankInterface(TDT) % TDT = TDT_TTankInterface('server','SomeServer','tank','SomeTank') % h = TDT_TTankInterface(...,'maintain') % % Select/Create TDT server, tank, block, etc. using TTankInterface ActiveX % GUI % % TDT output is a...
0a4a2a6905420b0054161570b74ba5c3ed73d1d9f94d27eeeb84adfface89df2
MATLAB
5,015
156
classdef stateSpace < handle properties transitions curState stateLog = [] adjacencyMat = []; numStates = 0; timeInState = []; rewards = []; numRewards=0 end methods function obj = stateSpace(transitions, curState, rewards) ...
17e81c19ee9821f627e716babda3d8cb66419d8690d49b0fe73f7764c7e04de9
MATLAB
5,015
213
clearvars setUpPaths %% for len=1:23 processData %% clear ExpectMeaned Sig trials=StoreType==1 & NewSupriseStore1==1; %% tempOris = StoreX2(trials); tempData = Store(trials,:,:); %% create the design matrix Orientations=0:30:150; ...
fc6a9be95b1d21cb01fb63a5e3a1059745ab3af7d00f2b2500487b0e44b03374
MATLAB
5,019
112
function CrossNobis_Distance = SqrtCrossNobis_Distance(measurementsA, labelsA, measurementsB, labelsB) %this function calculates the crossvalidated mahalanobis (i.e., "crossnobis") %distance between the conditions specified in labels across the values specified %in measurements, cross-validated across se...
4817e6648f88750256de2ab1c56936926943d2c57798e09feeff8dc673688694
MATLAB
5,021
126
function crop_raw_stack(substack_depth, overlap, dx, Nnum, range_adjust, z_sampling, ... rotation_step, rectification_enable, rotation_enable, compstack_enable,... flipx, flipy, flipz, file_path, file_name, save_path, bitdepth) % CROP_RAW_STACK crops the HR data in depth and augments the dataset % crop_raw_st...
052147aa89a73785bf6968d8085d89df0612d43d22d4ce63bc937e94ae86cb2e
MATLAB
5,023
128
%% Flexible Capacity Serial System % A parallel-serial processing system where a part of the system is a % limited pool of central resources that can be flexibly assigned to % modules. % % 3 December, 2021 function [finalRate,input_record,output_record] = FlexibleCapacitySerialSystem(systemCapacities,taskModifiers...
ff0dce48c0be648b72171f23bbee8252ff498787bed59cde2eee1363c5fbf3fa
MATLAB
5,025
127
function find_placement_comb(iSubject) % find_placement_comb(1) % iSubject = 1 for Subject1, 2 for Subject3 [numFibersAtPercepThreshold, placements, endo, percepThresholds, expAS, fascicle, sensation, center, ratio] = ... fascicle_for_perception(iSubject,false, 13); % numFibersAtPercepThreshold(iOrientedPlac...
252c41d516b533634e585a354f7656045d3ede7a42844e0da7529ab3ecc15020
MATLAB
5,029
93
% MYM - Interact with a MySQL database server % % Copyright notice: this code is a heavily modified version of the original % work of R. Almgren from University of Toronto. Up to V1.0.9 the code was % made by Y. Maret (during his work at EPFL). Version 1.36 was updated % by J.T. Marsh and provided by J. Erlich. % % I...
313e83cf50582fc337a51cf38308c86bcdb9fc7523633ecfb88e5a212e114af7
MATLAB
5,037
174
function PPlot(Locs, LocLinks) iID = 1; iParentID = 2; iX = 3; iY = 4; iZ = 5; iRadius = 6; numCirclePts = 24; CircleVerts = CirclePatch(numCirclePts, 1, [0 0 1]); Faces = CylinderFaces(numCirclePts); numLocs = size(Locs,1); numLinks = size(LocLinks,1); ...
3bdff70852fbcf89dcfcfa301b2405a588c4e1175d82eac1ec8fe591f3ce5cc9
MATLAB
5,038
147
%% clear all close all run(['..' filesep 'def_local']) %% allfiles={'405','406','407','408','409','410','411','412','413','414','415','416','417','418','419','420','421','422','423'}; nc=0; allres_clarity=[]; for n=1:length(allfiles) files=dir([behav_path filesep 'SWS_NVS_results_S' allfiles{n} '*.mat']); l...
82cb31b38c19275d95d1d5ed6a895836c636790062ede6e757e32aee8bf02632
MATLAB
5,038
156
function [EI,Pth,Qthth] = lme_mass_RgEI(X,Zcols,W,CBhat,L,phi,ni,invG,GDa,GDb) % [EI,Pth,Qthth] = lme_mass_RgEI(X,Zcols,W,CBhat,L,phi,ni,invG,GDa,GDb) % % Expected information matrix of the restricted log-likelihood of a whole % region. % % Input % X: Ordered design Matrix (according to time for each subject). % Zcols...
5c7047db2bd03fcc19baf05c838a1f06bcc8f68e697c7ae71a734e5ffcd47fe6
MATLAB
5,039
138
function spikes = ss_align( spikes ) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/2010 % % ss_align - Multi-channel alignment of waveforms on negative peaks % % Usage: % spikes = ss_align( spikes ) % % Description: % This function uses spline interpolation in order to find the true peak % ...
1c92730de6b9b95e07c8982ec85abee123781aafc83233fecbf16a6b2221caa8
MATLAB
5,040
111
% Demonstrates how to use the property pane. % % See also: PropertyGrid % Copyright 2010 Levente Hunyadi function example_propertygrid properties = [ ... PropertyGridField('double', pi, ... 'Category', 'Primitive types', ... 'DisplayName', 'real double', ... 'Description', 'Stan...
25b892144b27fb457e30992ba1425afbaa5876ac5843e00257d9dd1aa14fe8be
MATLAB
5,057
180
function subPlot_Gen(x,y) %Creates a 4x4 grid of subplots and graphs each angle separately, followed %by graphing all of them on a single subplot. x2 = x((x(:,2)==1),:); figure('Name','Trial-By-Trial Accuracy') colorArray = jet(15); for i = 1:length(y) if y(i,5) x3 = x2((x2(:,1)==i),:); switch x3...
ca4c155a39d68305aa890f857761291af6a799a06363921f98f0836bad01144f
MATLAB
5,066
166
% File: GetOMEData.m % Author: Sebastian Rhode % Date: 13.09.2015 % Version: 1.3 function OMEData = GetOMEData(filename) % % Get OME Meta Information using BioFormats Library 5.1.10 % To access the file reader without loading all the data, use the low-level bfGetReader.m function: reader = bfGetReader(filename); % Y...
5c96e4c23e169293d24f8f099a9dbb201ac88552c418282e48eb9a7667bbed92
MATLAB
5,081
160
function [stats,st] = lme_fit_EM(X,Zcols,y,ni,e) % [stats,st] = lme_fit_EM(X,Zcols,y,ni,e) % % Linear mixed-effects estimation by expectation maximization. % % Input % X: Ordered design Matrix (according to time for each subject). % Zcols: Vector with the indices of the colums of X that will be considered % as random e...
70ca28dd021fba01b4fcad9fa5a81cc51c819ba42ff93bea5de6cfd2e1cd41b3
MATLAB
5,090
189
function [Genes,Genes_compressed,G]= func_FeatureSelection_avgCAM(Parm) % Feature selection of DeepInsight-FS model = load('model.mat') %netName = "squeezenet"; netName = Parm.NetName; cd DeepResults net = load(model.fileName); cd ../ % netName = net.trainedNet.Layers(2).Name; % Oblique = '|'; % [rmp,cmp] = max(netN...
f7693c3b134c82e2cc72221d39de0c7157967362d1c306bc95005586ab14c876
MATLAB
5,096
178
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% setup vars thr_vals = [ 0 0.05 0.1 0.15 ] ; odir = [ PROJ_DIR '/reports/figures/commspace/' ] ; mkdir(odir) for tDx = 1:4 %% some viz stuff labs = { 'Efficency' '-Searchi...
689271cedff660a471a27ca7959421228119fdcc01ece0edd7ba831385ae8de1
MATLAB
5,097
158
function [EI,Pth,Qthth] = lme_mass_RgEI1(X,Zcols,W,CBhat,L,phi,ni,G,GDa,GDb) % [EI,Pth,Qthth] = lme_mass_RgEI1(X,Zcols,W,CBhat,L,phi,ni,G,GDa,GDb) % % Expected information matrix of the restricted log-likelihood of a whole % region. This is less computationally efficient than lme_mass_RgEI % but more numerically stabl...
d81e601cafa6456781e0c65def467ba4a7d6e5989b46c3714df976aa1eae6eba
MATLAB
5,097
177
function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be left em...
965011c27585137e00010fc4f5c4cfc99253cb150d2d28a998fe4e333fdecc18
MATLAB
5,102
152
function varargout = Appetitive_Training_Menu(varargin) % This GUI lanuches a menu that allows a user to select a % appetitive training paradigm. Paradigms are as follows: % % Pure Tone Training Stage 1: % A pure tone is generated by default. Water is available at the spout % as long as the pure tone is on. The ...
1e6189a865fac469c223bbc24981c268e8b2e62bb9626df1f2dccbc3c21b40fc
MATLAB
5,106
186
function pp_plot_rasters_Freq(subject, session, channel, clu) % % pp_plot_rasters(subject, session, channel, clu) % Plots a raster and psth for each unique stimulus. Clu is the label % given by UMS (not an index), found in Spikes.sorted.labels. % % KP, 2016-04; last updated 2016-04 % set(0,'DefaultAxesFontS...
bf04f2c8f6a7325221d881b6aa10963435b55127f36a83d69e82fd87643f3933
MATLAB
5,110
142
%% Determine when decisions are made during an OH/OHA/TOH/TOHA trial % Produces lists of decisions in an OH/OHA/TOH/TOHA trial based on two % criteria: actions represent decisions, so any contact with an object is % evidence that a decision was made; and that decisions are made on state % changes in the trial. % C...
f7b189b4be0ccdd5485a9716250b6c8ad9d2f59adcb2be750295cb3c580687e0
MATLAB
5,120
118
clear; % Plot perceptual thresholds from experimental data [rootDir, dataPath, dirNerve, dirPops, dirElecs, dirFEMs, ... dirPots, dirDist, dirMRG, dirRecrs] = get_base_data_paths(); load(fullfile(dataPath, ... 'Validation\perceptual thresholds\perceptual threshold experimental data.mat'), ... 'p...
47a77053c9aa6cf0747669696e6fbd4d580b9e7b608c2e1b5f76208f8b43e4f7
MATLAB
5,128
211
function varargout = ep_SchedWAVgui(varargin) % ep_SchedWAVgui(callingh,filestruct) % % Daniel.Stolzberg@gmail.com 2014 % Copyright (C) 2016 Daniel Stolzberg, PhD % Last Modified by GUIDE v2.5 03-Aug-2014 15:34:21 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfi...
9fa258b9c59d69a97ecc414b57a2a1dacbace5676459f0487e63f9dd71b16686
MATLAB
5,128
179
%function FM_sweep_testing() % close all; % Define RCX file handles.RPfile = 'C:\gits\epsych\UserFiles\SanesLab\RPVdsCircuits\Sandbox\KP\AM_jitter_pulse.rcx'; %Load in speaker calibration file pn = 'C:\gits\epsych\UserFiles\SanesLab\SpeakerCalibrations\'; fn = 'rig1012-CeilingB_Noise_Mar072016.cal'; fidx=1; % [fn,...
25cfca90b41ba290ab6e6839e5a5c00be3321e8c6fa5123820ddd5b06a44dfbe
MATLAB
5,133
131
function [p,mu,stdev,n,x] = undetected(w,threshes,criteria_func) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/201 % % undetected - estimate fraction of events that did not reach threshold % % Usage: % [p,mu,stdev,n,x] = undetected(waveforms,threshes,criteria_func) % % Description: % Estimat...
e2c552504851f1f912a4f8e6458fa00f8af106a95a67269942fcec82480f1170
MATLAB
5,150
241
function RunEuclideanDistanceClassifier %-Stores Data-%. Created 07/21/2017 JDY-% clear all close all clc if( isunix ) Path = '/Volumes/JUSTIN EXHD/DataStore/'; else Path = 'E:\PROJECTS\DataStore\'; end Gerbil = GetGerbilIDs(Path); %---Run Analysis---% N = size(Gerbil,1); for a=1:N gerbil = Gerbil(a,:...
a142d99c21273ceb0f46b09fe8103c4354bda59eaef46a15dd4cb122ac734fbc
MATLAB
5,160
148
% Decode Left/Right preference of assemblies. % % Reports decoding metrics of both each assemblies and assebly population % with both F-score and Cross-validation error metrics. Bootsrapped % F-decoding error also calculated. % % (c) 2014 Daniel Durstewitz, Bernstein Center for Computational Neuroscience, CIMH/ H...
5e251972501646ff75b96c60b8016bff9aafc8f468eb79df56215a6a09db6633
MATLAB
5,176
145
classdef FrameWriter properties Path % path of the output video % SequenceReader - reader for .seq input type Writer CurrentIndex % current frame index % Opts - options for output % .OverWriteExisting - whether or not to over-...
7bb5e8d058a5452f69dcb82e454d9a5c80cc027fdd26f7f79448e932a61fba17
MATLAB
5,184
196
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % % Inputs (required) % x - vec...