sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
025c94ff32f13776604172ba02307c733d89f1726ce4c1c6982a9086917f0d7e | MATLAB | 353 | 8 | %% Function of rate of inhibition of histidine decarboxylase (HTDC) by FMH suicide inhibition.
% b is concentration of FMH in the brain (uM), a is the rate of inhibition
% (h-1).
function a = k_fmh_inh(b)
k_fmh = 10.4040; %Constant of FMH suicide inhibition reaction (h-1).
ki = 8.3; %FMH dissociation constant in u... |
634030098eb9f166e322063aae46bfd69e715e43108410fb718d1ec627935d50 | MATLAB | 353 | 23 | function do = r_mkdir(d,new_dir)
if isstr(d)
d = repmat({d},size(new_dir));
end
if isstr(new_dir)
new_dir = repmat({new_dir},size(d));
end
if any(size(d)-size(new_dir))
error('rrr \n the 2 cell input must have the same size\n')
end
for k=1:length(d)
do{k} = fullfile(d{k},new_dir{k});
if ~exist(do{k})
... |
a3b1ca34b4d3a1e1eff5d430e59b74de8c0738379e4ea75041c00bf81bc0a8b0 | MATLAB | 353 | 17 | function [ dx,dy,dz ] = cgradient( f )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
[dx, dy, dz] = gradient(f);
dx(:,1,:) = floor(dx(:,1,:));
dx(:,end,:) = ceil(dx(:,end,:));
dy(1,:,:) = floor(dy(1,:,:));
dy(end,:,:) = ceil(dy(end,:,:));
dz(:,:,1) = floor(dz(:,:,1));
dz(:,:,... |
d92857638a88bfe51256e8e1de8b6d7ad094654ea7fd6ae191e70b4ac3ff5003 | MATLAB | 355 | 20 | function [a, b] = get_nonlin_params(session, channel, unit, fold)
% Get paramters of nonlinearity
%
% Parameters
% ----------
%
% - fold: integer scalar
% Fold number
%
% Returns
% -------
% - a: scalar
% Scale
% - b: scalar
% Bias
model = load_model(session, channel, unit, fold);
a = model.set_of_params.params(... |
2e2c330039d4ed7c6ae19a7b6aaae2cecaf00f6cb4ee46258a5b744e4d0cc86e | MATLAB | 356 | 11 | function depWarn(cmd, infoStr)
%DEPWARN warn user of deprecated functionality
% optionally, print a (hopefully helpful) message
wmsg = sprintf('''%s'' has been deprecated', cmd);
if nargin > 1 && ~isempty(infoStr)
wmsg = sprintf('%s\n\n%s', wmsg, infoStr);
end
uiwait(warndlg(wmsg, 'D... |
96eaf488078b1f567a10fe408534ec7b1109ccc8188c6e7de48a553e79025fef | MATLAB | 356 | 11 | function updateFigMap(obj)
%UPDATEFIGMAP Plot probe map
if isempty(obj.selected) || ~obj.hasFig('FigMap')
return;
end
hFigMap = obj.hFigs('FigMap');
jrclust.views.plotFigMap(hFigMap, obj.hClust, obj.hCfg, obj.selected, obj.channel_idx);
hFigMap.hFunKey = @(hO, hE) []; % do-nothing funct... |
ec0d38fa0847e2acbe810549f98d5004d4c23dd6adf28dae466269ac5923de7a | MATLAB | 356 | 11 | function kernel = XxGuassianGenerator3D(Nx, Ny, Nz, sigma_xy, sigma_z)
kernel_xy = fspecial('gaussian', [Nx, Ny], sigma_xy);
kernel_z = fspecial('gaussian', Nz, sigma_z);
kernel_z = kernel_z / max(kernel_z);
kernel = repmat(kernel_xy, [1, 1, Nz]);
for i = 1:Nz
kernel(:, :, i) = kernel(:, :, i) * kernel_z(i);
end
k... |
f2d5120c60e54aa8e0f1a57660591d4e3452a2739b44974da22a7dc9572a842e | MATLAB | 356 | 12 | function [spkIndices] = LaCameraDetect(v)
dv = diff(v);
[p,l] = findpeaks(dv);
[p2,l2] = findpeaks(-dv);
[IDX,~] = nearestpoint(l,l2,'next');
validSpk = ~isnan(IDX);
POINTS = [p(validSpk) p2(IDX(validSpk))];
[cluster,~] = kmeans(POINTS,2,'Start',[0 0;50 50]);
spkIndices = l(c... |
09cf1629ca7f0b28eded07b528340876332f143cfbb546815959ae883fd9d73d | MATLAB | 358 | 15 | function spec_info = explore_spectro_data_ref(P)
if ~exist('P')
P = spm_select([1 Inf],'dir','Select directories of dicom files');
end
spec_info = explore_spectro_data(P)
for nbs=1:length(spec_info)
fnoise = spec_info(nbs);
fnoise.fid = fnoise.fid(:,2);
spec_info(nbs).fid = spec_info(nbs).fid(:,1);
... |
5d53ebdc1ae1de7590697d888e448e9686e59e67dc4f5907c64ea3cb9ad61be4 | MATLAB | 359 | 4 | function [peaks, peak_indexes, qrs_likelihood] = PeakDetectionProbabilistic(signal, fs, varargin)
% PeakDetectionProbabilistic has been deprecated. Use peak_det_likelihood instead.
warning('PeakDetectionProbabilistic has been deprecated. Use peak_det_likelihood instead.');
[peaks, peak_indexes, qrs_likelihood] = peak_d... |
e4617f31059e14f419cba175bfbeecd4e63779ec632051a50993771599b2c8b0 | MATLAB | 360 | 20 | function [profile] = load_profile(session, channel, unit)
% Load neural profile
%
% Parameters
% ----------
%
%
% Returns
% -------
% - profile: struct (todo: need more details)
% Neural profile
info = get_info();
fullfilename = fullfile(...
info.folders.profiles, ...
get_filename(session, channel, unit));
... |
848934f22fabd0b8a81a0b3271963a5b90efa0c4a20b8477f61cb7c225712ad4 | MATLAB | 361 | 13 | sz=size(MT_TeNT_all,2);
filePaths={};
Indicators={};
Time=nan(sz,1);
for i=1:sz
filePaths{i,1}=MT_TeNT_all(i).BasicInfo.FileName;
Indicators{i,1}=MT_TeNT_all(i).BasicInfo.IndicatorType;
Time(i,1)=MT_TeNT_all(i).BasicInfo.MovieLength;
end
modelfunc= @(b,x) b(1).*(exp(b(2).*x))+b(3);
beta0= [0.0001,-1,0.001]... |
ce802c7340de0b1ffb92b65f75cc571f45daf0dc26b4f3686e184821dd5642e1 | MATLAB | 361 | 13 | function [ranking, argsort] = rankorder(vals, direction)
%RANKORDER Rank vals in order of sorting direction.
% Returns ranking and permutation needed to order vals
if nargin < 2
direction = 'ascend';
end
n = numel(vals);
[~, argsort] = sort(vals, direction);
ranking = zeros(n, 1, '... |
658e88617fb1b982ec0207f092af07c443d054914b4467e0fa127b0b887ecf8b | MATLAB | 362 | 11 | function AddTableHTML(obj, caption)
% A member function of HTMLGenerator for starting a table for an HTML table
% Reza Sameni, Sep 2020
% The open-source electrophysiological toolbox (OSET)
% www.oset.ir
%
if(obj.fid)
fprintf(obj.fid, '\n\t\t<table style="width:750px">\n\t\t\t<caption><h3>%s</h3></caption>', captio... |
a7aee30161dccd17b0eccd30df5f75fbe118afdaa39e7ba450e4c844d9c1a837 | MATLAB | 362 | 14 | function [S Q] = multislice_static_signed(A,gplus,gminus)
Aplus=A; Aplus(A<0)=0;
Aminus=-A; Aminus(A>0)=0;
kplus=sum(Aplus)';
kminus=sum(Aminus)';
B=A-(gplus*kplus*kplus'/sum(kplus)-gminus*kminus*kminus'/sum(kminus));
%[S, Q] = greedysparse(B);
[S, Q] = genlouvain(B);
%[S2,Q2]=newmanklB(S,B); IF YOU WANT ITERATIVE IMP... |
3786147ca4d5707b93764fcfe05180884772be5e660fa8356a69ff81c521fd93 | MATLAB | 363 | 16 | function newStruct = complet_struct(inputStruct,baseStruct)
% COMPLET_STRUCT will complete the inputStruct with fields from baseStruct
% if they are missing
fields = fieldnames(baseStruct);
newStruct = inputStruct;
for f = 1 : length(fields)
if ~isfield(inputStruct,fields{f})
newStruct.(fields{f}) = baseStruct... |
582d31da1c5d7d9ce384dcbc36c65efdac99c5ba4e889ae8fe6346a918830ad4 | MATLAB | 363 | 23 | function co = result_remove_bigSD(c,seuil)
metname = find_metab_list(fieldnames(c));
co=c;
for nf=1:length(metname)
for npool = 1:length(c)
sdname = ['SD' metname{nf}];
ysd = getfield(c(npool),sdname);
if mean(ysd)>seuil
co = rmfield(co,sdname);
co = rmfield(co,metname{nf});... |
b2dec0c1bf2ce85df387cfd085c1b3545fd18eba0174931e1543b9a2f41dffbf | MATLAB | 363 | 4 | function [data_posterior_est, data_prior_est, n_var] = ECGTimeDomainMAPFilter(data, peaks, params)
% ECGTimeDomainMAPFilter has been deprecated. Use ecg_den_time_domain_gp instead.
warning('ECGTimeDomainMAPFilter has been deprecated. Use ecg_den_time_domain_gp instead.');
[data_posterior_est, data_prior_est, n_var] = e... |
4f650a5bab386711d6b657ba9275c9deb48ec0ad18a534d352a79719388d2e67 | MATLAB | 364 | 24 | function [A,B] = scaledata(X,W,N,dB)
assert(all(abs(mean(X))<1e-10))
assert(all(abs(mean(N))<1e-10))
assert(all(abs(mean(X*W))<1e-10))
% Define scaling factor
S = sqrt(10^(dB/10));
% Mix target with mixing weights
T = X*W;
A = 1/sqrt(mean(T.^2));
B = 1/sqrt(mean(N.^2));
% Scale the noise term
B = B/S;
H = sqrt(m... |
eec84bbcb5dcf323e7a84e13cce2620ae932fe31b8a799f194353adaadc8c6c7 | MATLAB | 364 | 15 | function ll = Ragu_ComputeLoreta(map,lor)
if size(map,1) ~= lor.nchan
error('Channel number mismatch in function Ragu_ComputeLoreta');
end
l = zeros(3,size(map,2),size(lor.spinv,3));
l(1,:,:) = map'* squeeze(lor.spinv(:,1,:));
l(2,:,:) = map'* squeeze(lor.spinv(:,2,:));
l(3,:,:) = map'* squeeze(lor.spinv(:,3,:))... |
c05cc6e89a21be49b2c92d84ec746d52a8c09e53fbf90bb2212049d3005405de | MATLAB | 365 | 10 | function x = gmm_gen( gmm_param , state_number )
%GMM parameter include GMMParam().P , GMMParam().mu , GMMParam().Sigma
% StateNumber is between 1 to number of hidden states
P = gmm_param(state_number).P;
n = Select_P( P );
x = diag(gmm_param(state_number).sigma(n).x)^0.5*randn(length(gmm_param(state_number).mu(n).x... |
c2b079162d1e61ecc55e9b5badf715f3816cddb6cce44e27046e7e6ce07f52ff | MATLAB | 365 | 12 | % matRead6Channels reads a custom MAT files containing 6 channel
% multispectral image data.
%
% IMAGE = matRead6Channels(FILENAME) returns the first 6 channels of the
% multispectral image saved in FILENAME.
% Copyright 2017 The MathWorks, Inc.
function data = matRead6Channels(filename)
d = load(filename);
... |
c459ff72fc76bdf5e016316eb5439623da7cb046be135dbe6c5b072c27564156 | MATLAB | 365 | 18 | function fi = average_fid(fi,nb_spectra)
if ~exist('nb_spectra')
for nbser = 1:length(fi)
nb_spectra(nbser) = size(fi(nbser).fid,2);
end
end
if length(fi) > length(nb_spectra)
nb_spectra=ones(size(fi))*nb_spectra;
end
for nbser = 1:length(fi)
fi(nbser).fid =sum( fi(nbser).fid(:,1:nb_spe... |
790642a4be477b2250c10eb861b8a3b2059c130ca3781955711f626098181045 | MATLAB | 366 | 11 | function updateFigPos(obj)
%UPDATEFIGPOS Plot cluster position on probe
if isempty(obj.selected) || ~obj.hasFig('FigPos')
return;
end
hFigPos = obj.hFigs('FigPos');
jrclust.views.plotFigPos(hFigPos, obj.hClust, obj.hCfg, obj.selected, obj.maxAmp);
hFigPos.hFunKey = @(hO, hE) []; % do-no... |
dc0ea85110e2289996843a3a93165d3dfd76b1d42998f44a431971fa558bd294 | MATLAB | 366 | 12 | %calculate new correct fit
clear all_data
clc
%%
% Needs to be in D:\Data\IR data Shira_May_14_2022
[file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file.
cd(path)
datafile = fullfile(path, file); %save pat... |
12ed9f35d0dd237353154a3153c3da0cdd5ff9443bab746b3e3dfc6f08211fc7 | MATLAB | 368 | 22 | function [RRR7, RRR8 ] = transduction_calc_v2(data, ts_ecg_in, ts_bpfoot_in, bpValues, t_spikes, idx_bpfoot_in)
ts_ecg = ts_ecg_in;
ts_bpfoot = ts_bpfoot_in;
idx_bpfoot = idx_bpfoot_in;
tmp = find (ts_bpfoot < ts_ecg(1));
ts_bpfoot(tmp) = [];
idx_bpfoot(tmp) = [];
[ts_ecg_cut, ts_bp_cut, idx_bp_cut] = realign_bp_... |
83843aafd82b04327d95b91da7f68bda218185cae29357a8fa67722976d75167 | MATLAB | 368 | 4 | function [A, f0, bw, fskew, skew, kurt, f1] = InstParams(signal, fs, wlen, window, th, varargin)
% InstParams has been deprecated. Use instantaneous_signal_params instead.
warning('InstParams has been deprecated. Use instantaneous_signal_params instead.');
[A, f0, bw, fskew, skew, kurt, f1] = instantaneous_signal_pa... |
107821218e46ceb671736494871f9f79daed8cb4480c2da9e9ae6da27a0cd8d6 | MATLAB | 369 | 17 | function [xtc, ytc, ztc] = findxyz(rx, ry, rz, dlocx, dlocy, dlocz)
sizr = size(rx);
[~,Iy] = min(abs(rx(:) - dlocx));
[~,Ix] = min(abs(ry(:) - dlocy));
[~,Iz] = min(abs(rz(:) - dlocz));
[xi, xj, xk] = ind2sub(sizr,Ix);
[yi, yj, yk] = ind2sub(sizr,Iy);
[zi, zj, zk] = ind2sub(sizr,Iz);
xtc = max([xi, xj, xk]);
ytc =... |
34a58cafadacf8e4d4dd806d0670e21fb75291cacc3788c1278d7fe9d91704ff | MATLAB | 369 | 12 | function outStruct = copyStructFields(inStruct,outStruct)
if size(inStruct)~=size(outStruct)
error('inStruct and outStruct have different sizes');
end
structFieldNames = fieldnames(inStruct);
for ifield = 1:numel(structFieldNames)
newVals = num2cell(vertcat(inStruct.(structFieldNames{ifield})));
[outStru... |
63d813926e30d2c737b96da7603a353e4a822ff0a95e3419790ac74a00cdc4ca | MATLAB | 369 | 9 | function out = ECGBeatFitter(varargin)
%
% ECGBeatFitter(ECG,Phase,ExpParamName),
% Graphical user interface for ECG approximation with Gaussian kernels.
%
% ECGBeatFitter has been deprecated. Use ecg_beat_fitter_gmm_gui instead.
warning('ECGBeatFitter has been deprecated. Use ecg_beat_fitter_gmm_gui instead.');... |
ce307ebdcb91b498c8fb6fb7d4cc5389ab652b725c8b57b9632af13f4e61a233 | MATLAB | 369 | 19 | function [trans check full2sparse] = get_matlab_bgl_options(options)
%
% Internal private function.
%
% Example:
% Don't use this function!
%
doptions = set_matlab_bgl_default();
if (nargin>0)
options = merge_structs(options, doptions);
else
options = doptions;
end;
trans = ~options.istrans;
check = ~opti... |
e3f5913773260cf76867f7f8c6c00d7caae65652251811e02fcbb79a704b34b1 | MATLAB | 369 | 4 | function [data_posterior_est, data_prior_est, n_var] = ECGPhaseDomainMAPFilter(data, peaks, params)
% ECGPhaseDomainMAPFilter has been deprecated. Use ecg_den_phase_domain_gp instead.
warning('ECGPhaseDomainMAPFilter has been deprecated. Use ecg_den_phase_domain_gp instead.');
[data_posterior_est, data_prior_est, n_var... |
fd0dad71d2c88414366d1d638f3e428041ec88301aaa867d9fa3932899a0f535 | MATLAB | 369 | 19 | clear
close all
clc
DiffOrder = 2;
wlen = 100;% in samples
lambda = 200;
h = diff([zeros(1, DiffOrder) 1 zeros(1, DiffOrder)], DiffOrder);
L = length(h);
D = toeplitz([h(1) zeros(1, wlen - L)], [h zeros(1, wlen - L)]);
figure
mesh(pinv(eye(size(D,2)) + (lambda)^2*(D'*D)));
% mesh(pinv(eye(size(Dd,2)) + (lambda)^2*(... |
34971dfe4b8c2f0dc4dece839bffa5c0b64b971e98c3f371d5b8178bf4e9679b | MATLAB | 370 | 13 | function Y = vl_nnloss(X,c,dzdy,varargin)
% --------------------------------------------------------------------
% pixel-level L2 loss
% --------------------------------------------------------------------
if nargin <= 2 || isempty(dzdy)
t = ((X-c).^2)/2;
Y = sum(t(:))/size(X,4); % reconstruction error per sa... |
586c466aa5247f781613120de0f440858919b4c4a3e6eb2248e62554fe554b97 | MATLAB | 371 | 25 | function res=mmil_isint(v)
%function res=mmil_isint(v)
%
% Purpose: tests whether input value is integer
% (equal to value rounded to integer)
%
% Created: 04/01/09 by Don Hagler
% Last Mod: 02/16/11 by Don Hagler
%
% copied from Ziad Saad's isint
%
if any(~isfinite(v))
res = 0;
return;
end;
fv = fix(v);
df =... |
ecdf06eb1ebdad2e5841fc28ed04591b927673e8357f2cddff4da29e1f46ec01 | MATLAB | 372 | 18 | function [data, fullfilename] = load_main_lists()
% Load neural model for a given fold number
%
% Returns
% -------
% - data: struct (todo: need more details)
% Data of main lists
% - fullfilename: char vector
% Filename of saved model
info = get_info();
fullfilename = fullfile(...
info.folders.data, ...
... |
7840becc9388fd27c353a2616b7d9c3867e2c7ede3a744acd34cedd1c0c47922 | MATLAB | 373 | 4 | function [interpeaks, ref_to_out_lag] = IntermediatePeakDetection(x, peaks, wlen, n_peaks, varargin)
% IntermediatePeakDetection has been deprecated. Use intermediate_peak_det instead.
warning('IntermediatePeakDetection has been deprecated. Use intermediate_peak_det instead.');
[interpeaks, ref_to_out_lag] = interme... |
a422549bc89c5a81798bae22c7ecff0b09cceed16d9aab979451eed15cc9453b | MATLAB | 373 | 16 | %% function to create transition matrix
function trans_mat = create_trans_mat(xi_est, rho_est, x_level)
[S,~] = size(rho_est);
oomph_add = zeros(size(xi_est));
for s = 1:S
oomph_add(:,s) = rho_est(s,:)*x_level;
end
trans_mat = xi_est+oomph_add;
trans_mat = exp(trans_mat)... |
88be765f6501435938971eccd2ab09393d2159c28d9cc7c279ac8fe3bba3fa67 | MATLAB | 374 | 13 | function imrectSetPosition(hFig, plotKey, xpos, ypos)
%IMRECTSETPOSITION
imPos = hFig.plotApply(plotKey, @getPosition);
if ~isempty(xpos)
imPos(1) = min(xpos);
imPos(3) = abs(diff(xpos));
end
if ~isempty(ypos)
imPos(2) = min(ypos);
imPos(4) = abs(diff(ypos));
end
... |
23b4ec3085a92938caa3cc4e7563a469d8daf627faa4765936f8d78312965ae8 | MATLAB | 375 | 14 | function [ ] = plotSquares(S, linewidth)
% plot the communities, A is the adj-mat, S is the community labels
uniqueS = unique(S);
currIdx = 1;
for i = 1:numel(uniqueS)
width = sum(S == uniqueS(i));
if width > 1
rectangle('Position',[currIdx, currIdx, width-1, width-1], 'EdgeColor','r','LineWidth',linew... |
2bfb65135cfdf1d028ea2e8d42153c0f87fb14c840ef5429dab05544c9a8e424 | MATLAB | 375 | 23 | function out = fft1s(data, dim, rescale)
% function out = fft1s(data, dim, rescale)
%
% Do 1D FFT on dim (default=1) dimension of data and fftshift
if nargin < 3
rescale = 0;
end
if nargin < 2
dim = 1;
end
if dim==1 && size(data,1) == 1
dim = 2;
end
out = fftshift(fft(ifftshift(data,dim),[],dim),dim);
... |
590fa1ab455ee39d9b53151fa5e0134c47f313b0b56bb5290ae7772f2ce4f858 | MATLAB | 375 | 17 | function knl = get_f_knl_stm(session, channel, unit, fold)
% Get estimated stimulus kernel of specific f-model
%
% Parameters
% ----------
%
% - fold: integer scalar
% Fold number
%
% Returns
% -------
% - knl: 4D array
% (width x height x time x delay) stimulus kernel of s-model
model = load_model(session, channe... |
8685b803ded238b52be75db93df7678136556d07ad0a19c209387e55dd989339 | MATLAB | 375 | 18 | function cinew = fcn_relabel_partitions(ci)
[n,m] = size(ci);
cinew = zeros(n,m);
for i = 1:m
c = ci(:,i);
d = zeros(size(c));
count = 0;
while sum(d ~= 0) < n
count = count + 1;
ind = find(c,1,'first');
tgt = c(ind);
rep = c == tgt;
d(rep) = count;
... |
174e4328bb830737b546e020335da9a31dc94cf3829c26332429d124b04f8001 | MATLAB | 378 | 16 | function beginSession(obj)
%BEGINSESSION Start curating clusters
if ~isempty(obj.hFigs) % session already running
return;
end
obj.isEnding = 0;
obj.cRes = struct('hClust', obj.hClust);
obj.maxAmp = obj.hCfg.maxAmp;
% select first cluster
obj.selected = 1;
obj.currentSite = ... |
2e4b849a2d67a51ec06b6041e48fa30a06cfde4623b3f932c02d28c8d29f0ce7 | MATLAB | 380 | 18 | function ids = get_ids()
% Get neuron's IDs
%
% Returns
% -------
% - id: cell array of char vectors
% Filenames saved on the `data` folder
info = get_info();
listing = dir(fullfile(info.folders.data, '*.mat'));
n = numel(listing);
ids = cell(n, 1);
for i = 1:n
... |
a5a5b452b50529640dee34736a77c2729ae1e284e9f8b6447e46b2282041495b | MATLAB | 380 | 14 | function [Xout, Yout, Zout] = surfrep(q,X)
%meshrep - takes a single vector q and meshgrid vector as input, returns
%a grid of just q repeated at every point in space. Ensure X,Y,Z is 3D and
%has equal dimensions.
siz = size(X);
assert(length(siz) == 2,'Surf dimensions != 2');
assert(siz(1) == siz(2));
Xout = q(1)*o... |
119df1beb35573982040e3ba54b9726ba746a84787b8578f24df6811a7f5359e | MATLAB | 381 | 15 | function affmats = pars2affmats(pars)
% function affmats = pars2affmats(pars)
%
% pars is 6 x n matrix of mocopars (3 translations, 3 rotations in degrees)
% output is 4 x 4 x n affine matrices
npars = size(pars,2);
pars(4:6,:) = pars(4:6,:) * pi/180; % make into radians for SPM
affmats = zeros(4,4,npars);
for iP ... |
bf099e9f1b902201271d8d52843d12900ec901d5200c79fd167338d260adffb0 | MATLAB | 381 | 19 | function [totXrad_mean totXrad_min totXrad_max] = ComputeLatencyCell(radX)
for i=1:length(radX)
totXrad_mean(i)= mean(radX{i});
if sum(radX{i})>0
totXrad_min(i)= radX{i}(1);
totXrad_max(i)= radX{i}(end);
else
totXrad_min(i)=0;
totXrad_max(i)=0;
end
end
totXrad_mean(isnan(totXrad_mean)) = [];
totXrad_min=non... |
28db004fe573d427737de9d28cc447d00becea36c72b2b55057f327ea8b1ce06 | MATLAB | 382 | 13 | %% Vesicular monoamine transporter, 5ht -> v5ht.
% b = cDA
%c= vda
%UNITS IN uM and uM/h.
function a = VMAT(b,c)
k = 0.2; %was 1 before Nov 3.
V = 1230; %1230 was 6300 before Nov 3 Vmax = 3500 in paper
a = (V.*b./(k + b))-(1).*c;
% Km for uptake by vesicles = 123 or 252 nM (Slotkin77)
% Km for uptake by vesicles =... |
42753b45d353f9a629c75e9a8f620ba8542b4679a2426d551fc897374da4f0ec | MATLAB | 382 | 8 | rootdir = fileparts(mfilename('fullfile'));
addpath(fullfile(rootdir,'matlab'))
addpath(fullfile(rootdir,'matlab','functions'))
addpath(fullfile(rootdir,'examples','matlab'))
addpath(fullfile(rootdir,'examples','matlab','func'))
fprintf('\n ======================================================================')
fprin... |
e69b45cb2f28338a399c3cf2f306d4d63557aef4c9d0c8d9bcb272da6a1df258 | MATLAB | 382 | 22 | function out = ifft1s(data, dim, rescale)
% function out = ifft1s(data, dim, rescale)
%
% Do 1D FFT on dim (default = first) dimension of data and fftshift
if nargin < 3
rescale = 0;
end
if nargin < 2
dim = 1;
end
if dim==1 && size(data,1) == 1
dim = 2;
end
out = fftshift(ifft(ifftshift(data,dim),[],di... |
0488952497289be47f57c05989db043515d90136c3d3f301c656bd82f443e098 | MATLAB | 383 | 13 | %% reponsive and IR in each eria
%load csv file
clc
clear
[filename, path] = uigetfile("MultiSelect","off", ".csv");
datafile = fullfile(path, filename); %save path
T = readtable(datafile);
t = T(:, 2:end);
cluster_names = {'On Sustained', 'ON Suppressed 1', 'ON-OFF', 'ON Suppressed 2'};
%% plot
bar(categorical(t.Prope... |
74437928e4bec2c041791536c2da77c51b3717c36800c0cc0773384794ca4d49 | MATLAB | 383 | 19 | %Function to compute the partial correlation matrix from the precision
%matrix
function parcor = prec2parcor(Omega)
[p,~,K] = size(Omega);
parcor = repmat(eye(p),[1,1,K]);
for k = 1:K
for i = 2:p
for j = 1:(i-1)
parcor(i,j,k) = -Omega(i,j,k)/sqrt(Omega(i,i,k)*Omega(j,j,k));
parcor... |
a459995a4e5ef6e73d6a4dec7e953e66d438e692d7cceb7b95de31b5b6bb380a | MATLAB | 385 | 12 | %% Function of transport from vht reserve to readily vht.
% vht is the current value of vesicular serotonin
% vht_basal is the steady state value.
function ratio = vht_trafficking(vht, vht_basal)
max_r = 100;
min_r = 0;
s = 15; %Strength
diff = vht_basal - vht; %Difference respect to basal.
ratio = s.*diff;... |
af356d538a8479d5ddda55c26f66b8fa4bc25ac42e0e73a3e278a93a8ee857a4 | MATLAB | 385 | 15 | function lineplot_subplot(h, ipsi, contra, input)
subplot(h);
hold on; set(gca,'Color', 'none');
plot(ipsi, 'Color', 'red');
plot(contra, 'Color', 'black');
xlim([0 length(ipsi)]);
ylabel('Total output');
if input
legend('ipsilateral', 'contralateral', 'Location', 'eastoutside');
else
legend('ipsilateral', 'c... |
ea3e73159649b5ac670f1c0afc9f157bbf84e2395f1554327e52aa015250f090 | MATLAB | 385 | 12 | %% Function of transport from vha reserve to readily vha.
% vha is the current value of vesicular histamine
% vha_basal is the steady state value.
function ratio = vha_trafficking(vha, vha_basal)
max_r = 100;
min_r = 0;
s = 15; %Strength
diff = vha_basal - vha; %Difference respect to basal.
ratio = s.*diff;... |
f14814c3310683783403cd86cb2cfa8c1a77c381f1b66ecb8a6b46ef0e360f27 | MATLAB | 385 | 17 | function e002_addCommentsToAnExistingFile()
%
% Why doesn't this work???
%
% Is there some problem with modifying old adicht files that
% weren't created with the sdk?
file_path = 'C:\temp\example_labchart_file.adicht';
fw = adi.editFile(file_path);
%fw.addComment(1,300,'Does this actually work?')
fw.addCommen... |
75de13d73d2127d7c82b4a52ef8a492d4ad02f92579128c57f0da94200d29f99 | MATLAB | 386 | 16 | function dispsig(signalMatrix, range, titlestr);
%DISPSIG - deprecated!
%
% Please use icaplot instead.
%
% See also ICAPLOT
% 24.8.1998
% Hugo Gävert
fprintf('\nNote: DISPSIG is now deprecated! Please use ICAPLOT.\n');
if nargin < 3, titlestr = ''; end
if nargin < 2, range = 1:size(signalMatrix, 1); ... |
a07151283f227b6e32582d13c9215fadaa9339fad6c206c55559d34495edd1ae | MATLAB | 386 | 14 | function [ amatcell ] = timeSeries2ACell(timeseries, winSize)
% time series is NxTxp matrix
% amatcell is px1 cell of NxN matrix
[N,T,p] = size(timeseries);
nWin = floor(T/winSize);
for i = 1:p
amatcell{i} = cell(nWin,1);
aslice = squeeze(timeseries(:,:,i)');
for j = 1:nWin
amatcell{i}{j} =... |
f83428c86748bb68927c199fdb05d530cbe0b6a12f0d1e734d70c3b2990e45bd | MATLAB | 386 | 13 | % adds all the paths to all the external functions I use. Probably a
% sub-optimal solution, but dealing with submodules is a bitch.
Path = mfilename('fullpath');
Path = extractBefore(Path, 'addExternalFunctions');
SubFolders = list_filenames(Path);
SubFolders(contains(SubFolders, '.')) = [];
for Indx_F = 1:numel(Su... |
fcf1dc90129ab03cc622b8e3d3efb356489545fd9d6efac063b65e33d5cfdb66 | MATLAB | 387 | 4 | function MultiLeadECGPlotter(data, ch_names, fs, ref_ch, t1_small, t2_small, t1_long, t2_long, Title)
% MultiLeadECGPlotter has been deprecated. Use ecg_strip_viewer_multichannel instead.
warning('MultiLeadECGPlotter has been deprecated. Use ecg_strip_viewer_multichannel instead.');
ecg_strip_viewer_multichannel(data, ... |
1ecbfbf38d58a96a2253f11b0747218fea3a7d331d31dc95b640216740f1da39 | MATLAB | 388 | 23 | function write_vol_to_roi(f)
if ~exist('f')
f= spm_select([1 Inf],'image','select images','',pwd);
end
vol=spm_vol(f);
for nbvol=1:length(vol)
roi_fname=[vol(nbvol).fname(1:end-4),'_roi.mat']
o = maroi_image(struct('vol', vol(nbvol), 'binarize',1,...
'func', 'img>0'));
o = label(o,vol(nbvol).fname(1:end-... |
a364d51a9ea53dc42c3a372db62f7169cafadef140e9fb9c1b90aed68604fdec | MATLAB | 388 | 17 | function entropy = calc_entropy(prob_dist, correction, nObs)
% Calculate the entropy
temp = - prob_dist .* log2(prob_dist);
temp(~isfinite(temp)) = 0;
entropy = sum(temp(:));
if nargin > 1
switch correction
case 'MM'
m = sum(prob_dist~=0);
entropy = entropy +(m-1)/(2*nObs);
... |
e5222984a65dfe2aba928ff475001fd6bfd4c411dc2fcdc42c982df9daac7526 | MATLAB | 388 | 19 | function [ outmatrix ] = rotateAngleMatrix( u, angle )
%ROTATEANGLEMATRIX Summary of this function goes here
% Detailed explanation goes here
cprodmat = [ 0 -u(3) u(2); ...
u(3) 0 -u(1); ...
-u(2) u(1) 0];
kronu = kron(u,u');
R = cosd(angle) * eye(3) + sind(angle) * cprodmat + (1 - cosd(an... |
2dead67af6f81bc838c92f64fa3a20a2daab60a4e2bbeafec87c62f46bf19f5d | MATLAB | 389 | 16 | function writeArrayFile(filename,sources,detectors,refpts_10_2p5_label)
%REDUNDANT?
%Writes out array solution file
%Find 10-2p5 label:
for i = 1:length(sources)
source_labels{i} = refpts_10_2p5_label{sources(i)};
end
for i = 1:length(sources)
detector_labels{i} = refpts_10_2p5_label{detectors(i)};
end
sav... |
9428fd84d926bd691e3840b2ec01cfc914642fd30b064a48d38586efdc1ade98 | MATLAB | 389 | 12 | function [X_real,Ximag]=DFT_(x_real,x_imag,dft_size)
X_real=zeros(1,dft_size);
X_imag=zeros(1,dft_size);
for k=1:dft_size,
for n=1:dft_size,
w_real=cos(2*pi*(k-1)*(n-1)/dft_size);
w_imag=-sin(2*pi*(k-1)*(n-1)/dft_size);
X_real(k)=X_real(k)+w_real*x_real(n)-w_imag*x_imag(n);
... |
5b40fbe7cd031553f8f2ee6f69be541d59293e5ec818c1b40768cc21c44196b4 | MATLAB | 390 | 18 | function bic = bdfc_bic(results)
p = size(results.Sig_save,1);
S = size(results.Sig_save,3);
T = size(results.ppi_HMM,2);
params = S*p*(p-1)/2 + 2*S^2 + T;
ll = 0;
Sig = mean(results.Sig_save,4);
for t=1:T
max_state = find(results.ppi_HMM(:,t)==max(results.ppi_HMM(:,t)));
ll = ll -2*logmvnpdf(results.data.TC(t... |
c50cbfcd7c9745f226acb527aab9694ec67b95c0dd4b2aecb63feca663060d00 | MATLAB | 390 | 12 | function [sites1, sites2, sites3] = getSecondaryPeaks(obj)
%GETSECONDARYPEAKS
minVals = squeeze(min(obj.meanWfGlobal) - obj.meanWfGlobal(1, :, :));
[~, sites1] = min(minVals);
minVals(sub2ind(size(minVals), sites1, 1:numel(sites1))) = 0;
[~, sites2] = min(minVals);
minVals(sub2ind(size(minVal... |
f5008ebab1011e8721ecb5499e3bc0e1879b6601117fb629f72859f84f91edae | MATLAB | 391 | 14 | function moduleSize = moduleSize(S, c)
%% parameter and output
% size: size of community c in S_pxT
% S: overall community structure
% c: index of the community of interest
tS = S;
tS(tS~=c) = 0;
tS(tS~=0) = 1;
existIdx = find(any(tS));
moduleSize = 0;
for i = existIdx
moduleSize = ... |
f5b8d79cb5b7b41151eec4f745d7be4953d9f3646216d9a090c2caca5555a45f | MATLAB | 391 | 4 | function MultiLeadECGPlotterStandardSize(data, ch_names, fs, ref_ch, t1_small, t2_small, Title)
% MultiLeadECGPlotterStandardSize has been deprecated. Use ecg_strip_viewer_standard_grid instead.
warning('MultiLeadECGPlotterStandardSize has been deprecated. Use ecg_strip_viewer_standard_grid instead.');
ecg_strip_viewer... |
69dea0dd3c056a98a09068be22a2d55c85eb18867b5e2511ab9f28216032841e | MATLAB | 392 | 17 | function ob = fatrix2_scalar_times(scalar, ob)
%function ob = fatrix2_scalar_times(scalar, ob)
%|
%| Construct fatrix2 object for: ob = scalar * ob
%|
%| in
%| scalar [1] numeric scalar
%| ob fatrix2
%|
%| out
%| ob fatrix2 scalar * ob
%|
%| Copyright 2010-12-04, Jeff Fessler, University of Michigan
%if nargin ~= 2... |
41065cfadeadc71fd85516393b49d4c23573b50264ce47d1105537cdf7af31e8 | MATLAB | 394 | 14 | function [dat2]=vols2matrix(data,mask)
% [dat2,ind]=vols2matrix(data,mask);
%
% takes a 3d/4d volume and mask (2d/3d) and returns the 2d matrix
% (space x time)
maskdims = size(mask);
mask=reshape(mask,numel(mask),1)'>0;
dims = size(data);
if length(dims) == length(maskdims) % i.e. time dimension == 1
dims(end+1... |
882ddb1ddce1811b4d98cd1340e6c662ce48d8a31c8cd7145393be37793125fc | MATLAB | 394 | 14 | function [Xout, Yout, Zout] = surftrans(q,X,Y,Z)
%meshtrans - takes a single vector q and surface arrays as input, returns
%input surface translated by q as output. Ensure X,Y,Z are 2D and have equal
%dimensions.
siz = size(X);
assert(length(siz) == 2,'Surface dimensions != 2');
assert(siz(1) == siz(2));
Xout = X + ... |
3b688006ae0462df1805d96a4198b2775cf37b3baecdaadf379fca24a1805100 | MATLAB | 396 | 21 | % Test the implementation of the mofified van Der Pol equation
clear
close all;
tspan = [0 800];
% y0 = [.7424051892 0]';
y0 = [2 0]';
[t,y] = ode45('ModifiedVanDerPol', tspan, y0);
% % % [t,y] = ode23('ModifiedVanDerPol', tspan, y0);
figure;
plot(y(:,1),y(:,2));
grid;
figure;
plot(t,y(:,1))
xlabel('... |
a22d03479ee6bb9a7a092388ef70bf6152338680e626b5423a4126a9a1a9b230 | MATLAB | 396 | 16 | function [Xout, Yout, Zout] = meshscale(q,X,Y,Z)
%meshscale - takes a scalar grid q and meshgrid vectors as input, returns
%input grid scaled by q as output. Ensure X,Y,Z is 3D and has equal
%dimensions.
siz = size(X);
assert(length(siz) == 3,'Meshgrid dimensions != 3');
assert(siz(1) == siz(2));
assert(siz(2) == siz... |
bca51eea2ab3ca101ad96079ccf29e0b2a21eeb72ce42c62ee20dee3ef5244b6 | MATLAB | 396 | 15 | function cell_removed = XxRemoveCellItems(cell_raw, items_to_remove)
nitems = max(size(cell_raw));
n_to_remove = max(size(items_to_remove));
flag = ones(size(cell_raw));
for i = 1:nitems
cur_item = cell_raw{i};
for j = 1:n_to_remove
if strcmp(cur_item,items_to_remove{j})
flag(i) = 0;
... |
d75e4995bb16f42f7bca4d621e0f62f66c40806cb9e62c515b20115841509f2a | MATLAB | 396 | 10 | cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\effect size\f2\k')
g = importdata("side_per_session_data.mat")
%% pesistant
sample1 = g.mean_is_ir(ismember(g.side,'R'),2)
sample2 = g.mean_is_ir(ismember(g.side,'L'),2)
[p, observeddifference, effectsize] = permutationTest(sample1, sample2, 10000)
d ... |
845a6efa39c71115a566ec51e99115464d255ee1e2bc779dd1633b8c9b0263fe | MATLAB | 397 | 4 | function [ECGmean, ECGsd, meanPhase, ECGmedian, SamplesPerBin] = MeanECGExtraction(x,phase,bins,flag)
% MeanECGExtraction has been deprecated. Use avg_beat_calculator_phase_domain instead.
warning('MeanECGExtraction has been deprecated. Use avg_beat_calculator_phase_domain instead.');
[ECGmean, ECGsd, meanPhase, ECG... |
014374a6bf9d4c54cdd426777492133bcd3b7da53bcca01a342eb4988e7cafff | MATLAB | 398 | 19 | function [D] = meshdot2(X,Y,Z,U,V,W)
%surfdot2 - returns dot product surface of two surfaces.
siz = size(X);
siz2 = size(U);
assert(length(siz) == 2,'Surface 1 dimensions != 2');
assert(length(siz2) == 2,'Surface 2 dimensions != 2');
assert(siz(1) == siz(2));
assert(siz2(2) == siz2(1));
assert(siz(1) == siz2(1));
D ... |
0ab815a3634e1a3d33eeed7fdd09004d59e1b665a4c997cfc06e60a38351b0b3 | MATLAB | 398 | 17 | function id = get_id(session, channel, unit)
% Get neuron's ID
%
% Parameters
% ----------
% - session: scalar
% Session number with format: yymmdd
% - channel: scalar
% Channel number
%
% Returns
% -------
% - id: char vector
% Neuron's ID based on given `sessi... |
6b5d697e5d2f5250889728167cf0dd713de9d99576055495b561f4db168b64da | MATLAB | 398 | 19 | function [D] = meshdot2(X,Y,Z,U,V,W)
%meshdot2 - returns dot product grid of two vector grids.
siz = size(X);
siz2 = size(U);
assert(length(siz) == 3,'Meshgrid 1 dimensions != 3');
assert(length(siz2) == 3,'Meshgrid 2 dimensions != 3');
assert(siz(1) == siz(2));
assert(siz(2) == siz(3));
assert(siz(3) == siz(1));
D ... |
ce9aabc1debed99753a0ec1f3c1b81b2f2abaec6fc16ab668a5e5ac5fdcd7f53 | MATLAB | 398 | 17 | function filename = get_data_filename(session, channel, unit)
% Get neuron's filename
%
% Parameters
% ----------
%
% Returns
% -------
% - filename: char vector
% Neuron's filelname based on given `session` and `channel`
info = get_info();
filename = fullfile(...
... |
6e18c58cd46f842c831daf07448385e8a0115199a2feb299e3014c9fd52d564f | MATLAB | 399 | 16 | % Make binary matrix from categorical vector
% Input
% Y: categorical vector
% Output
% Ybin: Binary matrix from Y
% Example
% >>unique(Y)=['Apple';'Pie'];
% >>unique(Ybin,'rows')=[0,1;1,0];
function Ybin=getbinarylabel(Y)
Nobservations=numel(Y);
Labels=unique(Y,'legacy');
Nclasses=numel(Labels);
Ybin=zeros(... |
04d2053bbfa41efd56334e5e44ab7aa7c524b14f9b2f588f600a62eb005c2b3d | MATLAB | 400 | 10 | function [MaxStimulusDistance, TitleTag] = max_stimulus_distance(TrialsTable, ...
OnlyClosestStimuli, MaxStimulusDistanceProportion, TitleTag)
% specify only close trials, or all trials
if OnlyClosestStimuli
TitleTag = [ TitleTag, '_Close'];
MaxStimulusDistance = quantile(TrialsTable.Radius, MaxStimulusDist... |
7ef7e8da0a5f44c8b7d3bb014269101f0930e5da433b44870b69db59dc9a6633 | MATLAB | 400 | 10 | function figPos = getCurrentFigPos()
% utility that reports the position of the current figure windows
figs = get(0,'Children');
figPos = containers.Map();
for f=1:length(figs)
figs(f).Units = 'normalized';
figPos(figs(f).Tag) = round(figs(f).OuterPosition,3);
fprintf('figPos(''%... |
ba862b107132d3ba46a8f4f7e1251a535c29d286d034f20a16bd8b71f9d1ca9a | MATLAB | 401 | 12 | function openFilt(obj)
%OPENFILT Open the filtered recording file for reading
if obj.filtIsOpen
return;
end
dshape = [obj.hCfg.nSites, obj.nSamples];
obj.filteredData = memmapfile(obj.filtPath, 'Offset', 0, ...
'Format', {obj.dataType, dshape, 'Data'}, ...
... |
092504fc049e67d12577bf084695233acae9d51fe6482493ebd5b9f528105ea3 | MATLAB | 402 | 19 | function [z]=chisq(prob,IXi,IYi,in); % vede prob di ingr data per tracciare i cluster
prob=1-prob;
prob=prob*100;
prob=fix(prob);
prob=prob/100;
%X=[0.001 0.01 0.05 0.1 0.2 0.3 0.5 0.7 0.8 0.9 0.95 0.99];
%Y=[13.815 9.210 5.991 4.605 3.219 2.408 1.386 0.713 0.446 0.211 0.103 0.020];
%Xi=[0.01:.01:0.99];
%Yi=interp1(... |
763af326a43b2f4cee1d408cbba0e9817bac0eb2930d24788f54b5c82ceb7253 | MATLAB | 403 | 20 | function Output = Calc_Junction_Angles(Angles)
m = 2*pi;
if(length(Angles) == 3) % Do only for 3-way junctions.
V = [(1:3)',(mod(Angles,m))'];
V = sortrows(V,2); % Sort by angle size.
A21 = V(2,2) - V(1,2);
A32 = V(3,2) - V(2,2);
A31 = m - A21 - A32;
Output = [A21,A32,A31];
elseif(length... |
387163d0f03e300193cd75fa7ce67f84d5ce4385eabe3d032fc7e1cccc0818c3 | MATLAB | 404 | 14 | function Fk = gg_Gnufft_back(st,fj)
% apply j-dependent gaussian weights
V0 = fj.*st.E1;
% now do fast gridding
ftau = back_grid(complexify(V0),st.Msp,st.m1,st.m2,st.Mr,st.E2x,st.E2y,st.E3,size(st.om,1));
% take fft of ftau
Ftau = ifftshift(ifftn_fast(ftau));
% deconvolve to get F
Fk = reshape(pi/st.tau*st.E4.*col(... |
99b7af8fa5ff342c99ef8475bfc7b99e67f78f57a45b97e5585c7ac6bb0c4e16 | MATLAB | 405 | 20 | function n = typeBytes(dataType)
%TYPEBYTES Get number of bytes in dataType
switch dataType
case {'char', 'byte', 'int8', 'uint8'}
n = 1;
case {'int16', 'uint16'}
n = 2;
case {'single', 'float', 'int32', 'uint32'}
n = 4;
case {'double', 'int... |
2ceb5aa79e40e03d8d555a027409137c5dff08951b80590a982e06a5b140aed5 | MATLAB | 406 | 20 | function hMsgbox = qMsgBox(msg, fBlock, fModal)
%QMSGBOX msgbox with some reasonable defaults
hMsgbox = [];
if nargin < 2
fBlock = 0;
end
if nargin < 3
fModal = 0;
end
if fBlock
uiwait(msgbox(msg, 'modal'));
else
try
hMsgbox = msgbox(msg, jrc... |
5d51c05152b2beefa025873a0c1c85d4d82e53c4f2c8c972f5b4705955c9c1bc | MATLAB | 406 | 12 | function F = D2GaussFunction(x,xdata)
F = x(1)*exp( -((xdata(:,:,1)-x(2)).^2/(2*x(3)^2) + (xdata(:,:,2)-x(4)).^2/(2*x(5)^2) ) )+x(6);
%x(1) is amplidute
%x(2) is offset in the x direction
%x(3) is waist along x direction
%x(4) is offset in the y direction
%x(5) is waist along y direction
%x(6) is offset
... |
67e475a079363f47ec4f90b319fb660b9f1ff6e1e4a8bfd38eba0a6794d004cc | MATLAB | 406 | 12 | B = load_untouch_nii('NormalizedHTR2a.nii');
matrix = B.img;
IND = find(matrix~=0);
matrix(IND) = matrix(IND)-min(matrix(IND));
matrix(IND) = (matrix(IND) - min(matrix(IND)))/(max(matrix(IND))-min(matrix(IND)));
mean(matrix(IND))
matrix(IND) = (matrix(IND) - mean(matrix(IND)))/(max(matrix(IND))-mean(matrix(IND)));
mat... |
b4c3276059a6b7bda7e110c56ded405ec061eedea1b636f4424fb54db8484c83 | MATLAB | 406 | 9 | function update_regression_axis(app)
if ~isempty(app.stepwise_res)
int_items = find(strcmp(app.popup_int_stepwise.Value , app.popup_int_stepwise.Items));
cla(app.ax_regression1)
cla(app.ax_regression2)
BlandAltman_ax(app.ax_regression1, app.ax_regression2, ...
app.stepwise_res(int_ite... |
0c193bdefffa8f5ef01819309deba96b8f47ec4b6a461d7265f81180ba4dfe6c | MATLAB | 407 | 12 | % Merges the pdf-Documents in the input cell array fileNames into one
% single pdf-Document with file name outputFile
function mergePdfs(fileNames, outputFile)
memSet = org.apache.pdfbox.io.MemoryUsageSetting.setupMainMemoryOnly();
merger = org.apache.pdfbox.multipdf.PDFMergerUtility;
cellfun(@(f) merger.addSource(f... |
760c4275046c5c3d0a7e59d36337b7554510bc55abdf0f412643b906b33c1180 | MATLAB | 407 | 10 | function interpulated_psth = bin_psth(psth, downsampling)
cut_end = floor(length(psth)/downsampling)*downsampling;
binned_psth = mean(reshape(psth(1:cut_end), downsampling, []));
y = 1:length(binned_psth);
xq = 1/downsampling:1/downsampling:length(binned_psth);
interpulated_psth = interpn(y, binned_psth, xq, 'linear')... |
0d1bbbcf18fe2150bdf881fd56326b93dc091ddf918563c83fa563bcafc14572 | MATLAB | 408 | 18 | function [cleanTrace,noise] = DeNoise(trace)
%denoises the input trace by applying the default wavelet funtion.
%NEEDS WAVELET TOOLBOX INSTALLED
%pre-allocation
cleanTrace = zeros(size(trace));
noise = zeros(size(trace));
%Denoising
for index = 1:size(trace,1)
cleanTrace(index,:) = wdenoise(trace(inde... |
a70bdff11d51114ef091449ecc97d95af6159e6d6c576558c12d02907fe23ae7 | MATLAB | 408 | 25 | function fo = sum_fid_local(fids,nz)
% fid_struc = sum_fid_local(fid_struc,nb)
% this will remplace each spectra by the average of the nb nearest spectra
fo=fids;
for nbser = 1:length(fids)
fid = fids(nbser).fid;
num_fid = size(fid,2);
for kf = 1:(num_fid-nz)
fidn(:,kf) = sum(fid(:,kf:(kf+nz)),2) .... |
e68d426235bca7ecf4db0d2ce9ecd746182d537a3baada56578da2452202ad9a | MATLAB | 410 | 14 | function [firstlayer] = initnorm(firstlayer, train_x)
if (isfield(firstlayer, 'mean'))
firstlayer.mw = firstlayer.mean - mean(train_x, 4);
end;
if (isfield(firstlayer, 'maxdev'))
stdev = std(train_x, 1, 4);
stdev(stdev <= firstlayer.maxdev) = firstlayer.maxdev;
firstlayer.sw = firstlayer.maxdev * ones([firstla... |
ecce03fbbf1b3e022c70abbc3a5e9334d23ca71873049be4a4ffbe82ff59751d | MATLAB | 410 | 5 | function EyeClosed = clean_eyeclosure_data(Eyes, EEGMetadata, Triggers, CleanEyeIndx, SampleRate, ConfidenceThreshold)
TaskTime = identify_task_timepoints(EEGMetadata, Triggers); % for data quality, it needs to see if there's enough clean data during the task
Eye = check_eye_dataquality(Eyes, CleanEyeIndx, ConfidenceT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.