sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
244c03bffcd9d11147bf029cc12b827b138b90a1e66d2c9445772221d74cbd4b | MATLAB | 1,002 | 31 | function trxGraphicParams=trxGraphicParamsFromAnimalType(animalType)
% Given the animalType, a string, load the animalList.xml file and get the
% markerParams out of it. Append a few other things to make it into a
% trxGraphicParams.
if isdeployed,
filename = deployedRelative2Global('params/animalList.xml');
else
... |
5842a09efcd67f6713aa2805d2a7877aac64fc8940e55c55320dfcb2d48838a6 | MATLAB | 1,002 | 44 | function [start,ends,ngroups]=find_groups(x)
% findgroups: locates the start and end index of a congigous binary index
% Often used after contigousframes.m to find the locations of groups of contigous frames
% and the corresponding number of groups
%
% Input:
% x: binary index
% Output:
% start: v... |
64132c81a3a0fcbfd845af27b24e87661f6351c9e94edf53284eb72e4984f17c | MATLAB | 1,002 | 23 | %% 非线性(动力学)特征:基于时域的熵 | nonlinear features: time-domain-based entropy
%% Tsallis Entropy
% X: single channel EEG signal (either a row vector or a column vector)
% See also:
% feat_ShannonEntropy, feat_LogEnergyEntropy, feat_RenyiEntropy,
% feat_MeanEnergy, feat_MeanTeagerEnergy
%% Reference
% [1] Har... |
8e2c3035cb6cc1c13460e0993e81338bd98332d55c516585ab3b0b65dc01f817 | MATLAB | 1,002 | 34 | function s = allsubs(x)
%ALLSUBS Generate all possible subscripts for a sparse tensor X.
%
% See also SPTENSOR.
%
%MATLAB Tensor Toolbox.
%Copyright 2015, Sandia Corporation.
% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others.
% http://www.sandia.gov/~tgkolda/TensorToolbox.
% Copyright (2015) Sand... |
9a7462be2b297af8420db67a7189fcd63e0ce6d0deb212e3e79d49e1629aca7b | MATLAB | 1,002 | 35 | function B = full(A)
%FULL Convert a sparse tensor to a (dense) tensor.
%
% B = FULL(A) converts a sptensor A to a (dense) tensor B.
%
% See also SPTENSOR, TENSOR.
%
%MATLAB Tensor Toolbox.
%Copyright 2015, Sandia Corporation.
% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others.
% http://www.sand... |
bd80317694cddcd3f70c4100852afc9fdd575412df28de51bcf36fbb872ae6e4 | MATLAB | 1,002 | 17 | function [ci] = ci_fromHessian(hessian, alpha)
% An additional method for estimating confidence intervals is to use
% the covariance matrix (this is completely analogous to using the sum
% of squares (variances) in simple linear regression. We can get the
% covariance matrix from our maximum likelihood optimization ... |
48219125f5747817df6169d4421ccc917bd3475421dbd1a7bd963e2f18a88332 | MATLAB | 1,003 | 38 | function [val,idx] = minK(A,k)
%% Efficiently return the K smallest elements along the 2nd dimension
% Just like built in min except we return the k smallest along the 2nd
% dimension so that if A is m-by-n val is m-by-k.
%
%
% Sorting requires O(nlog(n)) time, whereas calling min k times requires
% O(n*k) time. Theref... |
607fef7df0f34268d53be31e7177857b7c09eed59d4661a4c3f5dbc38e3e7adc | MATLAB | 1,003 | 48 | function varargout = myparse_nocheck(params,varargin)
% Like myparse, but doesn't error when it finds a key in params that is not in
% varargin. Will return a cell array of unrecognized key-value pairs if
% nargout is large enough.
nout = nargout;
% set defaults
varargin_count = length(varargin) ;
ncopy = min(nout,f... |
ac4691ca6afa587c74326d604c3ec6656280e4f33548b68bc263b318c969d237 | MATLAB | 1,003 | 46 | % loadSDPFromNNdata
% load spike detection parameters
% from NNdata
function loadSDPFromNNdata(self, futz_factor)
if self.verbosity > 9
disp(mfilename)
end
channel = self.channel_to_work_with;
if nargin == 1
futz_factor = 1;
end
if isempty(channel)
disp('No channel selected')
return
end
% update settings f... |
bb566845c1c6e518f1cb507c3df5261ef9a6cbda43b27a8999efa8343639bbaf | MATLAB | 1,003 | 32 | function M = fillUpMatrix(A, m, n, N)
% M is a matrix m X n
% composed of A (top left corner)
% if size(A) > size(M), then A is trimmed to fit M
% if number of cols of A is less than n, then the remaining n-size(A,2) cols of each line of A are
% filled with randperm(N,n-size(A,2)) numbers not contained in the giv... |
bf223b669ebbf7fbadc37e835b3cf020460347c569dd8cfa2939193720c842ce | MATLAB | 1,003 | 43 | function [M, counts] = partitionedMean(X, y, C)
% Group the rows of X according to the class labels in y and take the mean of each group
%
% X - an n-by-d matrix of doubles
% y - an n-by-1 vector of ints in 1:C
% C - (optional) the number of classes, (calculated if not specified)
%
% M - a C-by-d matrix of means.
... |
cec36cd2f783fba86e9aef07f51312c328d8c0ad636b6ae9d6cca36b5e974ee9 | MATLAB | 1,003 | 25 | function prec_avg_rsl(input_fn)
for i=1:numel(input_fn)
[filepath,name,ext] = fileparts(input_fn{i});
hdr = spm_vol(fullfile(filepath,[strrep(name,'mni_mrs_','mni_mask_bg_mrs_'),ext])); % header
img_mask = spm_read_vols(hdr); % image
hdr = spm_vol(input_fn{i}); % header
img = spm_read_vols(hdr... |
05b0b50f9f97f5731969435b94ea37f2b75c55b04031b056b74d03f31cbc810a | MATLAB | 1,004 | 39 | function pi = mcStatDist(T, method)
% Compute the stationary distribution of a discrete state, discrete time Markov chain
% Returns a row vector
% This file is from pmtk3.googlecode.com
% Example
% T=[0.7 0.2 0.1; 0 0.5 0.5; 0 0.9 0.1]
% mcStatDist(T) = 0.0000 0.6429 0.3571
%
% T=[0 1 0; 0.5 0 0.5;1 0 0];
% m... |
2d6c8a9854a2e2401b939a6d4a5a0ee504755037d764b4b71135721691c50c59 | MATLAB | 1,004 | 39 | function [fx] = f_FitzHughNagumo_calcium(Xt,Theta,ut,inF)
% FitzHugh-Nagumo membrane potential evolution function (+convolution)
% function [fx] = FitzHughNagumo(Xt,Theta,ut,inF)
% IN:
% - Xt: system's states, ie:
% Xt(1): calcium imaging prediction
% Xt(2): membrane depolarization (mV)
% Xt(3): pr... |
c1cfb688119fa4e42ec0873490e217b941780a4b1e8205b393f402566ff68a40 | MATLAB | 1,004 | 22 | classdef (Sealed) AdjMatrixRndGraph < adjmatrix.AdjMatrixFromNetX
methods
function this = AdjMatrixRndGraph(params, loadOnInit, delAfterLoad)
% creates a complete graph (mean-field network)
%
% params {AdjMatrixParams}: params of the adjacency matrix
% loadOnI... |
262cfc751422b283c76625b72febd1727609da957dd452a0713e172807d5ae25 | MATLAB | 1,005 | 30 | function [FDcutoffs,gevDVcutoffs] = loadCombinedCutoffs(useGSR)
OGgevDVcutoffs = loadGEVdvCutoffs();
ogFDcutoffs = loadFDcutoffs();
FullSampleLPFFDnoGSR = 3.3866;
FullSampleGEVDVdNoGSR = 1.3859;
FullSampleLPFFDwithGSR = 1433.6;
FullSampleGEVDVdWithGSR = 1.3000;
DVtoF... |
21cbf061845720c44c48d0ac74f0d2fef6d1d5144f82f80fd1af59e05750b9c7 | MATLAB | 1,006 | 35 | function resStruct = addFieldToStruct(struct,fieldVal,fieldName)
if ~iscell(fieldName)
fieldName = cellstr(fieldName);
end
%% get length of struct and field names
structLength = length(struct);
oldFields = string(fields(struct));
fieldName = string(fieldName);
%% convert struct to cell
if length(struct) > ... |
430f2884faeedb6d83d271daa8bf8c22c1ba4ba7e57b62c64e2bc90467738b70 | MATLAB | 1,006 | 49 | function GRT = grt_fourier(grt,cfg)
%
%
%
subject = cfg.subject;
cond = cfg.cond;
if isfield(cfg,'file') && isfield(cfg.file, 'path');
path = cfg.subject;
end
try
fsu = cfg.file.su;
catch
fsu = '';
end
for s = 1:length(subject)
eval(['load ' path{s} '/' subject{s} fsu ' ' subject{s} fsu ])
eval... |
74290b15c78a29bfffb391b8798b2dcc972beb79c750e5db9cc1b6cc73ab3aba | MATLAB | 1,006 | 53 | function [fx,dF_dX,dF_dTheta] = f_2DneuralField(Xt,Theta,ut,inF)
% 2D neural field evolution function (wave propagation)
% function [fx,dF_dX,dF_dTheta,d2F_dXdTheta] = f_2DneuralField(Xt,Theta,ut,inF)
% This function evaluates the evolution function of a linear 2D neural
% field.
deltat = inF.deltat;
try
L = inF.L... |
79644b00e246223d0cdf9952a1a7c81b6ce8c34b79086032168ab655a0ca2828 | MATLAB | 1,006 | 34 | function disp(t,name)
%DISP Command window display of a ttensor.
%
% DISP(T) displays a ttensor with no name.
%
% DISP(T,NAME) display a ttensor with the given name.
%
% See also TTENSOR.
%
%MATLAB Tensor Toolbox.
%Copyright 2015, Sandia Corporation.
% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and... |
aa7121f009af052ba2abb7a3dec09e60fc85974ec66d5a7cd6278ce4a8376162 | MATLAB | 1,006 | 47 | % [X,Y] = ellipsepoints(a,b,x0,y0,phi)
function [X,Y,theta] = ellipsepoints(a,b,x0,y0,phi,npoints)
if (nargin < 2)||(nargin > 6),
error('Usage: [X,Y,theta] = ellipsepoints(a,b,x0,y0,phi,[npoints])');
elseif nargin == 2
x0 = 0; y0 = 0;
phi = 0;
elseif nargin == 3
phi = x0;
x0 = 0; y0 =... |
cfca4ee15d11d68cbb2cc37f73894968d8e4306a7aa9d3ef9d17c2ca1b7fdc4a | MATLAB | 1,006 | 39 | function batch_kilosort(data_folder)
% Find all subfolders
% handle input as csv of basepaths or directory
if contains(data_folder,'.csv')
df = readtable(data_folder);
else
df = compile_sessions(data_folder);
end
basepaths = unique(df.basepath);
% loop through folders and process those that don't have eviden... |
57ef747b164e5b1cb16e5cad8cc70182e194b6af33785d94ff0dcdf00f9ed6f9 | MATLAB | 1,007 | 25 | %--------------------------------------------------------------------------
% Purpose: Generate stimulus waveforms and power conditions for IT analysis
%--------------------------------------------------------------------------
function [waveForms,conditions] = getStims(numPulses,PW,ISI,fs,binSize,numtrials,energyVec,s... |
6d174336ec94a818b5f9e15a75a6abfd627455bb58aac648239d1a85f9baf39b | MATLAB | 1,007 | 56 | %{
_ _
___ _ __ __ _| |__ ___ ___ _ __| |_
/ __| '__/ _` | '_ \/ __|/ _ \| '__| __|
| (__| | | (_| | |_) \__ \ (_) | | | |_
\___|_| \__,_|_.__/|___/\___/|_| \__|
### zoomCallback
**Syntax**
```
zoomCallback(self,~,event)
`... |
afa4352c2b7e97fc16d32e18e5c7bb9c7117d2d3ec6d49b65ab9fbe6de4a9ab5 | MATLAB | 1,007 | 59 | function [flag] = isHrfStable(X,kas,kaf,phi)
try
phi;
catch
phi = -0.5785;
end
% get vasodilatory signal and blood inflow
X1 = X(1);
X2 = X(2);
% if X(1) > 0
% flag = 1;
% return
% end
% first compute separatrix
x2 = [-5:1e-3:5]';
n = length(x2);
x1 = phi.*exp(kaf/2-abs(kas-kaf/2)).*exp(x2);
dx1 = ... |
e6a0293fbd94de77c59779f03850e23591af45dfc842ab9905f55e2fe285d380 | MATLAB | 1,007 | 33 | function build_run_epp
eppPath=fileparts(mfilename('fullpath'));
autoGatePath=fileparts(eppPath);
utilPath=fullfile(autoGatePath, 'util');
buildPath=fullfile(fileparts(autoGatePath), 'run_epp_compiled');
if exist(buildPath, 'dir')
rmdir(buildPath, 's')
end
mkdir(buildPath);
copyfile(fullfile(autoGatePath, 'CytoGeni... |
fac86fb6f6b7fd20af9bedf9852179c6b8af27174ea29d7543fbf83b2e170a02 | MATLAB | 1,007 | 46 | %%% Small script file that etst
%load Calib_Results;
% Collect all the points distorted (xd) and undistorted (xn) from the
% images:
xn = [];
xd = [];
for kk = ind_active,
eval(['x_kk = x_' num2str(kk) ';']);
xd_kk = normalize_pixel(x_kk,fc,cc,zeros(5,1),alpha_c);
eval(['X_kk = X_' num2str(kk) ';']);
... |
28fcb702b25b3c58e36f1860c3ee2da58f4dc2f23dd5d5a092eac06bd9ff74e9 | MATLAB | 1,008 | 28 | function [] = getPosteriorfromOTO(posterior,out)
% OTO: recovers posterior sufficient statistics from VB inversion
mux = posterior.muX(1:2,:);
sx = [mux(1,:).*(1-mux(1,:));posterior.muX(3,:)];
V = VBA_getVar(posterior.SigmaX.current);
V = [zeros(1,size(V,2));V(2,:)];
ha = plotUncertainTimeSeries(mux,sx);
title(ha,'W... |
f673c56c75f3e730a1922861d9ab1d235a9b97375b1f0d46dd6af99a14853312 | MATLAB | 1,008 | 34 | function [posR, triR, removetri] = remove_vertices(pos, tri, removepos)
% REMOVE_VERTICES removes specified vertices from a triangular mesh
% renumbering the vertex-indices for the triangles and removing all
% triangles with one of the specified vertices.
%
% Use as
% [pos, tri] = remove_vertices(pos, tri, sel)
npo... |
0c14d22e72ffc11d7478daf5b541ba9f2c24facc8883ce2b516b60a23043879d | MATLAB | 1,009 | 35 | function model = naiveBayesFit(Xtrain, ytrain, pseudoCount)
% Fit a naive Bayes classifier using MAP/ML estimation
% We current assume binary features.
% For Gaussian feautres, use discrimAnalysisFit(X, y, 'diag').
%
% Xtrain(i,j) = 0 or 1, for bit j in case i
% ytrain in {1,...C}
% pseudoCount is optional strength of... |
1e8731c370fe0f4e5843b3c3fda420b1058a3117b0869caeac33b0ce09233e2b | MATLAB | 1,009 | 35 | function [L,R,k] = curvature(X)
% Radius of curvature and curvature vector for 2D or 3D curve
% [L,R,k] = curvature(X)
% X: 2 or 3 column array of x, y (and possibly z) coordiates
% L: Cumulative arc length
% R: Radius of curvature
% k: Curvature vector
% The scalar curvature value is 1./R
% Ve... |
3fc08d65e6b97c0b5f8b97bd74712b57b8c72263818aec41aa224859678de889 | MATLAB | 1,009 | 22 | classdef (Sealed) AdjMatrixWattsStrogGraph < adjmatrix.AdjMatrixFromNetX
methods
function this = AdjMatrixWattsStrogGraph(params, loadOnInit, delAfterLoad)
% creates a complete graph (mean-field network)
%
% params {AdjMatrixParams}: params of the adjacency matrix
... |
630ebc5ff9b364570ea1fce48b1d32c050e51fa5cb5bd203ff6a249382e1fef7 | MATLAB | 1,009 | 32 | %% Shifted Symmetric Higher-Order Power Method (eig_sshopm)
%% Data tensor
% From Example 1 in E. Kofidis and P. A. Regalia, On the best rank-1
% approximation of higher-order supersymmetric tensors, SIAM J. Matrix
% Anal. Appl., 23 (2002), pp. 863–884, DOI: 10.1137/S0895479801387413.
A = tenzeros([3 3 3 3]);
A(perms... |
9cf5bdf743c314227bf758ff55288e165602cdcd8e0e7a7360da1359528c5cbe | MATLAB | 1,009 | 35 | function fcc = calcFagioloCC(W)
% CALCFAGIOLOCC calculates the clustering coefficient of a directed binary graph.
% The function uses equations 6-8 from Fagiolo (2007) to compute the clustering coefficient.
%
% Inputs:
% - W: Directed binary graph (adjacency matrix)
% W must be a square matrix with binary valu... |
af232e58290c40bab122f7d37c98fd403461985d0685847a4c2d4ba1ca3538c3 | MATLAB | 1,009 | 27 | %%Crop each channel based on the xtrema of non-emmpty pixels based on
%%Lectin channels of each sample
function crop_sample(sample_num, run_num)
loadExperimentParams;
filename = fullfile(params.INPUTDIR,sprintf('sample%dround%d_%s.tif',sample_num,run_num,'Lectin'));
disp('Loading Data...');
img =... |
d5ac86f62c8affeb3d3ea1eb326a188fc15dd44132c88ed3fc2548518871106c | MATLAB | 1,009 | 31 | function [model, logev] = linregFitVb(X, y, pp, useARD)
% Variational bayes inference for linear regression
% This is a wrapper to Jan Drugowitsch's code.
% We use the following prior:
% p(w, beta, alpha) = N(w | 0, (beta diag(alpha))^{-1}) *
% * IG(beta | a0, b0) * prod_j IG(alpha(j) | c0, d0)
% where a0, b0, ... |
031862adea08eeb2d74d4dd0f055d48678e1a146ffbf4e84e5d0f25e9f248aa3 | MATLAB | 1,010 | 45 | %% Fill inner region for vesseg graphic usage
% Author: Antonio Martinez-Sanchez
% N: oriented normals (norm == 1)
% F: output filled tomogram
function F = filling( N )
%% Initilialization
[Nx,Ny,Nz,~] = size( N );
F = zeros( Nx, Ny, Nz );
szi = Nx .* Ny;
h = waitbar( 0, 'Size measuring and labeling...' );
%% Distanc... |
12004c9ccaf3f7501f0fc4f457b791d4ea0a943a861dbfcb0977ca0213556bfa | MATLAB | 1,010 | 44 | function [amps,freqs] = meg_FFTparams(data,Fs,df)
% MEG_PLOTTF(data,p,selectedChannels,selectedFreq)
% computes fft based on desired frequency resolution and sampling rate
%
% INPUT
% data
% structure of condition cells containing
% data matrix, time x channels x trials
% Fsamplex
% frames per second (e.g. 1000... |
19bb39f48731add391cf2f7f84b80d5ac44dbe8a049bbeae209c7e2423da539f | MATLAB | 1,010 | 35 | function [G, fill_ins] = mkChordal(G, order)
% Eliminate nodes in specified order, and ensure uneliminated
% neighbors are fully connected by adding edges if necessary
%
% fill_ins(i,j) = 1 iff we add a fill-in arc between i and j.
% PMTKmodified Matt Dunham
% This file is from pmtk3.googlecode.com
MG = G;
n = lengt... |
4ad84985d469d78e2e8044276e8d8dfbfe3dc60a07d87b3a50a29fae04528c83 | MATLAB | 1,010 | 19 | function cond = conditions_for_concurrency()
loadParameters;
cond = struct;
cond.dim = image_dimensions(fullfile(params.deconvolutionImagesDir,sprintf('%s_round001_%s.%s',params.FILE_BASENAME,params.CHAN_STRS{1},params.INPUT_IMAGE_EXT)));
cond.imgsize_dbl = prod(cond.dim)*8 / 1024 / 1024;
... |
8dd962ff216120a8d1244cba021d16e3741bfd5092c4e13dcfb8fe460307dd9d | MATLAB | 1,010 | 49 | %% DNA Sequence Demo
%
% This file is from pmtk3.googlecode.com
close all; clear all
setSeed(1);
Nseq = 10;
Nlocn = 15;
Nletters = 4;
Nmix = 4;
pfg = 0.30;
mixweights = [pfg/Nmix*ones(1,Nmix) 1-pfg]; % 5 states
z = sampleDiscrete(mixweights, 1, Nlocn);
alphas = 1*ones(Nletters,Nmix);
for i=1:Nmix
alphas(i,i) = 20;... |
1ef92f6b47072ee8b5ad33cfcc85ab2955cec98f155fbf9596f7d69a69a34276 | MATLAB | 1,011 | 54 | %% Residuals Demo
%
%%
% This file is from pmtk3.googlecode.com
setSeed(2);
N = 21;
[xTrainRaw, yTrain] = ...
polyDataMake('sampling','thibaux', 'n', N);
Ntrain = length(xTrainRaw);
xTrain = [ones(Ntrain,1) xTrainRaw(:)];
X = xTrain;
y = yTrain;
%w = pinv(X'*X)*X'*y; % OLS estimate
w = X\y;
yPredTrain = xTra... |
39310a172041077ff8aeee7d2966073d72595015b6734fbbfc8de5d7abcad893 | MATLAB | 1,011 | 44 | %% Gauss Height Weight Demo in 2d
%
%%
% This file is from pmtk3.googlecode.com
rawdata = loadData('heightWeight'); % comma delimited file
data.Y = rawdata(:,1); % 1=male, 2=female
data.X = [rawdata(:,2) rawdata(:,3)]; % height, weight
maleNdx = find(data.Y == 1);
femaleNdx = find(data.Y == 2);
classNdx = {maleNdx, f... |
4eaaac4caa4840ac5e4e890f2b1f9febf20ffa2d3d13c2ef103f3c48b5f19de8 | MATLAB | 1,011 | 36 | %% Converts excel spreadsheet extracted ROIs from ImageJ into mat files and calculates Fc and Fc3
%Chad Heer and Can Dong; Sheffield lab
clear all;
%% parameters
measurements=1;
scalewindow=300; %#of frames should be setted differently according to the data
%%get data
[ROI_filepaths, temp]=uigetfile('*.csv', 'Chos... |
6f65960b8023243e24922e9d619d5b3a34fe80493451b033cb049a80926099e6 | MATLAB | 1,011 | 22 | classdef (Sealed) AdjMatrixHolmeKimPLGraph < adjmatrix.AdjMatrixFromNetX
methods
function this = AdjMatrixHolmeKimPLGraph(params, loadOnInit, delAfterLoad)
% creates a complete graph (mean-field network)
%
% params {AdjMatrixParams}: params of the adjacency matrix
... |
f903257ec31e57b85fb165c5fad2565016bce86bc7a74f8591abb76f4a0f7064 | MATLAB | 1,011 | 26 | function Simul(file,vid)
start = CP_Init(strcat(file,'.csv'));
out = CP_Run(start,vid);
if vid
gifmaker(file,out);
out = rmfield(out,'MOV');
end
save('CoPropagation','out','-v7.3');
%% Figures
s = out.s; t_lim = out.t_lim;
T = out.RES.T; P1 = out.RES.P(:,:,1); P2 = out.RES.P(:,:,2); U = out.RES.U; N = size... |
0eef1a0ad4b19989032bde622c27d00e88cde14274d5be8fe41382b6e14ad0a5 | MATLAB | 1,012 | 47 | function [fx,dfdx,dfdp] = f_gen(Xt,Theta,ut,inF)
% Generic evolution function (up to quadratic terms)
% [fx,dfdx,dfdp] = f_gen(Xt,Theta,ut,inF)
deltat = inF.deltat;
n = size(Xt,1);
nc = factorial(n)./(factorial(2)*factorial(n-2));
A = reshape(Theta(1:n^2),n,n);
B = reshape(Theta(n^2+1:n*(2*n+nc)),n,n+nc);
xij = zer... |
1ce9f94dac88c7596d036f7867874fa93f79773a99346a290c7da9ad07e6c788 | MATLAB | 1,012 | 36 | function [num_subspaces, subsp_dims] = partitionx(nx, order, dx,subs_min,...
subs_max)
num_subspaces = 0;
nused = 0;
nleft = nx;
asleft = sum (dx);
while (nused < nx)
num_subspaces = num_subspaces + 1;
as1 = sum(dx(order((nused+1):(nused+subs_min-1))));
gapmax = -1;
for ns1 = subs_min:(min(subs_max,... |
3387caa161ad654e667642645a508aaf10a32ad98e0837ac92c084ace2c60ede | MATLAB | 1,012 | 20 | function fileList = getAllExtFiles(dirName,Ext)
dirData = dir(dirName); %# Get the data for the current directory
dirIndex = [dirData.isdir]; %# Find the index for directories
dirExtData = dir([dirName '\*' Ext]);
dirExtIndex = [dirExtData.isdir];
fileList = {dirExtData(~dirExtIndex).name}'; %'#... |
426b3438392621e26bc6503a8ddf9070e1d910cf1f65cbbec3fe231d9cd15a57 | MATLAB | 1,012 | 36 | %{
Copyright (c) 2025 Axion BioSystems, Inc.
Contact: support@axion-biosystems.com
All Rights Reserved
%}
classdef KeyValuePairTag < Tag
properties(SetAccess = private)
% Key of this Dictonary Entry
Key;
% Key of this Dictonary Entry
Value;
end
methods
fu... |
a530094475e0abe9e9c5721496533b7c9e5b56898a8a9df12777a5ab3fde7013 | MATLAB | 1,012 | 30 | function BF = bayesianTtest(x1, x2, mu_delta, sigma2_delta)
% Bayes factor for H0 (mu1=mu2) vs H1 (mu1 ~= mu2)
% where p(delta/sigma | H1, sigma2) = gauss(lambda, sigma2_delta)
% delta = mu1-mu2, and sigma2 is the common variance.
% See The Bayesian Two-Sample t Test , M. Gönen and W. Johnson and Y. Lu and P. Westfall,... |
d30aad3276bc528340c0a2ccdba7ced03e21e38a0d7e5ae23dcef56d10633e1b | MATLAB | 1,012 | 34 | function [model] = mrf2MkLatticeX(X, method, methodArgs)
% Make a 2d lattice MRF suitable for denoising a particular image
% Based on http://www.cs.ubc.ca/~schmidtm/Software/UGM/graphCuts.html
% This file is from pmtk3.googlecode.com
if nargin < 1, method = 'dummy'; end
if nargin < 3, methodArgs = {}; end
[nRows,n... |
ea963dc0fddf2317ce6ee45888e61375ccc1341a1981cb1e3f9371527ccf4631 | MATLAB | 1,012 | 33 | function allFilesValid = fileValidator(filenameMatrix,maskMatrix)
allFilesValid = true;
filenameMatrixFlattened = filenameMatrix(:);
maskMatrixFlattened = maskMatrix(:);
for i = 1:size(filenameMatrixFlattened, 1)
if ~isempty(filenameMatrixFlattened{i})
[~, ~, ext] = fileparts(filenameMatrixFlattened{i});... |
504abd89b6b84526d134eb2db002881f86d067f849b6fd5e40a3284bdb5bfd50 | MATLAB | 1,013 | 24 | function [circle_centers] = generate_colony_centers(num_circles, padding)
circle_centers = zeros(num_circles, 2);
pick_center = 1;
while pick_center <= num_circles
pick_r = rand;
pick_theta = 2*pi*rand;
circle_centers(pick_center, 1) = pick_r*cos(pick_theta); % pick the x
... |
96c4e41576539e7e60a2a3c1d272659d8a584e90a9e6012435887ccbc7044d9e | MATLAB | 1,013 | 45 | %% Run Kmeans on the old faithful data
%
%%
% This file is from pmtk3.googlecode.com
function kmeansDemoFaithful
X = loadData('faithful');
X = standardizeCols(X);
figure; plot(X(:,1), X(:,2), '.', 'markersize', 10)
title('old faithful data')
grid on
printPmtkFigure('faithful');
% specify initial params to make fo... |
12100d1b5edb0bcd040fab0703240f8f8b178df8f945179254856f0ed5e8a972 | MATLAB | 1,014 | 16 | %% Hjorth parameters
% Hjorth Activity 活动性:衡量信号波幅的偏离程度,是时间函数的方差var
% Hjorth Mobility 移动性:衡量坡度的变化,为信号一阶导数方差的平方根 除以 信号方差的平方根
% Hjorth Complexity 复杂性:衡量一个振幅上有多少个标准的坡
% X: single channel EEG signal (either a row vector or a column vector)
% See also:
% feat_HjorthMobility, feat_HjorthComplexity
%% Reference
% ... |
226aebccb38d65b0ad739e101c0dfe0ad0d922f349cc5f5c72838fb0da1dbef8 | MATLAB | 1,014 | 31 | function [ys,ysCum] = fernsRegApply( data, ferns, inds )
% Apply learned fern regressor.
%
% USAGE
% [ys,ysCum] = fernsRegApply( data, ferns, [inds] )
%
% INPUTS
% data - [NxF] N length F binary feature vectors
% ferns - learned fern regression model
% inds - [NxM] cached inds (from previous call to fern... |
ab2cd97362a536e639a52fbf9dcdf6eea12a6c913f9e3608f839a305f8f16fd5 | MATLAB | 1,014 | 41 | % HIFIE_SPDIAG_SV_P Dispatch for HIFIE_SPDIAG with DINV = 1 and F.SYMM = 'P'.
function D = hifie_spdiag_sv_p(F,spinfo)
% initialize
N = F.N;
n = length(spinfo.i);
P = zeros(N,1); % for indexing
D = zeros(N,1); % for output
% loop over all leaf blocks from top to bottom
for i = n:-1:1
% find act... |
b31b58a807d2b5dbd43fb211a6950e18ac0c2017961946b0f186c564039d4746 | MATLAB | 1,014 | 34 | function [gx] = g_BSL(x,phi,u,in)
% observation function for a Bayesian sequence-learner (BSL)
% function [gx] = g_BSL(x,theta,u,in)
% BSL is guessing the next outcome y_t based upon P(y_t=1|y_{t-1}), ie her
% bet actually depends upon the past sequence of outcomes.
% IN:
% - x: sufficient statistics of log-odds of P... |
ddd09cb80c72a73bdd95a65a04ec25ae8d28778262e739cc10dc3fbf26ad515d | MATLAB | 1,014 | 16 | function PlotBox_Adjusted(BoundingBox,LineStyle,LineColor,LineWidth,Text,TextFontSize,TextFontColor)
BoundingBox(1)=BoundingBox(1)-0.5;
BoundingBox(2)=BoundingBox(2)-0.5;
BoundingBox(3)=BoundingBox(3);
BoundingBox(4)=BoundingBox(4);
plot([BoundingBox(1),BoundingBox(1)+BoundingBox(3)],[BoundingBox(2),BoundingBox(2)],... |
13b0a70cc5a3be373a35ad5e52b23797c9acbcb6fa5d733a91df6852b47eea84 | MATLAB | 1,015 | 26 | function [F, J] = calcSubunitGridOutputs(params, xstimuli)
%CALCSUBUNITGRIDGRATINGRESPONSE Summary of this function goes here
% Detailed explanation goes here
% xstimuli : N x 4 matrix where N is number of stimuli with 4 parameters
% width, orientation, phase, contrast bias
% TO GET THE SUBUNIT WEIGH... |
1f1ad8f7450cc80eb4e73bc8c710d168a1d586ea317d17a86f62f9a2dd9c304d | MATLAB | 1,015 | 34 | function b = permute(a,order)
%PERMUTE Permute dimensions of a ktensor.
%
% B = PERMUTE(A,ORDER) rearranges the dimensions of A so that they
% are in the order specified by the vector ORDER. The tensor
% produced has the same values of A but the order of the subscripts
% needed to access any particular element ... |
56f171be5da0343f06310aba4f3a52ff7c639e700a91a4a65bde395a46a3b707 | MATLAB | 1,015 | 34 | function [s,nsetfn,ts_struct] = setStructLeaf(s,fn,v,varargin)
[ts_struct,ts_set,warnfun] = myparse(varargin,'ts_struct',[],'ts_set',0,...
'warnfun',@(fn) sprintf('Collision collapsing parameter %s, using most recent value',fn));
if isempty(ts_struct),
ts_struct = struct;
end
fns = fieldnames(s);
nsetfn = 0;
for... |
573b5646700eac10c793ccc3e1e7836a070f78b4a04dd84b2573dc55e7925bc2 | MATLAB | 1,015 | 22 | classdef (Sealed) AdjMatrixConnWaStGraph < adjmatrix.AdjMatrixFromNetX
methods
function this = AdjMatrixConnWaStGraph(params, loadOnInit, delAfterLoad)
% creates a complete graph (mean-field network)
%
% params {AdjMatrixParams}: params of the adjacency matrix
... |
5afa052ef2def394de9bc0ef375c7dbf6fb11b427fd4e71efa9cd0627d2cea29 | MATLAB | 1,015 | 27 | %% Test the oneVsRestClassifFit function
% by comparing its results to liblinear's built in procedure.
% PMTKslow
% PMTKneedsOptimToolbox quadprog
%%
% This file is from pmtk3.googlecode.com
requireOptimToolbox
loadData('soy'); %C=3, N=307, D=35
setSeed(0);
[X, Y] = shuffleRows(X, Y);
Xtrain = X(1:250, :); ytrain =... |
7f955e14cbb3692f3d958ab4b805150441285cf5f5f86f509846488298387fbe | MATLAB | 1,015 | 40 | function [drNdrT] = get_drNdrT(M,nt,dt,par,y)
%% This function returns d(rho(:,end))/d(r) transpose times a vector y
%
% y... vector length(prod(n),1)
% rho(:,0) -----------> rho(:,1) --------------> rho(:,2)
% u(:,1) u(:,2)
% R1, S1 R2, S2
%%
n ... |
aec43d4225031cfe9f216e2301a99b0a11da1d621e3da19fc45ba1e45f07709d | MATLAB | 1,015 | 41 | % HIFIE_SPDIAG_MV_P Dispatch for HIFIE_SPDIAG with DINV = 0 and F.SYMM = 'P'.
function D = hifie_spdiag_mv_p(F,spinfo)
% initialize
N = F.N;
n = length(spinfo.i);
P = zeros(N,1); % for indexing
D = zeros(N,1); % for output
% loop over all leaf blocks from top to bottom
for i = n:-1:1
% find act... |
e289f3dccaadace30968c1f12f58d6ba634bd23fbcb4b4b4926eafa3528fb60f | MATLAB | 1,015 | 28 | function plot_evaluation_points( x, evaluation_points )
% *SPONTANEOUS WAVES DEMO*
%
% PLOT EVALUATION POINTS plot calculated evaluation points over the set
% of channels in a multielectrode array
%
% INPUT
% x - datacube (rows,cols,timepts)
% evaluation_points - evaluation time points ... |
07e4c911b6ac38a4d651b4b2a2cdecf13a5ade37830c71d2aed8cca9a6439e49 | MATLAB | 1,016 | 56 | function LAN = mod_time(LAN, time, mod, fix)
% 13.4.2009
% time = [-0.5 0.5]
% mod = [1 2 ] % 1 for initial time and
% % 2 for end time
% fix = 1 % fix time for all epoch
% LAN = mod_time(LAN, time, mod, fix)
%
%
if nargin < 4; fix = 1;end
%
if ~iscell(LAN)
LAN = mod_time_st(LAN, time, mod, fix);
el... |
1c17f2cd97325c88f61e0ed201c556d98d145bd486446f520fbbd5e0408989bc | MATLAB | 1,016 | 29 | function [ret,messages] = check_files_in_color_correction()
loadParameters;
if params.DO_DOWNSAMPLE
FILEROOT_NAME = sprintf('%s-downsample',params.FILE_BASENAME);
else
FILEROOT_NAME = sprintf('%s',params.FILE_BASENAME);
end
ret = true;
messages = {};
for r_i = 1:params.NUM... |
66807073195a353c165d59c885c4f84f82bc3a642ce22db0f036897ffa23cc5b | MATLAB | 1,016 | 32 | function Struct2Txt(TempStruct,SaveDir,SaveName)
AllFields=fieldnames(TempStruct);
CurrentLine=1;
ExportArray{CurrentLine,1}='SaveName: ';
ExportArray{CurrentLine,2}=SaveName;
CurrentLine=CurrentLine+1;
ExportArray{CurrentLine,1}='=========================================================... |
7cc6829cf824d1d69bd855291c2d6daf74f134a4b5fdaa2608b26cb2e00b34ef | MATLAB | 1,016 | 34 | function pool_cmp2 (variable, subVariable , path, group1, group2)
%path = 'E:\GAD67 results\Recordings\';
%variable = 'pair_corr';
%subVariable = 'tot';
%group1 = 'pyr';
%group2 = 'int';
files = dir(path);
fileNames = {files.name};
fileIsDir = {files.isdir};
fileNames = fileNames(cell2mat(fileIsDir)==0); %size of fil... |
a21aeafcdaf0b77033b0814cca1c8bcbfdeff4ba5ca941964ade511ee22ca625 | MATLAB | 1,016 | 33 | %GRAY Black-white colormap
%
% Examples:
% map = gray;
% map = gray(len);
% B = gray(A);
% B = gray(A, lims);
%
% Similar to MATLAB's gray function, but also able to return a concise
% colormap table.
%
% The function can additionally be used to convert a real-valued array into
% a truecolor array using the co... |
04be53a7af7d45cec835db79671f01b0835d9e2dd02ab2450dc43db0ba603450 | MATLAB | 1,017 | 52 | % plot_FigS3
load(fullfile(saveLoc, 'sig_allSessions'))
dimms = [63 20 1];
plotSig = {'Ramp', 'PC1', 'TinC'};
sigName = {'S^{ramp} [a.u.]', 'S^{PC1} [a.u.]', 'S^{con}_{Tin} [sp/s]'};
yTicks = {[0 .5 1], [0 .5 1], [0 10 20 30]};
% cutoff = 0.7; ls = '-'; lw = 1;
% smooth_win_t = 0.025;
rows = length(di... |
517bc47d6e6f9196c548f8f782e001360e57817dc9fd963142edd040542d8f84 | MATLAB | 1,017 | 26 | function s_file = smoothing_4d(wfunc_file,fwhm)
wfunc_vols=[];
for i=1:length(wfunc_file)
[other_p,other_n,other_e] = fileparts(char(wfunc_file{i}));
wfunc_vols= [wfunc_vols; cellstr(spm_select('ExtFPList',other_p,['^' other_n other_e '$'],inf))];
end
clear matlabbatch
matlabbatch{1}.spm.spatial.smooth.data =... |
b91f3337d63c7bc640b564c6ea4e7813ac67124681f542a7353de3c3e75e1a14 | MATLAB | 1,017 | 37 | function delUnits = ReplaceUnit(unitIn, unitFile)
% **** NOT FINISHED **********
% returns a list of units in the same session as unitIn but not in unit,
% for possible deletion
if exist(unitFile) == 2
load(unitFile)
else
disp('Unit file not found; no unit data saved')
return
end
% find units in existing... |
42b7a26850baeac368793fa61ff65d7829b1ad7d9af6338757efd7892862d34e | MATLAB | 1,018 | 46 | % _ _
% ___ _ __ __ _| |__ ___ ___ _ __| |_
% / __| '__/ _` | '_ \/ __|/ _ \| '__| __|
% | (__| | | (_| | |_) \__ \ (_) | | | |_
% \___|_| \__,_|_.__/|___/\___/|_| \__|
%
%
% figure out which plugins and installed and link them
% so we can use them
%
function varargo... |
672f2d335c9ab2c2c087c87ec686db275f15b4051442eb2df7b78d30d1135b73 | MATLAB | 1,018 | 34 | % Setup base path
clear;
basefolder = fileparts(fileparts(fileparts(mfilename('fullpath'))));
codefolder = [basefolder,'/code'];
toolsfolder = [basefolder,'/tests/tools'];
addpath(genpath(codefolder));
addpath(genpath(toolsfolder));
% Load Data
data_path = [basefolder, '/tests/fixtures/sub-1_rest1_schaefer400x7_ts.1... |
70a0d6e225e38b6b0bbd3f3c20b0f3ef9bd13a41c30e78d5ad4bc87dcd1f4016 | MATLAB | 1,018 | 31 | function papignit_effcc()
% temporary path for data files
% fcc : eff Cod Criticality
global pds
% ignit_cribay
pds.data.rep.effcc = fullfile(pds.lda, 'papers', 'effCodCriticality');
pds.vizs.rep.effcc = fullfile(pds.rep, 'papers', 'effCodCriticality');
% dsd : data serv directory
% ignit_datsrv should idealy give... |
54f9a9ea9f8b3abd05188d41d3599c21cd374208dc86a30215da440ae0159e19 | MATLAB | 1,019 | 41 | function datasets = h5getdatasets(filepath, grp, recurse)
%H5GETDATASETS Returns a list of all datasets in an HDF5 file.
% Usage:
% datasets = h5getdatasets(filepath)
% datasets = h5getdatasets(filepath, grp)
%
% Args:
% filepath: file path to HDF5 file
% grp: path to group within HDF5 file (default: '/')
% ... |
88f5bc87729af49c14d7c3700c1caf1e33d1e05f77382af4480330ff11633848 | MATLAB | 1,019 | 46 | % Make precision matrix for 2d Gaussian MRF
% Based on p53 of "Introduction to Bayesian Scientific Computing"
% Daniela calvetti and Erkki Somersalo
function L = gauss_mrf_2d_precmat(n)
% http://math.aalto.fi/opetus/inv/TowardsStatIP.pdf
% http://math.tkk.fi/teaching/inv/
% Creating an index matrix to enumerate the... |
b76f3b9c0a579f14044bab5713ed897c3b20a500f69afdc61a236442d52b7360 | MATLAB | 1,019 | 43 | function compute_temp(res, resdir, skip_mat)
% COMPUTE_TEMP Compute and plot the Temporal matrices
%
% :param res: the results from running Mapper
% :type res: Mapper struct
%
% :param resdir: where to save the resulting plots and matrices
% :type resdir: string
%
% :param skip_mat: if true, it doesn't print out the TC... |
c0396ede00d7c9a9a44b27a5bde8fa17606a981534f8deeafa5304342aa0b714 | MATLAB | 1,019 | 32 | %% Demo of robust Bayesian analysis
% From Berger 1984
x = 5; obsVar = 1;
% First let us verify that the Gaussian prior
% indeed satisfies the prior quartiles
priorVar = 2.19; priorMu = 0;
s=sqrt(priorVar); mu = priorMu;
range = normcdf(1,mu,s) - normcdf(-1,mu,s);
assert(approxeq(range, 0.5))
% Now compute posterio... |
c6288922534e26081cb1fde6cb096d12adba89faf357db205a18d671b08defd0 | MATLAB | 1,019 | 34 | % run_dt_invariance.m
% Run a simulation (simTauMap6) at varying values of dt.
% clear the workspace
clear;
% define the save directory
save_dir = fullfile('data', 'dt_invariance');
[~, ~, ~] = mkdir(save_dir);
% iterate over three test values of 'dt'
for dt_val = [0.01, 0.001, 0.0001]
for i = 1:20
% loa... |
3d98a1aaf0914a26da6c18a981851cabbe21c026b353d6d492bc960968b23550 | MATLAB | 1,020 | 35 | function map = dgmMap(dgm, varargin)
%% Find the mode, (map assignment)
% Optional named args are the same as for dgmInferNodes
% This uses jtree.
%
% This file is from pmtk3.googlecode.com
[clamped, softEv, localEv] = process_options(varargin, ...
'clamped', [], ...
'softev' , [], ...
'localev', []);
loc... |
989a2a3b5f871de4cf611f8e935c2f9fff6fab1a5f9646a1c2f82639b9599f28 | MATLAB | 1,020 | 34 | function intervals = GetIntervalsToTrackForErrorMeasurement(movieidx,flies,ts,trxfiles,varargin)
winrad = myparse(varargin,'winrad',200);
nmovies = max(movieidx);
nflies = nan(1,nmovies);
intervals = nan(0,4);
se = strel(ones(1,2*winrad+1));
for moviei = 1:nmovies,
if ~any(movieidx==moviei),
nflies(moviei) = 0;... |
9c78db5520cc7b0346c70e54375df450802dc87286bf03d628ac58e37b02dcc1 | MATLAB | 1,020 | 25 | function P = meshlaplace3D(P, t, nodes, alpha)
% SYNTAX
% P = meshlaplace3D(P, t, nodes, alpha)
% DESCRIPTION
% This function implements lumped Laplacian smoothing
% based on existing Delaunay connectivity for a given set of nodes. Use
% nodes = 1:size(P, 1) for the global smoothing
% Inputs:
% P - a... |
d199a3384404ac736f0c92693be2f2e06f676496bceba73738f6ad0af4d00485 | MATLAB | 1,020 | 30 | function [f,g] = tt_cp_fun(x,Z,Znormsqr)
%TT_CP_FUN Calculate function and gradient for CP fit function.
%
% [F,G] = TT_CP_FUN(X,Z) where X is a vector containing the entries of the
% components of the model and Z is the tensor to be fit.
%
% See also TT_CP_VEC_TO_FAC, TT_FAC_TO_VEC, TT_CP_FG, CP_OPT
%
%MATLAB Tenso... |
d8b9c9a0d567e8b52637d36566ccc6c03707f2acd8f74e504a93afc68a5d8751 | MATLAB | 1,020 | 50 | function [gx,dG_dX,dG_dPhi] = g_sigmoid(Xt,Phi,ut,inG)
% partially observable sigmoid mapping
n = size(Xt,1);
if ~ isfield (inG, 'ind')
inG.ind = 1 : n;
end
G = eye(n);
G = G(inG.ind,:);
if size(Phi,1) >=1
G0 = G;
G = Phi(1).*G;
end
if size(Phi,1) >=2
[Sx,dsdx, dsdp] = VBA_sigmoid(Xt,inG,'slope'... |
e5193ba4cb909ae452ba2758357900f1620cfa935d0dfb74d6aa0c0ebfa2a92c | MATLAB | 1,020 | 29 | function [hs,probs,inds] = fernsClfApply( data, ferns, inds )
% Apply learned fern classifier.
%
% USAGE
% [hs,probs] = fernsClfApply( data, ferns, [inds] )
%
% INPUTS
% data - [NxF] N length F binary feature vectors
% ferns - learned fern classification model
% inds - [NxM] cached inds (from pr... |
9b75d0f15d011ea752300a1323f446f9ee657f355a8dffd8dbad78e4995cf403 | MATLAB | 1,021 | 36 | function spiral = CreateSpiral(scr, gaborsiz, fre, phase, contrast)
%%
% scr: Screen parameters
% gaborfre: gabor width in visual angle
% gaborstd: std of the Gaussian modulator
% fre: gabor frequency: cycle per degree
% phase: phase
% contrast: contrast of the gabor
% There is no orientation parameter here. Rotate the... |
e7cbfd2a8aec3a57a8364db34aa2d2fc35b587a031868e3fc84f1e11ba37eec0 | MATLAB | 1,021 | 30 | function [cope,varcope,tstats] = run_flame( data, vars, design_matrix, contrasts )
%%function [tstat, thresh] = run_glm( data, contrasts )
%
%
% Preallocate arrays
cope = zeros(size(contrasts,1),size(data,2));
varcope = zeros(size(contrasts,1),size(data,2));
tstats = zeros(size(contrasts,1),size(data,2));
% Main loop... |
1239cfc454ee6e40cd65f5c3d06ffde348c4b1e43e7cadfcdcdbf07bbdc8ecdd | MATLAB | 1,022 | 36 | function [n_Wru_v, n_Wrr_n, m_Wzr_n, n_x0_c, n_bx_1, m_bz_1] = unpackRNN(net, theta)
% Note that net.theta is NOT used. If you want to use this function with
% net.theta, then pass it as the second parameter. This accomodates the R{}
% technique for exact computation of the Hessian.
nparams = sum([net.layers.nparams])... |
4ac9f06cce23bc5471f3f82317a141e832bae84bdc9c76c62729ca9b705854c3 | MATLAB | 1,022 | 40 | %% Visually compare tanh and sigmoid functions
%
%%
% This file is from pmtk3.googlecode.com
[styles, colors, symbols, str] = plotColors();
xs = -3:0.1:3;
names = {'tanh', 'sigmoid', 'ReLU', 'PReLU', 'ELU', 'softpplus'};
curves = {};
curves{end+1} = tanh(xs);
curves{end+1} = 1./(1+exp(-xs));
curves{end+1} = max(0, xs... |
8ee26f42ab650db5a2677cde24aa0b9efe87e23e53a9ca4c4e9cc88966cb1ef0 | MATLAB | 1,022 | 31 | function [trialAll, spikeDataset] = spikeProcess(DATAPATH, params)
% Description: load data from *.mat or TDT block
% Input:
% DATAPATH: full path of *.mat or TDT block path
% params:
% - DATAPATH: the path of TDT data or exported mat file
% - params: struct that contains behavior processi... |
f4b85197c6004e8a55a83f19ca21d978069ef9a1ae101bed64c4e5bafa00bc0f | MATLAB | 1,022 | 43 | function img = makeSpiralCheckerboard(pixelsPerDegree, sz, phase, contrast, thetaCycles, E, A, b)
%
% img = makeSpiralCheckerboard(pixelsPerDegree, sz, fr, ftheta, phase, contrast)
if nargin==0
pixelsPerDegree = 100;
sz = 5;
% fr = 1; % spatial frequency of a radial cycle
thetaCycles = 8; % number of s... |
22831091bfab001fc9179f1bc4ce6b9bbd46c04cfa2db66d429a86ea611ef9d2 | MATLAB | 1,023 | 44 | basepath = 'Y:\laura_berkowitz\behavior_validation\appps1_cpp\data\cohort 2\day1\3775N_pretest-07122023121951DLC_resnet50_mouse_cppJun28shuffle1_175000_filtered.csv';
save_path = 'Y:\laura_berkowitz\behavior_validation\appps1_cpp\data\day1\cohort 2';
df = load_dlc_csv(basepath);
fs = 30;
% Choose neck
df_neck = df(... |
2713e569dadea19e8e62fcef6a3a96e46858978e214e80f20ee9bd95db44a03e | MATLAB | 1,023 | 30 | metadata_path = 'Y:\laura_berkowitz\app_ps1_ephys\behavior\behavior_metadata.csv';
meta = readtable(metadata_path,"Delimiter",',');
basepaths = unique(meta.basepath);
basepaths = basepaths(~contains(basepaths,'hpc01')); % remove for now
basenames = basenameFromBasepath(basepaths);
for i = 1:length(basepaths)
... |
b1ffff82de471be2a3938ff10c8e940bac5c86c15d673dde60a652a25a9f1363 | MATLAB | 1,023 | 35 | function [dim] = pos2dim(pos)
% POS2DIM reconstructs the volumetric dimensions from an ordered list of
% positions.
%
% Use as
% [dim] = pos2dim(pos)
% where pos is an ordered list of positions.
%
% The output dim is a 3-element vector which correspond to the 3D
% volumetric dimensions
%
% See also POS2TRANSFORM
... |
d330b378398151311ca7672ded469e4542c8bbce0d70a36befea2ecaad141029 | MATLAB | 1,023 | 58 | function [LAN] = del_trials(LAN, trials)
%
% v.1 form eliminar.m 9.4.2009
if iscell(LAN)
for lan = 1:length(LAN)
[LAN{lan}] = del_trials_st(LAN{lan}, trials{lan});
end
else
[LAN] = del_trials_st(LAN, trials);
end
end
function [LAN] = del_trials_st(LAN, trials)
LAN.data_del.data = [];
LAN.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.