sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6840add4907c311fd6f2ab3d56196844fdd894f039bfc80d83c693b7f3da8d71
MATLAB
2,747
73
function decoder = train_array(cfg0, X, Y) % [decoders] = train_array(cfg, X, Y) % HELP NEEDS TO BE UPDATED % Trains an array of decoders along a specified dimension in the data, e.g. time. % % X Cell-vector of length N, where N is the number of trials, that contains the training % info...
d5d70730c6a62d2f5c12d3ee8edfc496cbbc898f5c328f270e997376a265525b
MATLAB
2,747
95
%% CONN first-level ROI-2-ROI results to 3D Slicer model color map % Z contains Fisher-transformed correlation coefficient values (beta % values) for each ROI-2-ROI pair and for subject ROI2ROIfile = 'D:\FuncMRIcloud\resultsROI_Condition001.mat'; CatlasFile = 'D:\ownCloud\PROJECTS\MRI\TPM_Catlas_Slicer4\Catlas_Mod.tx...
de00894b9e779f09b781536d85aabfd99a36ce5ad76aac405aca60b32fbb9aea
MATLAB
2,747
98
function varargout = gatestim(signal,gate_duration,Fs,varargin) % Y = gatestim(signal,gate_duration,Fs) % Y = gatestim(signal,gate_duration,Fs,gatetype) % Y = gatestim(duration,gate_duration,Fs) % Y = gatestim(duration,gate_duration,Fs,somefunc) % Y = gatestim(duration,gate_duration,Fs,somefunc,gatetype) % [Y,tvec] = g...
4949502615d89baf8e911dd3d025160d9118da8a74ea7cfd711784c9cb5f6731
MATLAB
2,751
89
function varargout = GenSTA(ST,P,PVar,opts,varargin) % STA = GenSTA(ST,P,PVar,opts); % [STA,raster] = GenSTA(ST,P,PVar,opts); % [STA,raster,Levels] = GenSTA(ST,P,PVar,opts); % [STA,...] = GenSTA(ST,P,PVar,opts,'Parameter',value); % % Generate structure for STA toolbox for information theory analysis. See % www.neuroan...
7447ec63ae227d4e01f4b2f3780106a363a8a885382548075b035309fb4fd5c0
MATLAB
2,754
118
function varargout = TDT_NewTank(varargin) % TDT_NewTank % TDT_NewTank(tankname) % % % Last Modified by GUIDE v2.5 22-Mar-2011 11:58:04 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... ...
1a7a0fb38b34520027ea17d565578abac470e0b7125204faf0437d720a679e2d
MATLAB
2,758
75
function e = DAUpdateParams(DA,C) % DAUpdateParams(DA,C) % % Updates parameters on modules. Use ProtocolDesign GUI. % % DA is handle to OpenDeveloper ActiveX control % C is the protocol.COMPILED structure % % '*' as the first character of a parameter tag serves as ignore flag. % This is useful if you want so...
3f1fc23ca6d9986e8619847c0f2b3e14ba804a859ed005cca643953d7f161250
MATLAB
2,758
79
% PURPOSE: attachs EVENTLIST structure to EEG or ERP structure % % Inputs: % % ERPLAB - input dataset, either EEG or ERP % BINLIST - structure from bin detection process (bdf @ log = binlist) % isattach - to attach or not to attach... % (0: Add to workspace; 1: Add to ...
cd5d5bb522e525a41901d8781d31f5e1fd71bbc7d20c0aa1225db66487531711
MATLAB
2,759
97
function LMER_MODES_PID_RAW % Function to prepare the regression table for Linear Mixed-Effects Regression Model % in R % % Fran Hancock % Dec 2021 % fran.hancock@kcl.ac.uk % % % Function to investigate the relationships between time varying measures % of CHI OCC HC and PID and the random effect of RUN % clear all Sm...
c1fff3bc30402fbfee5aae455222cfa1e3430698770f97b54a51169796f53f47
MATLAB
2,766
94
function [H] = generateH(R, prior_setup) dim_H = DMC.priors.Horseshoe.getDimH(R, prior_setup); H = zeros(dim_H,1); D = numel(prior_setup.T) + 1; % order NS_total = 0; for ss = 1:D if(ss == 1) % NS_total = NS_total + prior_setup.V.N_scales; else %T{ss-1} NS_total = NS_total + prior_setup.T(...
e967157e3ac39d685940bc4432127e4e92da45c6cb8cdf7aec3a5c0a57fd3395
MATLAB
2,768
72
function spikes = reintegrate_outliers( spikes, indices, mini ) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/09/2010 % % reintegrate_outliers - handles logic of putting outlier spikes back % into the main spikes object % % Usage: % spikes = reintegrate_outliers( spikes, indic...
29591b95f892af38cc266eaa30cd26b2655b8832d8f8fb3d61685964b84056bc
MATLAB
2,769
61
function A = set_up_Cc_matrix(G, mesh, c_idx, phi) %set_up_Cc_matrix Set up matrix for the finite difference equations % for the concentrations (part that does depend on phi) phi = phi'; % Load parameters N = G.N; Nx = G.Nx; Ny = G.Ny; zk = G.z(c_idx); elem = G.e; kB = G.kB; T = G.T; dt = G.dt; D_func = G.D_func; %...
623171700bd0e12cd7f8b13af0efe02620f6189ef518ebd02a773b0344df9eb0
MATLAB
2,769
105
function Spiketimes = DB_GetSpiketimes(unit_id,epoch,conn) % Spiketimes = DB_GetSpiketimes(unit_id) % Spiketimes = DB_GetSpiketimes(unit_id,epoch) % Spiketimes = DB_GetSpiketimes(unit_id,epoch,conn) % % Retrieves Nx1 vector of spike times or unit_id on a database. % % Optionally, the spike times returned from t...
97239ec1b74dda49dd84dbf9b4d923c29e714fbcdf40c1f03eeeb8df4b6e5437
MATLAB
2,769
112
function G = model_parameters_keep_channel_location(Li, Lm, Le, ... w_K_channel, w_Na_channel, Ly, Lz, dx_min, dy_min, dz_min, Tstop, dt, ... Na_channel_start_y, Na_channel_end_y, K_channel_start_y, K_channel_end_y, ... dx_values, dy_values, dz_values) G.Li = Li; G.Lm = Lm; G.Le = Le; G.Lx = 2*Li+2*Lm+Le; G.w_K_channe...
16b5ca91b646fa7731f68ee3ded7d007c1e8fa1a6903fa175c8070c95938a42f
MATLAB
2,775
109
function hout=suptitle(str) %SUPTITLE puts a title above all subplots. % % SUPTITLE('text') adds text to the top of the figure % above all subplots (a "super title"). Use this function % after all subplot commands. % % SUPTITLE is a helper function for yeastdemo. % Copyright 2003-2014 The MathWorks, Inc. % Warni...
e0a2747e647591d373a7a5e3007b13a27c440503e8e4baa03f7358994169b597
MATLAB
2,775
75
function [hStrings] = cosmeticsMatrix(corr_matrix, colorLim, ... matrix_type, plot_textStrings) % cosmeticsMatrix set the color map (pos: black, neg: red) and add the % correlations as text strings % INPUT: % corr_matrix: the correlation matrix % colorLim: 1 x 2 array, the limits for minimum and maximum of colo...
42b0dffc1e710b82b25e8910af2adeaea55bf9368fa10ec74fd92b5382a4923d
MATLAB
2,785
89
function [ahOri] = oriTuningSubplot(tr, clu, iCluInd, trSel_yell, startBinT, endBinT) %UNTITLED6 Summary of this function goes here % Detailed explanation goes here % orientatin tuning analysis spkCell = clu.spikeTimesEp(:,iCluInd); dirConds = unique(tr.grat1direction); % startBinT = 0.1; % endBinT = 0.3; binW...
03d5070e7f13f068ff1a05840a53d9799a2ca83727bb62961dbaf40b06592628
MATLAB
2,786
87
function [XTrainNew,YTrainNew] = augmentDeepInsight(XTrain,YTrain) % augment non-image samples to make it balance for DeepInsight procedure class = length(unique(double(YTrain))); for j=1:class max_class(j) = sum(double(YTrain)==j); end [row,col]=sort(max_class,'descend'); MaxClass = col(1); MaxClassVal = row(1);...
2ad9c0d9c0e373e046152b855f2173feb54cb85d24f02de5f143aa93d6deb78b
MATLAB
2,788
69
function [sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,... dr,pw,alpha,gr_pr) % [sz1,sz2] = lme_plannedSampleSize(Zi,ZiCol,Dhat,phisqhat,effsz,dr,pw,alpha,gr_pr) ...
f3917ae4d8a4fba456ef2fc19114d94ab03e7b0ca8678e5946a62b3fa2c25f6d
MATLAB
2,788
83
function [results] = scaleDWB3(results, params, spkHistPrior_setup, addPriorForWB, couplingGroup, precomputedPortion) % i.i.d non-mean Gaussian over spike history coefficients & constant K = size(params.B,1); w_mu_idx = 1; w_sig_idx = 2; H = double(params.H); %w_mu = H(w_mu_idx); log_w_sig = H(w_sig_idx); if(...
61af3baab8215a9a626c2cbab17057c037dbc8d5203843477b86e409e19a101c
MATLAB
2,789
106
function [L,pLL,pLH]=seq_source(trial) % Define the chunk lengths (geometrically distributed). % % Input % trial nb of trials in the sequence. % % Output % L (iterations x 1) cell with the chunks length in each entry. % pLL (iterations x 1) vector of transition proba L-L. % pLH (iteratio...
85ab7eaeb73955c221e87f9a0af073ae49ea8f45a08a99a77af610827e73f2f8
MATLAB
2,789
86
function [TS,avgFR,sqFR]=DecodeStatsTSonly(FR,evt0,reg) % Fisher F-test based classifier/decoder % % (c) 2014, Daniel Durstewitz, Dept. Theoretical Neuroscience, CIMH % Mannheim/ Heidelberg University % Edited by Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk % % Input Variables: % FR: Fi...
dcd29e348b39e6fdbf420a4aab4e55d5e8c4e2200838a3398efced27233a61f8
MATLAB
2,793
49
% Property grid using JIDE implementation % Copyright 2010 Levente Hunyadi % % Sample code % example_propertyeditor - Demonstrates how to use the property editor. % example_propertygrid - Demonstrates how to use the property pane. % example_matrixeditor - Demonstrates how to use the matrix editor. % ...
e2cf6acbb6101853885b3bb05e7084ab5489c7e898e9a2fc27c2fe364a4796b4
MATLAB
2,794
75
function TSL_pre_post_checks() % Load and save summary info from the behavioral data of all the subjects. % % Count numbers of pre- and post-check mistakes. % ======================================================================= % % ===== * ===== General parameters % =======================================...
087dc8a0b0a9da71d878ae04be62cfbdcb6be35522a0ce42ba928802c6923ec5
MATLAB
2,801
109
%%This function is to get the xticks and xtick lables if we plot the %%waveform with two or more columns. % *** This function is part of EStudio Toolbox *** % Author: Guanghui ZHANG & Steven Luck % Center for Mind and Brain % University of California, Davis, % Davis, CA % 2022 function [xtickout,xticklabelout] =...
93b1100262ea8230c6e6e90de92285953afc7441b0e86fb4e62091c41b372367
MATLAB
2,805
83
function [XTrainNew,YTrainNew] = augmentDeepInsight2(XTrain,YTrain,num) % augment non-image samples to make it balance for DeepInsight procedure class = length(unique(double(YTrain))); %num=500; for j=1:class max_class(j) = sum(double(YTrain)==j); end inx=1:length(double(YTrain)); XTrainNew=[]; YTrainNew=[]; for ...
2b8ca50905f65a98499f607bd4269ea5340005a295a8a33dc59c5db5caf71a0f
MATLAB
2,814
115
fileName = 'p0Ve'; saveVideo = true; % Video file location vidLoc = '.'; % Video file name vidName = fileName(1:end-4); % Video frame rate vidFrameRate = 20; % Choose scale of velocity vector fields vfScale = 1; if saveVideo disp('Writing video to file...'); tic fig = figure('Name', 'fileName'); % Create video file vi...
c6b5e7ed11461b76b42ddd1e4c92218a7ff6e2dc5b676f285225b3537f71523b
MATLAB
2,816
97
function plot_boxplot(data, varargin) % Plot boxplots. % used in TSL_analyze_ratings. % % data % (N_data, N_boxplots) data. N_groups = size(data,2) ; % === Default arguments eps_fig = 1 ; fig_fig = 0 ; pdf_fig = 0 ; fn_save = 'test' ; save_fig = 1 ; fig_name = '' ; x_lab ...
6618f6777664ef8925c554a705060ac091e7ed63fd5f155dd3f87b6fa151fb98
MATLAB
2,817
96
function plot_qti_invariants(s) % function to plot QTI invariants for different fits/protocols % n_fits = max(size(s)); % by default, we take the middle slice to be shown slice = round(size(s{1}.s0,3)/2); % open a figure figure() % for each fit (invariant structure), we plot the QTI main invariants if license('tes...
302b3ffe4e4b744e7f9cf243c0d0116a6825468c0a938973aa7a8043ddec4fdc
MATLAB
2,820
64
function [avg_corr, correlations, corr_atanh_T] = correlations(matfile_table,... hemisphere, roi_name_variable, var_to_corr) % CORRELATIONS calculate correlations for a collection of sessions % INPUT: % matfile_table: The table containing beta values to correlate % hemisphere: a pair of hemisphere to compare % ...
44c1cc3a617bdea0685614f5d5d528b878d36b8018229b05dfe54c3fac9fa993
MATLAB
2,822
73
function marks_struct = marks_add_label(marks_struct,info_type,mark_prop) if isempty(marks_struct) nflags=0; else try eval(['nflags=length(marks_struct.',info_type,');']); catch, nflags=0;end end flagind=1; switch info_type case 'chan_info' if ~isempty(marks_struct); if isfield(m...
4dad8bd42ff9e46b53bfee3296ebc9c8eef7b4d48fe833ae7a1ebef07c943a58
MATLAB
2,823
94
%% Batch histogram analysis. % % 1) Open DB_Browser and select an experiment you would like to process % 2) Click your mouse in this script to give it focus and tap F5 on the keyboard to run % 3) All units of the experiment selected in DB_Browser of the experiment % and protocol (ex: ProtocolName = 'RIF') % Note: An...
f45580872bd24db61a1a3506cdc4bbdbbabda33d657f156bb3f8106891cb5d66
MATLAB
2,823
89
function [ Structs, Locs, LocLinks ] = FetchData(Server, Port, Database, cellIDs ) %FetchData - Collect data from a database javaaddpath('.\sqljdbc4.jar'); ConnString = ['jdbc:sqlserver://' Server ':' num2str(Port) ';database=' Database]; disp(['Connection string: ' ConnString]); conn = databas...
0959d86288bceaa691738b3cb8813aa3ffaa10ac52131687e114fe3d69e7b4eb
MATLAB
2,827
70
function trialCounts = parseNLX_TTLsForRatios(inputData) times = inputData (:,1); TTLs = inputData (:,2); hasDelay= ismember(4128,TTLs); noTrials = numel(find(ismember(TTLs,[9,18]))); noLTrials = numel(find(TTLs==9)); noRTrials = numel(find(TTLs==18)); TrialStartIdx = find(ismember(TTLs,[9,18])); TrialA...
145fa5df423994880343f55531e994eed92724e9ffb1038590d1df9bac4d8bcd
MATLAB
2,827
102
% Usage: strMat = mat2colon(Matrix, options) % % Converts a matrix (row x col) into a string using MATLAB colon notation (single resolution). % % Options are: % % 'Delimiter' - 'on','yes','off','no' {default on} : Including square brackets [] % (or curly brackets {} whe...
a7598b493525b52b4375365505b145131471fe37b19d9bb60068e46cda18b0f3
MATLAB
2,830
84
function s = irepistructure(TBI,nslices,ndummies,ntp,skip,PreInv,InvDur,TI1,ROFlip) % s = irepistructure(TBI,nslices,ndummies,ntp,skip,PreInv,InvDur,TI1,ROFlip) % Pulse sequence parameters s.TBI = TBI; % 2.092*1000; % time bet inversions in ms, like the TR s.nslices = nslices; s.ndummies = ndummies; s.ntp = ntp; s.ski...
c8afcc9a1de2b143fa9366969b78359f3dc3a6d7ff1ee78564569e71cf7072ce
MATLAB
2,833
89
function [avgFR,seFR,Ft2,Rt2,Ft2ciL,Ft2ciH,TS,dfnum,dfden]=DecodeStats_GPU(FR,evt0,reg) % Fisher F-test based classifier/decoder % % (c) 2014, Daniel Durstewitz, Dept. Theoretical Neuroscience, CIMH % Mannheim/ Heidelberg University % Edited by Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk %...
60e1475ca4da57d6cf77900596c0897286560d7022a7944bc090857e36ca9d3d
MATLAB
2,834
91
clc;clear;close all; Fig12=figure(); Ntrials_2 = 50000; %Ntrials_2: number of learning cycles N_mu=100; %There are \mu independent embedded patterns, 500 simulations (number of simulations) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %line: R=1 yline(1,'--k','Linewidth',2) hold on ...
6393f18c7d04ff5f7ce05f7848592da1fae2b73ed431dfff44d5d17747a1cdcf
MATLAB
2,844
96
function logTrial(centerReward, response) %#ok<*INUSL> % Reports stimulus and response parameters global gf if ischar(response), % Enter string as arguement to get header headings = {'Trial','CorrectionTrial?','StartTime','CenterReward?','F1','F2','F3','F4','H...
67fefd8112855e03220ecb78174377b713fb922a4eafb59c7bdb9017645ba271
MATLAB
2,846
86
function [ActT,Za]=ShowAssemByTrialG(Za,... Tmtx,... STPat,... EvtT,EvtL,... Lag,crit,show) % Plot assembly activation during a trial % % (c) 2014, Daniel Durstewitz, Dept....
3dc916b23f95249e5d3b747c49abeb3e6820020b1f053f360054fff7d4137262
MATLAB
2,848
89
%% Set variables clearvars -except dataDir paradigmNum = 'reward_history_study'; SeedName = 'aPC'; numSubj = 51; roiNum = {1, 3, 4, 5, 6, 7, 8, 10}; num_Cond = 7; load(strcat('dataComp_condition', num2str(num_Cond))) %% loop through the data for seedRegion = [2,7] if seedRegion == 7 roiNum{6} =...
97622e8c9f88eb86a31b1f4d548327d226cfb805386cec7509ae5c8c61cd2a9c
MATLAB
2,850
81
function progress_bar(progressFraction, updateEvery, infoString) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/2010 % % progress_bar - improved progress indicator % % Usage: % progressBar(progressFraction, updateEvery, infoString) % % Description: % PROGRESSBAR(FRACTION, UPDATEEVERY, INFOSTRI...
248734950124648e19420d711b10a31f9d6ce2e60be2b630e944c4d75f973745
MATLAB
2,851
83
function decoder = train_beamformerMT(cfg0, X, Y) % [decoder] = train_beamformer(cfg, X, Y) % Trains a linear decoder "beamformer style" to optimally recover the latent components as % prescribed in X. Several decoders may be trained indepedently, corresponding to several % latent components. % % X ...
e9052d8a5fec24f0ec06a8a0b76405884c24e14e4c6ea439e8f94c5cc5055cee
MATLAB
2,851
106
function createDiffuseFibrosisProblem(filename, fibrosis_density, mesh_spacing) % This function creates tissue of a single consistent property, then fills % it with fibrotic occlusions of the requested density. % Define the diffusion tensor D = [ 3, 0; 0, 1 ]; % Fibre-biased conduction % Define the physical size o...
4476e8b081ec73cfa4afbbe20a95c77b3b5ee764e00252226a1fd9f650eff387
MATLAB
2,852
89
% PURPOSE : sets background and foreground color of the current ERPLAB's GUI % % FORMAT : % % handles = painterplab(handles, type); % % handles - GUI's handles structure % % % *** This function is part of ERPLAB Toolbox *** % Author: Javier Lopez-Calderon % Center for Mind and Brain % University of California, Davi...
006e2890cd92343e25528e8c2277e69ca6a04d1069f2215e67b329a96c03a3b3
MATLAB
2,854
85
function updatetag_SanesLab(gui_handle,module,dev,paramtag) %updatetag_SanesLab(gui_handle,module,dev,paramtag) % %Custom function for SanesLab epsych % %This function updates a parameter tag in the RPVds circuit, and resets the %color of the GUI dropdown menu. % %Inputs: % gui_handle: handle to the GUI dropdown menu...
d27e104c5ac74aa23144890404a0431219c947348ed9bc104d456904e9493835
MATLAB
2,858
120
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images in HandOnFace dataset % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinen...
1d7adf59d52e511450559376a8ac69504be0a7a26feaa7a13320af7cee2a8a04
MATLAB
2,859
108
%% finds the suprising data in the same way as the experimental analysis %close all oriSequence = (OrientationsStore); diffOri=[1 diff(oriSequence)]; modDiffOri=mod(diffOri,6); % plot(oriSequence,'-o') % hold on % plot(modDiffOri,'-o') clear ExpectedA ExpectedA(1:2)=1; ExpectedOrientation =[]; %ExpectedOrientation(...
d0597ce74ad2008bb917e1f0e6ccfe812406fd702ed6fda57009e0efa71e237c
MATLAB
2,860
109
% separazione dei peaktrian nei layer (per ora solo layer 1) clear all clc %% Selection of the peak folder start_folder = uigetdir(pwd, 'Select the PeakTrains_mat folder'); if isempty(strfind(start_folder, 'PeakTrains_mat')) f = errordlg('Folder not corrected', 'Folder Error'); return end disp(start_folder); c...
118beed116eccb9e792cd35bca2317ad547dd7f054e448787a8f6819e396f3aa
MATLAB
2,865
106
function [lp, dlp_w, dlp_h, stim_sig_0, stim_dsig_0, d2lp_w] = stimulusGaussianPrior(ws, H_stim, stimPrior_setup, trp) % i.i.d. multivariate normal prior distribution over columns of ws with covariance matrix % defined in GMLMprior_dmcStimVar % % calculates prior and all derivatives if(isempty(H_stim) && isempty(ws))...
260430890d0b72d0b947282a5949cc66a526ebf0fe90552e1640f66c1238232c
MATLAB
2,876
137
function C = TrialFcn_DoubleWavBuffer(C) % C = TrialFcn_DoubleWavBuffer(C) % % Daniel.Stolzberg@gmail.com 2015 global G_DA persistent buffer bufferSize startidx smallBufferSize lastID vprintf(2,'TrialFcn_DoubleWavBuffer.m') if C.tidx == 1 % setup lastID = 0; startidx = 1; % StimFile = 'DMR....
f3c10d9d23490408591927092801438fd3c1d84c8cff1d8eafc0a34eb9d15a41
MATLAB
2,882
73
function perm_cluster_t = compute_cluster_perm_stats(beta_CP, ... alpha_level, all_names, n_perm, n_betas, n_chan, nF_data, nT_data, n_subj) % Compute the distribution of the cluster-level statistics based on % shuffled data. % % beta_CP: (n_betas, n_chan, nF_data, nT_data, n_subj, 2, n_perm) paired_tes...
fed9227975c5c610309942c7c83d5351c656b34b6535d21b8d01a404d1504feb
MATLAB
2,888
105
function [net_dist] = netpd_rewire_dist(mat,distmat,rewiremeth,Nreps,prop_rand,nbins) % inspired by Gollo, measure network overall distance using the network % portait divergence if nargin < 3 rewiremeth = 'randmio' ; % func from BCT end if nargin < 4 Nreps = 100 ; end if nargin < 5 prop_rand = [ 0 ((5:5:...
a3bdece89f1061008a89fdfac18421c4cb655b439ec656ccd4b199e047b95cfb
MATLAB
2,889
63
function Handle=getSigmoidHandle(options) % creates a function handle to a specific sigmoid %function Handle=getSigmoidHandle(options) % This function creates a function handle to the sigmoid specified by its % name in options.sigmoidName. % Additional parameter is the options.widthalpha which specifies the % scaling ...
129b303a114b0d5528ef2e08dbce38416c6f4f8cfecf228b679552dda062e427
MATLAB
2,890
68
%reconstruct 3d TOD map from the neural network output vector file .npy clc;clear; repeat = 1; sample_img = 1; function flag = generate_test_Recon(repeat, sample_img) %% %loop several times for the data generate. %% files = dir('.\Matlab-CODE\Kim\tJN*'); % Get a logical vector that tells which is a directory...
8f253a9ec227cb031567ab99673b4149b0309f4e424eea95084baa3ac6e773a9
MATLAB
2,890
74
function [Ass]=BSciCont(P,D,Ass) % Calculates bootstrapped confidence intervals on loading and activation of factor scores % Deals with long time-series typical of sleep recordings rather than short single-trial behavioural data. % % Core part of Factor analysis Assembly detection workflow % NB Run FAassem_.m on ...
a53bfaa1755b8d90b85d1bbed0844583d0fc139845aa41ed654e22212c07e629
MATLAB
2,894
104
function [loos,kss] = psislw(log_lik, Reff) %PSIS Pareto smoothed importance sampling % % Description % [LW,K] = PSISLW(LW,Reff) returns log weights LW % and Pareto tail indeces K, given log weights and optional arguments: % Reff - relative MCMC efficiency N_eff/N % % Reference % Aki Vehtari, Andrew Gel...
0d3211261f8c0cfebf6e01905b8aa6228124acdbfec3bd4c33d15aa30e7565a3
MATLAB
2,899
74
function fibThreshold = find_threshold(fibId, rFib, fiberV, nrnModel, config, MRG_coeff) switch nrnModel case 'Gaines/Motor' dirModel = 'neuron-demo\neuron\Gaines\'; hocName = 'motor.hoc'; case 'Gaines/Sensory' dirModel = 'neuron-demo\neuron\Gaines\'; hocName = 'sensory.hoc'; ...
36bbd9144885c6f40c25940cb2b2cc685afc7abd502e35cd80edaac80a5983d7
MATLAB
2,902
79
function filenames = export_stl(model, outputFolder, selection_prefix) % EXPORT_STL Reads the MPH file in model_dir and export each domain under a % specific selection with a fixed prefix into stl files. The selection must % be of type Domain and it may contain multiple elements % % [filenames] = export_stl(mode...
7b8bdc7a0f94b653dce0b6881903437aca607c0407d636b17b0aeffe9ef6da62
MATLAB
2,902
82
%==================== PlotSingleCellSDF.m ==================== %Plot SDF of neural response to a single stimulus (size-distance % combination) for each neuron %========================================================================== close all clear all %================= SET PATHS AND LOAD DATA if ismac Pre...
904273786f6f1f9751060632295832d5cf95d2bbc241f7ba472c4cf24898887b
MATLAB
2,902
105
% Fig7_a % Code to generate spiking example traces during optogentic stimulation in V6 % session parametrs cfg.sessionID = 475; figName = 'Fig7a'; % start end end time when data was recorded sessionStartT = 200; sessionEndT = 860; % load data addpath data load('Fig7_a_data.mat') % define channel mapping mapna...
c1f758019bc5f837337a9df60f02f77b993d3aa9d348e9571f7e4e9a1c77a4b1
MATLAB
2,904
94
function [fstat, pvalue, rss_reduced, rss_full] = ... %, reduced_params, full_params] = ... measure_gc_multivariate(x1, x2, xrest, lags, plotFlag, constantFlag) % [fstat, pvalue, rss_reduced, rss_full] = ... % measure_gc_multivariate(x1, x2, xrest, lags, ... % plotFlag, constantFlag) % % Measure multivaria...
b3362f372997cce197cc8f6953917480f2f091ae0efa48164e1386acdd200584
MATLAB
2,905
60
function [slicestructupdate] = analyzetpstack_updatecelldraw(ud,i,slicestruct,currdir,numpreviewframes) % ANALYZETPSTACK_UPDATECELLDRAW - construct a lookup table for slicelist, drift, and ancestors, if it doesn't already exist if isempty(slicestruct), slicestruct.slicelistlookup.test = []; slicestruct.slicedriftlook...
c092050297added5fa1c0869b5b0944c1129ed2b383b6510fd789a6142c617a3
MATLAB
2,907
119
function steady_state_spectra % % Shows the challenge presented to the brain across sound spectra for two % vowels being discriminated at each signal to noise ratio. % % Stephen Town - 14 March 2021 % Base data fs = 50000; F = [460 1105 2857 4205; % Formants 730 2058 2857 ...
a37e2ff921f4afbc3d959be469d8b7ae9d187a012ebe2843f55b59a50fcd6d7e
MATLAB
2,908
82
function [pid, ppid] = print_pointwise_pid_iccs(Pxxy,normalise) if nargin<2 normalise = false; end [Na Nb Ny] = size(Pxxy); P2 = marg_maxent2(Pxxy); Pxx = sum(Pxxy,3); Pxx2 = sum(P2,3); Py = squeeze(sum(sum(Pxxy,1),2)); Pay = squeeze(sum(Pxxy,2)); Pby = squeeze(sum(Pxxy,1)); Pa = squeeze(sum(sum(Pxxy,3),2)); Pb ...
054050daa982f0923e3f77984ecef5c078e53e21ab98585dce50e101c40315d3
MATLAB
2,912
99
function ep_SaveDataFcn_SanesLab(RUNTIME) % ep_SaveDataFcn_SanesLab(RUNTIME) % % Sanes Lab function for saving behavioral data % % % Daniel.Stolzberg@gmail.com 2014. % Updated by ML Caras 2015. % Updated by KP 2016. Saves buffer files and associated ephys tank number. datestr = date; %For each subject... for i = 1:...
0d8b763d7ab6e4117991aea1f743aba101cee00a8d3e0d9b60702e6aaad09fc5
MATLAB
2,912
69
% Example script for processing and analyising Electrodemal Activity (EDA) % _________________________________________________________________________ % Last modified 23-11-2010 Mateus Joffily % Matlab data file (.mat) must contain 'data' and 'fs' variables: % data - m-by-n matrix of EDA data (m channels by n s...
4e242491f885a1647e7d5e9b020c620e2eceabdae7d6db6dbb13e6fb80f9d3ec
MATLAB
2,914
111
function [sig, dsig, full_sig] = GMLMprior_dmcStimVar(H, prior) K = zeros(size(prior.S)); if(nargout > 1) dK = zeros([size(prior.S,1),size(prior.S,2), numel(H)]); for ii = 1:size(prior.S, 3) hps_idx = prior.hyperparams_idx{ii}; type = prior.covTypes(ii); if(strcmpi(type, ...
90aeb3a92d63d03517465aaebe243bba04812086ce33a57b3cc80708796aa267
MATLAB
2,914
106
function [h,MISE,F]=UniKDE(X,h0,Ef,Z,ub) % Fit spike train rate kernel: Univariate nonparametric density estimation with bandwidth selection % % This routine implements univariate nonparametric density estimation % with bandwidth selection based on minimizing the mean integrated % squared error (MISE), E[int((f^(x,H)-f...
1ccbd62d7c1a2432188d409ee529352ae184709d866c205d227086756e069f60
MATLAB
2,916
98
function [result, max_stitching_sq_dist] = stitch(segments, stitching_sq_tol, branching, update_plot) % In case two vertices of a facelet lay on the plane this means % that onther facelts could have the same segment in common: % need to delete these doubles segments [~, idFaces_avail, ~] = unique(cellfun(@(x) num...
95c21dcc534f634db719c3e9b4b78119bed290cc37110f6338cccb8d35d5cfbe
MATLAB
2,917
71
function [maxFig minFig] = correlationPlots(condTimeseries, pCorrelation_tril, roiLabels) % This function calculates representative correlation and anticorrelation % traces from the partial correlation analysis % % Compiler(s): Renee Hartig (renee.hartig@tuebingen.mpg.de) & Ali Karimi % (ali.karimi@brain.mpg.de) % % In...
ed135d23e598916546a640a679da15117a4e4801a9e38eada045e640b72fecea
MATLAB
2,917
113
function Silhouette_scores % Script recreates figure 6 from the manuscript. This compared the silhouette scores between parameter distributions recovered % from applying the SOEA20, SOEA45,MOEA20 and MOEA45 methods. FS1 = 7; % fontsize subjects = 20; simulations = 100; % load simulation results load('Total_S...
938775eef3a6a86ddd45c8519ca09bdecb142c08dda194fc8e0066028d8a8461
MATLAB
2,920
91
%Code by Isaac Arias S - YachayTech University %Biomedical Engineer Student. %School of Biological Sciences and Engineering. %Convertidor_227_final.m allows the image pre-processing clc clear all close all % Select the specific database that contains the images to be pre-processed. myFolder = uigetdir(); ...
9f9fc1f25c57f8d6aa7e7aa9c38bd27fcc31dc7379bb08b4bc898b0bde6203f6
MATLAB
2,920
80
function [neurAll,neurProj,motDat,baseIdx] = getDataBinnedToVideoFrames(db,P,binP) if isfield(binP,'focusOn') P.focusOn = binP.focusOn; else P.focusOn = 'video'; end %% clean time when flashes for alignments fprintf('*** Cleaning the flashes... ***\n') tic for k = 1:P.nMic...
dcb563ac6907b64e5bd13cd4946b13f7b044de7c15d34767180f56660989bbdc
MATLAB
2,920
99
function value = mgRunTrial(net,environment,startState,nextState,finalState) %net = established network %environment = state space %start = starting state %goal1 = next goal %goal2 = final goal %delay1 = delay after text screen, before response (delay between qLoad %and qRead) %delay2 =...
789284ea4e7b3bf1564fb9944c82e063386e2264b641efa9a21b915d5bdb3f3b
MATLAB
2,926
115
function [MVPC, filenamex, serror] = savemvpc(MVPC,filenamex,modegui,warnop) serror = 0; if nargin < 1 help savemvpc return end if nargin<4 warnop = 1 ; % no warning for overwriting a file end if nargin<3 modegui = 0; % no uiputfile end % Save MVPA file (save as) MVPCaux = MVPC; name...
67285f3df30e060ff8161867be8ff2328ba719f76e40b74d32638bccd5a09ba7
MATLAB
2,932
94
%% Master Analysis file % All analysis performed on light transmission recordings of ciliary beating in the zebrafish nose % It is possible to run the analysis on aligned data. % Assumes that the input file is a .mat file, and only contains one variable with the recording %% Step 0: Select the recording % Never run ...
e931442b01600ef4dfd04b147f4b39930f310e9b2ad41e5fc031c1819420949c
MATLAB
2,936
96
% Code to run spike train Xcorr function in parallel on Blue % Crystal. % APFD UoB March 2016 % Dependencies: restrictTranges.m , catpad.m, CompCCMtx.m, CCMtx (MEX) clear all close all p.rat = 'JaroslawLONG2'; if ispc p.home = [getenv('HOMEDRIVE') getenv('HOMEPATH')]; p.pat = 'C:\Analysis\Ass...
6615e922b27692a98671e1c668c93a04384a8515f2d12f44a7605c0ee4d95646
MATLAB
2,940
80
function Xhat = decode_array(cfg0, decoder, Y) % [Xhat] = decode_array(cfg, decoders, Y) % Decodes the data along a specified dimension, e.g. time, using an array of decoders. % % decoders Cell-vector of length D, that contains an array of decoders, where D is the number % of decoders. This arra...
c286dc2b4d03e0c202dd7cf7185d9a8096eadd04d208d84f096e1d78ac2a6274
MATLAB
2,941
110
function GenerateRICAModel(self) %GENERATERICAMODEL Creates dimensionality reduction model for features % GENERATERICAMODEL(SELF) creates RICA model using the streams and cams % specified in config.txt % % If model already exists (i.e., model for specified stream + cam combo, % and NUMDIMENSIONS), asks whether ...
8412aa6f759e6d05148a055dd8632983e7c5f47afeba420ba1b1bc9af5eb9426
MATLAB
2,943
93
% % This script loads CCEPs of one subject and plots a distribution of % latencies to distances from the stimulus pair % % % Dora Hermes, Max van den Boom, Dorien van Blooijs 2022 % clear close all warning('on'); warning('backtrace', 'off') myDataPath = setLocalDataPath(1); track_path = fullfile(myDataPath.input, ...
8346f2196f489cb9bc8428fc18e112e688798ecb87196055f1b27017d3a88f69
MATLAB
2,944
107
function gamma = shrinkageGamma(X, memEff, feedback) % [gamma] = shrinkageGamma(X[, memEff, feedback]) % Returns the optimal shrinkage parameter for data X, % as described in Blankertz et al. (2011) Neuroimage. % % X Matrix of size F x N, where F is the number of features and N the number of trials, ...
1789b36d4325c429eac973613e877e5f97d7e9b9878d2a5e205ff608150209ae
MATLAB
2,946
85
function V_wave = get_waveform_TCS2(NI_params, target_temp, base_temp, pulse_dur, ... foreperiod, postperiod, active_zones) % Returns the intensity (V) for one TCS2 pulse. % % Inputs % target_temp targeted temperature. % pulse_dur duration of the laser pulse. % SR sampling rate...
9f0af04274d905b93d3803e52b32b1e7d9436e5de3677bd46127aee678c28cea
MATLAB
2,946
85
function DB_CreateUnitPropertiesTable(conn) % DB_CreateUnitPropertiesTable % DB_CreateUnitPropertiesTable(conn) % % Checks that db_util.analysis_params and (currentdatabase).unit_properties % exist and are current. % % This functions is automatically called by DB_CheckAnalysisParams % % See also, DB_CheckAnal...
fb89451f5bc61980a2677eb57e32dc8dfa50db54b84ca21590854346bae15a0e
MATLAB
2,948
105
function [outdir] = ieeg_FSsurf2T1space(FSdir,outdir) % Function ieeg_FSsurf2T1space(FSdir,T1file,outdir) converts Freesurfer % surface to a gifti file in freesurfer space and then converts this gifti % to a gifti file in the space of the T1file % % Input: % FSdir: freesurfer directory, if [] will provide a popup ...
3ba56a131987e2677cf294ac19b2f0a80f749497f439ef53f190386a690a5595
MATLAB
2,950
55
% This function creates indices for the train-test data for each % participant. % LSTM is sensitive to the length of the sequence and is not capable % of handling the data in the form of long sequences like a complete trial. Therefore, gait cycles are % considered as individual sequences of data for training and test...
166d5923b27c8a58329838c06c60c114b31656f368c4e8c3346eb7a325235bf3
MATLAB
2,952
108
%Function to output 1 if the desired area was looked at for the %predetermined period of time, and 0 otherwise. function X = Trial_Run(TestValue, s) f = findFigure('Fastrak','color','w'); %set(gca,'xlim',[-5 5],'ylim',[-5 5],'zlim',[-5 5]); axis([-5 5 -5 5 -5 5]); axis manual; grid(gca,'on'); view(3) cla h = line(n...
56b751d549bbc17fe332da37e593330daeb2794ce9e80337af7fb4fbe312a429
MATLAB
2,956
69
function [matfile_table] = fix_sessions(matfile_table) % FIX_SINGLE_SESSION fix sessions where amygdala is missing. In addition, % check consistency of ROI names amongst sessions with or without amygdala % INPUT: % matfile_table: table of session beta values % Get number of ROIs in each session num_sess_ROIs = cellfu...
aacfd5f41de6c1c783666c5512638aed19716cd6a84f914bb917c5dbacb38489
MATLAB
2,957
97
function r = mri_glmfit_pcc(glmdir) % r = mri_glmfit_pcc(glmdir) % % Computes the partial correlation coefficient (PCC) for each contrast % in the output dir of mri_glmfit. It also computes a z-score map. The % z is "two-sided" meaning that if it is converted back to a p, it % must be done with a two-sized computation ...
84bb14cdf9820228d19d76410985c345f3df9c89bcfc630ddd083d6ea4f5e6f0
MATLAB
2,963
122
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_gtea(...
6bc1bdb9fe72283d293d9444042613eccac33978d5d84dbdbc326aa629666c54
MATLAB
2,967
111
function varargout = shapedata_wave(wave,tvec,params,dimparams,varargin) % data = shapedata_wave(wave,tvec,params,dimparams) % data = shapedata_wave(...,'PropertyName',PropertyValue) % [data,vals] = shapedata_wave(...) % % Reshapes continuously sampled data based on some parameters (dimparams) % % PropertyName ... P...
b36aa1d09fdebd972d1b0fe31e2b5aa2cf02f8ea1b10d48bd0ad265d22f8c74f
MATLAB
2,968
95
function cdata = loadIcon( filename, bgcol ) %loadIcon Load an icon and set the transparent color % % cdata = uix.loadIcon(filename) loads the icon from the specified % filename. For PNG files with transparency, the transparent pixels are % set to NaN. For other files, pixels that are pure green are set t...
e60bf6344d8f9db867c36ebf08cff917f25a28f9b5c334609cea3fd6c6ee3e15
MATLAB
2,968
84
%% adjustHMCstepSize % Updates the HMC step size parameter using dual averaging given a sample % inputs: % ss - current sample number % HMC_state - current HMC state (constructed by runHMC_simple) % setupSizeSettings - settings for algorithm, including update schedule (see setupHMCparams) % ...
362d9e8da89253d5fcbe2a094a3cc536e7748ec1859460fe1a9d3af8cb6a8adf
MATLAB
2,973
41
function out = get_M_9x9_from_d_c(d,c,l) out = [ [c(1, 1, 1, 1) + d(1, 1)^2, c(1, 1, 1, 2) + d(1, 1) * d(1, 2), c(1, 1, 1, 3) + d(1, 1) * d(1, 3),... c(1, 1, 1, 2) + d(1, 1) * d(1, 2), l(1), l(2),... c(1, 1, 1, 3) + d(1, 1) * d(1, 3), l(3), l(4)]; [c(1, 1, 1, 2) + d(1,...
3e6c63a6d8dff38b2c9bbe125fca32f3caa406dee9b6cd40b01fafc20b561804
MATLAB
2,974
123
clear all; addpath('../'); % Gives me: X (labels), Y (data), time, label tmp = load('../data/testdata_orientation.mat'); Y = tmp.Y; % Y: features x time x trials X = tmp.X'; time = tmp.time; label = tmp.label; phi = X * (180/8); % Presented orientation in degrees numF = size(Y, 1); numT = size(Y,...
2b6a7951435900975b6289e0d9c51a26d533cf3db14b8335f9fb1a0cd18717c0
MATLAB
2,978
107
function PL_IGNIT_ALL_PID_RAW % Function to prepare the regression table for Linear Mixed-Effects Regression Model % in R % The metric variables are d here % % Fran Hancock % Dec 2021 % fran.hancock@kcl.ac.uk % % % Function to investigate the relationships between time varying measures % of CHI OCC HC and PID and the r...
3454f9892293e436b85ea209e394ac20accf1525b81c75dc0c2e8a665a4c7bb7
MATLAB
2,980
122
%% BCI dataset, Ulster University % preprocessing pipeline % Writtern by Vahab Youssof Zadeh % Update: 02/23/2022 clear; clc, close('all'); warning off %% Initial settings %- Brainstorm dir bsdir = '/data/MEG/Research/BCI_Ulster/BCI5'; bs_path = '/opt/matlab_toolboxes/brainstorm3'; addpath ./functions ft_path = '/op...
a53006d052231a570cac76ca54333b2ef0f20942297141912fbcc9d169c98a76
MATLAB
2,980
131
function [FracCorr FracCorrShuffCIL FracCorrShuffCIH]=DecodePredErr_CV(FR,evt0,reg) % % (c) 2020 Aleksander PF Domanski PhD UoB % aleks.domanski@bristol.ac.uk % Input Variables: % FR: Firing rate matrix [units,time x no. trials] % evt0: Event category labels (either 1 or 2) [no. trials] % reg: Regularization paramet...
7723b6e639f7cf35e101836332a9fc869aad45082630c39a316e538d7f201d65
MATLAB
2,983
101
function plotPatternLocs(allLocs, pattTypes, realTime, ntrials, nspacebins, smoothScale, useContours) % Takes the patterns cell array ALLPATTERNLOCS from findAllPatterns.m and % plots the distributions of all patterns over space plotTime = true; if isscalar(realTime) realTime = 1:realTime; plotTime = false; en...
d02869f2dd6fb4e4c78fa7351ddbb3e1115d51689aba83207c197f3ae61e0d97
MATLAB
2,992
72
function [TmtxS,iFRs,unit_IDs] = SelCellsSleep(fn,twin,minFR,critCvBW,iFRtype) % select cells from PFC and HC data sets (Continuous data case) % % Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk % % Corrects for mismatched unit numbers if using data generated on Blue Crystal. % Cuts up time se...
369dcbb4e6943086eff387045e79d1c251de64c58a1fc1e5788174b5a42677ad
MATLAB
2,994
100
function ImportVideos(self, importTable, varargin) %IMPORTVIDEOS Import new videos into project % IMPORTVIDEOS(SELF, IMPORTTABLE) imports new videos, with video names % and paths contained in IMPORTTABLE, into the project % % IMPORTTABLE(:,1) contains the name of the video in each row % % For single-camera proj...