sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b35e80c5f2caf82d7422a1a97ab398a1f25ef3f2267a4d093117f516a043a7ac | MATLAB | 214 | 4 | function y = TanhSaturation(x, ksigma)
% TanhSaturation has been deprecated. Use tanh_saturation instead.
warning('TanhSaturation has been deprecated. Use tanh_saturation instead.');
y = tanh_saturation(x, ksigma); |
c30ab822213d1ff03a358021ececd43a60d7a52deaea81b83280b3bc866ca9d5 | MATLAB | 214 | 12 | function closeRaw(obj)
%CLOSERAW Close the raw recording file, clear its data
if obj.rawFid == -1
return;
end
try
fclose(obj.rawFid);
catch ME
end
obj.rawIsOpen = 0;
end |
df7be1851d6ef4637340147ee9dde732bfc9fff280bcda6c6eb414744f8f412f | MATLAB | 214 | 13 | function [h,m,s,ms] = get_time(t)
for k=1:length(t)
h(k) = floor(t(k)/3600);
mm = t(k)/3600 -h(k);
m(k) = floor(mm*60);
ss = mm*60-m(k);
s(k) = floor(ss*60);
ms(k) = floor((ss*60-s(k))*1000);
end
|
038fd8ec44e48dea72eb7b6adf189ee692d041af2021813ab743510d0dc3a598 | MATLAB | 216 | 4 | function x = ECGModel(params, phase)
% ECGModel has been deprecated. Use ecg_gen_from_phase instead.
warning('ECGModel has been deprecated. Use ecg_gen_from_phase instead.');
x = ecg_gen_from_phase(params, phase); |
5493f28b849c00d93c94c2cc3c858591cbfe6a9cd54f6a6e21d907ab112acbd6 | MATLAB | 216 | 12 | %
% (C) Copyright 2021 bidspm developers
root_dir = getenv('GITHUB_WORKSPACE');
fprintf('\nroot dir is %s\n', root_dir);
addpath(fullfile(root_dir, 'spm12'));
cd(fullfile(root_dir, 'system_test'));
run facerep;
|
749b08e6c9b19dc2a539b231934ef882f32c0294a55a526397d35eb779357607 | MATLAB | 216 | 4 | function [A, B] = PiCAMatrixes1(x, peaks)
% PiCAMatrixes1 has been deprecated. Use pica_matrices instead.
warning('PiCAMatrixes1 has been deprecated. Use pica_matrices instead.');
[A, B] = pica_matrices(x, peaks); |
783b80eb0b6d258660ee81ba4abcf540d71fb3d76f5a5535b56436e74f2a86ff | MATLAB | 216 | 10 | %% Rate of storage of tryptophan in the tryptophan pool from cytosolic tryptophan.
% b = trp
% c = pool
% UNITS IN uM and uM/h.
function a = VPOOL(b,c)
k1 = 9; %to pool
k2 = 0.6; %from pool
a = (k1.*b - k2.*c);
|
353780c4f87e809b3cb9d8edfd75a65dcd18d30f10f7273e2fc1773281dd5c2b | MATLAB | 217 | 10 | %% Function of histidine transporter.
% Histidine transport from blood to cytosol.
% UNITS in uM/h.
% b = bht.
function a = VHTL(b)
km = 1000; % (lobster)(6.2-19 muM conrad05)
k1 = 4680;
a = k1.*(b./(km + b));
end |
70c51da5125a8f703064f9cac2fc633dd58b09fb76862f0b45baa030666d9f3a | MATLAB | 217 | 9 | %% Function of histidine transporter.
% Histidine transport from blood to glia.
% UNITS in uM/h.
% b = bht.
function a = VHTLg(b)
km = 1000; %(lobster)(6.2-19 muM conrad05)
vmax = 2340;
a = vmax.*(b./(km + b));
end |
88329b6c5000962580ef902ac5d6bbe3173559a0d6443779bf9c24ec60c67601 | MATLAB | 217 | 13 | function flag = isvalid(h)
%ISVALID Like isvalid, but checks for empty first
if isempty(h)
flag = 0;
return;
end
try
flag = isvalid(h);
catch
flag = 0;
end
end
|
f52ce34331db9de9d095bda902345e47713d28340c00f65d78396c15289f38f7 | MATLAB | 217 | 5 | function maxAmp = rescaleFigWav(hFigWav, hClust, maxAmpPrev, scaleFactor, channel_idx)
%RESCALEFIGWAV
maxAmp = maxAmpPrev * scaleFactor;
jrclust.views.plotFigWav(hFigWav, hClust, maxAmp, channel_idx);
end
|
7e96051d99689a93a0ba976b3d2a378b560a20e968a46bbbee7fc6277ff5d12e | MATLAB | 218 | 4 | function f = IFMCorrelator(x, f0, BW, tau)
% IFMCorrelator has been deprecated. Use ifm_correlator instead.
warning('IFMCorrelator has been deprecated. Use ifm_correlator instead.');
f = ifm_correlator(x, f0, BW, tau); |
824fafbe9b7f87ee11887286c2e9d16296bc5ba55673ddaad0ededf6739a5a80 | MATLAB | 220 | 5 | function eventTimes = adjEvtTimes(eventTimes,tBefore,tAfter,totSamp)
evtAfter = eventTimes + tAfter; evtBefore = eventTimes + tBefore;
logInd = evtAfter < totSamp | evtBefore > 1;
eventTimes = eventTimes(logInd);
end |
cb72bdfadbdfe434bb68e6f14319317381ccf901097a0b33cd8c1617848da74c | MATLAB | 222 | 12 | function [dist, sqDist, varDist] = sqAndVarDist(x,y)
if size(x)~=size(y)
error('x and y must be equal size')
end
distVec = x-y;
sqDist = sum(distVec.^2);
varDist = numel(x)*var(distVec);
dist = sqDist + varDist;
end |
2af3252b5979199f9421c970923f74ed97cd71e65a886439147bf980f595f42e | MATLAB | 223 | 10 | function header = XxReadMRCHeader(file)
handle = fopen(file,'r');
header = int32(fread(handle,256,'int32'));
if header(4)>7
frewind(handle);
header = int32(fread(handle,256,'int32','b'));
end
fclose(handle);
|
2f256a8dbaddd8dc37edff47fa0a07b7c305d6b476f2176163fabe2e373c1138 | MATLAB | 223 | 4 | function y = BPFilter2(x, fl, fu, N)
% BPFilter2 has been deprecated. Use bp_filter_dft_varlen instead.
warning('BPFilter2 has been deprecated. Use bp_filter_dft_varlen instead.');
y = bp_filter_dft_varlen(x, fl, fu, N); |
5b28dcfcca5a619d6a6063e1ea8a48c77903b6749bbb73040f70cd652376e7fc | MATLAB | 223 | 13 | function fi = associate_water_ref(fi,wfi)
if nargin==2
for k=1:length(fi)
end
else
if length(fi)~=length(wfi)
error('you must provide %d water reference',length(fi))
end
fi(k).water_ref = wfi(k);
end
|
9e47841ed875cc8141fe1590c2cd2cf075b70f99a45d2924f62dd00e3065cea8 | MATLAB | 223 | 11 | function C = Muli_Two_Image(A,B)
[x,y,~] = size(A);
C = zeros(x,y,6);
C(:,:,1) = A(:,:,1);
C(:,:,2) = A(:,:,2);
C(:,:,3) = A(:,:,3);
C(:,:,4) = B(:,:,1);
C(:,:,5) = B(:,:,2);
C(:,:,6) = B(:,:,3);
C = uint8(C);
end |
3a64f6991001b8f2defce4295dee8c84d688d40acb64ec806623858516f16ec6 | MATLAB | 224 | 4 | function [y, p] = PolyFit(x, fs, N, varargin)
% PolyFit has been deprecated. Use polynomial_fit instead.
warning('PolyFit has been deprecated. Use polynomial_fit instead.');
[y, p] = polynomial_fit(x, fs, N, varargin{:}); |
49d3d346d68044233ecbc62765bab230785f50a3b289a7396e0307a91205dee1 | MATLAB | 224 | 10 | function killFigWav(obj, hFig, ~)
%KILLFIGWAV Destroy the main figure, close all other figures
if ~obj.isEnding
obj.endSession(); % we'll be back
end
if obj.isEnding
delete(hFig);
end
end |
ad88b5b7d27e6cf07b8b16747110bad8b9736366bf1fe789f005f602083fc1d2 | MATLAB | 224 | 11 | function hl = hline(val,color,linestyle)
% function hl = hline(val,color,linestyle)
a = axis;
hl = line(a(1:2),val*ones(2,1));
if nargin >= 2
set(hl,'Color',color);
end
if nargin >= 3
set(hl,'LineStyle',linestyle);
end
|
b4c8ae000a701a950d8799a4107dc92e20e248b9546babfd4aba191d89da1198 | MATLAB | 224 | 4 | function n = ColoredNoise(sd,Len,fs,beta)
% ColoredNoise has been deprecated. Use colored_noise_gen instead.
warning('ColoredNoise has been deprecated. Use colored_noise_gen instead.');
n = colored_noise_gen(sd,Len,fs,beta); |
ca74898a3cdfb2b795d06afa1f2914989ededb85f6b36f2b615e2eb3c30a14ad | MATLAB | 224 | 11 | function hl = vline(val,color,linestyle)
% function hl = vline(val,color,linestyle)
a = axis;
hl = line(val*ones(2,1),a(3:4));
if nargin >= 2
set(hl,'Color',color);
end
if nargin >= 3
set(hl,'LineStyle',linestyle);
end
|
f5df32c801ae347f655ac36ab73d1c1b0fe331cad52a3f02c8b9ae5efb8412b6 | MATLAB | 224 | 4 | function phase = PhaseShifting(phasein, teta)
% PhaseShifting has been deprecated. Use phase_shifter instead.
warning('PhaseShifting has been deprecated. Use phase_shifter instead.');
phase = phase_shifter(phasein, teta); |
109a17d21cbe0c7645fd3fc6c0e6d5786ac8bf803b913e5d27693f0c6f30bce9 | MATLAB | 225 | 9 | %% Function of histidine transporter.
% Histidine transport from blood to mast cell.
% UNITS in uM/h.
% b = bht.
function a = VHTLmc(b)
km = 1000; % (lobster)(6.2-19 muM conrad05)
vmax = 109.5;
a = vmax.*(b./(km + b));
end |
3bd043e02119bf6626198ab0b234b0676bd8adf12bf01e9d18e9d5fa46d5de5a | MATLAB | 225 | 4 | function PlotECG(data, L, varargin)
% PlotECG has been deprecated. Use plot_multichannel_data instead.
warning('PlotECG has been deprecated. Use plot_multichannel_data instead.');
plot_multichannel_data(data, L, varargin{:}); |
420d2a5b9a2daea55887cf545e4d8a5d9eec7b2753d5529f16a31a9813565ab5 | MATLAB | 225 | 8 | function H = MultiChannelSpectrum(x, fs, nfft, h)
H = dspdata.psd;
H = H(ones(1, size(x,1)));
for i = 1:size(x, 1),
H(i) = psd(h, x(i,:), 'Fs', fs, 'NFFT', nfft - 1, 'SpectrumType','onesided'); % Calculate the PSD
end
|
dcc8a536ba3ec6750f1f65318229149faa909c749b82ab74936b531e5f9e6421 | MATLAB | 226 | 7 | % save data from clusters
clusters_data.mean = clusters.mean;
clusters_data.std = clusters.std;
clusters_data.ste = clusters.ste;
clusters_data.num_of_cells = clusters.num_of_cells;
save("clusters4shai.mat", "clusters_data")
|
2e01db8e0e1741a2382a842a4b4e213131d43ce3446c9406534672d8d9b4b72e | MATLAB | 228 | 10 | function help(varargin)
%HELP Display the documentation
md = jrclust.utils.info();
try
web(md.docsSite);
catch ME
fprintf('Please visit %s to view the documentation\n', md.docsSite);
end
end
|
90bd04095595561fdb949b60972ab51a84e6588e46693ae9a245b58afafe61df | MATLAB | 228 | 14 | clear;
clc;
close all;
fs = 1200.0;
x = randn(5, 500);
fname = 'sample_binary_file.bin';
[status1, count] = MatToBinaryFileConverter(x, fs, fname);
[xx, ffs, status2] = ReadBinaryFile(fname);
isequal(fs, ffs)
isequal(x, xx)
|
0a84bcacceaaa243b48a7a5b97801c6fec73f90e0b00a40fdcd8cbb2102080b6 | MATLAB | 229 | 9 | function updateWaveforms(obj, updateMe)
%UPDATEWAVEFORMS Update mean waveforms and sim scores
if nargin < 2
updateMe = [];
end
obj.computeMeanWaveforms(updateMe);
obj.computeWaveformSim(updateMe);
end |
00d24b74b2ab7a24a3c858463149ec45d3740b2799df343e457f87a087dd5f5b | MATLAB | 230 | 8 | function ob = subsasgn_trick(ob, field, arg)
%function ob = subsasgn_trick(ob, sub, arg)
% method for ob.field = arg
% tricky way for dangerously replacing elements of object
ob = struct(ob);
ob.(field) = arg;
ob = fatrix2(ob);
|
3b4e670e415a9a00793449d3ac8f64d479f9f7b68784416853c5acbd15d5dec2 | MATLAB | 230 | 12 | function switch_vis(filename)
tic
fgr =load(filename,'-mat' ,'hgM_070000' );
toc
tic
fgr.hgM_070000.GraphicsObjects.Format3Data.CreateFcn = 'set(gcf,''visible'',''on'')';
toc
tic
save(filename,'-struct','fgr','-append')
toc
end
|
de8a31b627d76a3285e84a9c1177c1385b819aa47ccb621c41b55e3320252b74 | MATLAB | 230 | 15 | %% Function of SSRI decrease of SERT ratio.
% units in uM.
function ratio = k_ssri_reupt(ssri)
max_r = 2; % Max increase of speed.
b = 2.5; % Strength.
ratio = b .* ssri;
ratio(ratio > max_r) = max_r;
end
|
03634ce94f87a318675b6a49cd212da4d926ed88e6e95bbe77c8fc2bd1fadb62 | MATLAB | 231 | 12 | function Bursts = windows2bursts(EEG, Windows, Channel)
Bursts = struct();
for idxBurst = 1:size(Windows, 1)
Bursts.Start = Windows(idxBurst);
Bursts.End = Windows(idxBurst);
Bursts.Channel = Channel;
Bursts
end |
04050569a828308024e53edc8c69113bb468d3f9fad228b769cb8457ea95a3b8 | MATLAB | 231 | 4 | function y = BPFilter5(x, fc, bw, order)
% BPFilter5 has been deprecated. Use bp_filter_complex_ma instead.
warning('BPFilter5 has been deprecated. Use bp_filter_complex_ma instead.');
y = bp_filter_complex_ma(x, fc, bw, order); |
4a449952ac140f4d19e907b168e64ab3fb0aa224c1308512813892145bb70add | MATLAB | 232 | 8 | function vals = u2i(vals)
%U2I Convert an unsigned integer to ... something
if isa(vals, 'uint16')
vals = int16(single(vals)-2^15);
elseif isa(vals, 'uint32')
vals = int32(double(vals)-2^31);
end
end
|
5b7e9ca4dd5396d619e1aab467ef12d2f6dfa690e556d4c5317ecdedf7c059f2 | MATLAB | 233 | 9 | function XxWriteTiff(data, FileName)
imwrite(data(:,:,1), FileName, 'Compression','none');
if size(data,3)>1
for i=2:size(data,3)
imwrite(data(:,:,i), FileName, 'WriteMode', 'append', 'Compression','none');
end
end
|
c6671b30f3aa10d7024098e5be54d21303967e91cda7bbb5e24eabecc4d3a381 | MATLAB | 234 | 10 | %% Function of histidine decarboxylase
% Histamine synthesis in cytosol.
% UNITS in uM/h.
function a = VHTDC(b)
% b = cht
% c = G*
km = 270; %homosapiens BRENDA (other wild type =100, Komori2012)
v = 234;
a = v.*(b./(km + b));
|
eafa14a1db076921a7b70e56e7ba66aa24103c82fa906e7e478b00c26394954b | MATLAB | 234 | 10 | function st = nufft_table_change(st, om)
% change to a new set of frequencies
if ~isvar(st, 'phase_shift')
error 'only done for "table" version'
end
st.om = om;
st.M = nrow(om);
st.phase_shift = exp(1i * (st.om * st.n_shift(:)));
|
362f3ee9ab82b14dd7f9fb9c04448bc3a5d741eb064ac6c2ca4550744b2dde90 | MATLAB | 235 | 12 | %% Factor of uptake 2 velocity (Vu2) depending on eht (a)
%and basal eht (c)
% UNITS IN uM.
function f=H1ht(a, c)
if a < c
f = 0;
elseif a < (c + 0.02)
f = (50)*(a-c);
else
f = 1;
end
end |
8f8a4ced1571ffba1a9681e4459e01d04f6bc2e67dc1b2fa8290aa4171554e34 | MATLAB | 235 | 12 |
%selects the channels of interest V at t1 to t2 (integer values)
%saves into table
SCM_alt_times = array2table(amplifier_data([SCM_alt],:));
%when you want time of interest t1 you will call
SCM_alt_times.Var(t1)
|
3f1f907f30335479189fb877116d7a588c4b16f79b7306fe724d8a2a7ceff2cc | MATLAB | 236 | 7 | function writeGMPos(gmSurfaceMesh,pathnameHeadModel)
fid = fopen(fullfile(pathnameHeadModel,'/Utils/gmPos.txt'),'w');
for i = 1:size(gmSurfaceMesh.node,1)
fprintf(fid,'%.6f %.6f %.6f \n',gmSurfaceMesh.node(i,:));
end
fclose(fid); |
a41b2163c2d5f841790d22dc7e09863192012218a60fdb3a9b9967e7ef3a3878 | MATLAB | 236 | 6 | function pulseInd = getPulseInd_dat()
[pulseFile,fPath] = uigetfile('*.dat','Select Stimulation dat File');
fid = fopen(fullfile(fPath,pulseFile));
pulse = fread(fid,'int16');
pulseInd = getPulseOnsetOffset(pulse,max(pulse)/2);
end |
fd5164420d0697e94d9b69b70d11d6003cc76bcdddb3719f85c428748e1618de | MATLAB | 236 | 11 | %Shinjini Kundu (c) 2015
function [dx,dy,dz] = gradient(I)
%wrapper code that uses DGradient for fast gradient computation
dy = DGradient(I,1,1,'2ndOrder');
dx = DGradient(I,1,2,'2ndOrder');
dz = DGradient(I,1,3,'2ndOrder');
end
|
410f69314c5b14f678af42995917f0ac24649829255c60d7517fd26b9eeeba80 | MATLAB | 237 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job2.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
a47974c49f99b3cf576c8a1aec8389c435b570962989e7d908262b623b09b6e4 | MATLAB | 237 | 4 | function y = BPFilter3(x, fc, bw, wname)
% BPFilter3 has been deprecated. Use bp_filter_dft_windowed instead.
warning('BPFilter3 has been deprecated. Use bp_filter_dft_windowed instead.');
y = bp_filter_dft_windowed(x, fc, bw, wname); |
a5a1917c2aa60f1afaf4cf12e2ef242cf252fdae354ab8c828674592a17b1d64 | MATLAB | 237 | 4 | function y = BPFilter4(x,fc,bw,order)
% BPFilter4 has been deprecated. Use bp_filter_complex_ma_alt instead.
warning('BPFilter4 has been deprecated. Use bp_filter_complex_ma_alt instead.');
y = bp_filter_complex_ma_alt(x,fc,bw,order); |
abcbc274b3ae310ecf8bcd5d31aaf469a585a1d107202932edfe69d37ef9abad | MATLAB | 237 | 10 | function openRaw(obj)
%OPENRAW Open the raw recording file for reading
if obj.rawIsOpen
return;
end
obj.rawFid = fopen(obj.rawPath, 'r');
fseek(obj.rawFid, obj.headerOffset, 'bof');
obj.rawIsOpen = 1;
end |
c6740363662c7a3b85823110a74971720286249777c400d3524679076ac63346 | MATLAB | 237 | 10 | function NewAG = AGzeros(AG, AGth)
NewAG = {};
for reg = 1:length(AG)
Zeros = (AGth{reg}(:,:,2) - AGth{reg}(:,:,1)) ~= 0;
for gI = 1:2
NewAG{reg}(:,:,gI) = AG{reg}(:,:,gI).*Zeros;
end
end |
d5017641e6dbde863fa91a6e8f6c62ebbc96eb5569784942c2130160ee120620 | MATLAB | 237 | 5 | function samplesOut = filtTouV(samplesIn, hCfg)
%FILTTOUV Transform mean-subtracted filtered samples to units of uV
samplesOut = jrclust.utils.bit2uV(samplesIn, hCfg);
samplesOut = jrclust.utils.meanSubtract(samplesOut);
end
|
4ed88ff855783318c8215210e2f6dd7b7932ecb2433d79ede7db01cc3c9380c6 | MATLAB | 238 | 10 | %% Generate a smaller ring network (dense, sort of)
function S_SWconn = SmallNetworkGenerat(N_pre,N_post,N_conn)
S_SWconn = zeros(N_post,N_pre);
for postInd = 1:N_post
S_SWconn(postInd,randsample(N_pre,round(N_conn))) = 1;
end
end |
81f0c9fb0fc90d432a6dc4f398bc79c3c222feb078aa496e4e07b41b1d870e2d | MATLAB | 238 | 4 | function b = BaseLine1(x, L, approach)
% BaseLine1 has been deprecated. Use baseline_sliding_window instead.
warning('BaseLine1 has been deprecated. Use baseline_sliding_window instead.');
b = baseline_sliding_window(x, L, approach);
|
d5bf1c922734741404212bccfcaada3b959f3720dc30d0fc2d8b4363ac7212e6 | MATLAB | 238 | 5 | function nearbySites = findNearbySites(siteLoc, iSite, evtDetectRad)
%FINDNEARBYSITES Get sites which are within evtDetectRad of iSite
dists = pdist2(siteLoc(iSite, :), siteLoc);
nearbySites = find(dists <= evtDetectRad);
end
|
9c593cb3f15907bd603fc70177e05d562f4c08420b1bc131df091ba394c76685 | MATLAB | 239 | 5 | function numArray = extractNumFromStr(str)
str1 = regexprep(str,'[,;=]', ' ');
str2 = regexprep(regexprep(str1,'[^- 0-9.eE(,)/]',''), ' \D* ',' ');
str3 = regexprep(str2, {'\.\s','\E\s','\e\s','\s\E','\s\e'},' ');
numArray = str2num(str3); |
2cac4c033b6590b773f9287a4a6d2f5a81f6af6b26833a4413b3f0a8620c2dd2 | MATLAB | 240 | 13 | function [dist,sqDist,varDist,ix,iy] = dtw_custom(x,y,maxSamp)
[~, ix, iy] = dtw(x,y,maxSamp);
x = x(ix);
y = y(iy);
distVec = x-y;
sqDist = (distVec)*(distVec)'; %sq euclidean
varDist = numel(ix)*var(distVec);
dist = sqDist+varDist;
|
35af9aaa959aefc532aae9334b31a78494adca8dd079c909e6f3a159efdcccd2 | MATLAB | 240 | 4 | function R = Rotate3D(theta_x, theta_y, theta_z)
% Rotate3D has been deprecated. Use rotation_matrix_3d instead.
warning('Rotate3D has been deprecated. Use rotation_matrix_3d instead.');
R = rotation_matrix_3d(theta_x, theta_y, theta_z); |
aa4b3be0161977309e43dc5510118b14ede33e960a0c99df58e45e05166ba633 | MATLAB | 240 | 14 | function [mu, inv_sigma] = fit_gaussian(x,class)
N = max(class);
mu = zeros(N,size(x,2));
inv_sigma = zeros(size(x,2),size(x,2),N);
for i=1:N,
mu(i,:) = mean(x(class==i,:));
inv_sigma(:,:,i) = inv(cov(x(class==i,:)));
end
|
b28401680321a47673a8e16831c0bba774e8b315f7eb9faeb896687c06f1463e | MATLAB | 240 | 6 | function parent = menuOptions(obj, parent, labels, hFun)
%MENUOPTIONS Create options branch in the uimenu
for i = 1:numel(labels)
uimenu(parent, 'Label', labels{i}, 'Callback', @(hO, hE) hFun(labels{i}, parent));
end
end |
e8362759f6e5a9de120c7cc3c5bc1cd9908fa14779a8dcdc4b2968db90edf79c | MATLAB | 240 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/XXX_JOBFILE_XXX'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
e8f11e5543e5b89955404926d93bc20984f79326a10fb7d70753c4ed7543619f | MATLAB | 240 | 13 | function suj = get_subject(indir,reg_ex,varargin)
if ~isempty(varargin)
o = get_subdir_regex(indir,reg_ex,varargin);
else
o = get_subdir_regex(indir,reg_ex);
end
% for k=1:length(o)
% suj(k).sujdir = o{k};
% end
suj.sujdir=o; |
229b7f953ba194df6e0924d840c80ab2128e28e81ba09b31f3736213853e3650 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x06.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
2b6b209f05c9ab69120399505a54072143c9dde16cfb7594b02ca93cb74d92da | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x04.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
2cd441df6dc651c8c398fde6092ce737127b180b0066cca7299ce7ebd09f77ad | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x03.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
31a493515fdc503fe696ee9a537979449d37d2473849bf7176e127122c6c9a06 | MATLAB | 241 | 6 | %% use premutation + IE + calculate number of IE responsive FUN
[file, path] = uigetfile('*.mat','MultiSelect','on');
%%
calculate_IE_fun(file, path)
calculate_premutation_t1_for_3_ints_win(file, path)
calculate_IE_responsive_fun(file, path) |
5331aa3bb9691fa0ea4999fd4289f6464047474b37757328151da8175bafa229 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x09.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
5f6bf463d41e1fee705ff2db64b40307bee408d2403db5d6ed0fcee2117c3ea9 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x08.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
60f22e825bff35cac59a28a1e2933ca2ee5660452dcfeff6310de361269afe6a | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x02.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
7970a1cce4c179284ba32c7bd3c8194a2973be0f49f598b465fcedba47ac1915 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x05.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
9970c47cc8bceee5a6ac8fe947e485fdbae4d682fab4328d3b053dc6b2c1c677 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x01.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
bd8966a17ead8153fd02fda53fd20d13722fca06908867654cc3748d46d709f5 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x00.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
c34dd64bbdc63d82ab571722a36913f61992da5bc1e279cb1c0d7aa0c84abc30 | MATLAB | 241 | 9 | % List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'/data/spm12_job1_x07.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});
|
78e05bb8b89f741770e14ab8d85e7ee024d4d568917d67dd3c5388e47996f2d2 | MATLAB | 242 | 4 | function [index, rank] = ChannelIndex4(x, varargin)
% ChannelIndex4 has been deprecated. Use sqi_negentropy instead.
warning('ChannelIndex4 has been deprecated. Use sqi_negentropy instead.');
[index, rank] = sqi_negentropy(x, varargin{:}); |
ab1d9fcf802b0febc2cd9b2e6277e9c89b366b27c551cc0187ad01f5adb1b5db | MATLAB | 242 | 13 | function cRes = forceQuit(obj)
%FORCEQUIT Like endSession, but ignores isWorking
if obj.isWorking
obj.isWorking = 0;
end
if nargout > 0
cRes = obj.endSession();
else
obj.endSession();
end
end
|
67748e5193dd236c8776ea9a87dcefa0cdcae48ffdc00151c83b1b06097f6640 | MATLAB | 243 | 8 | function [data_psd,f] = psdcal(lowf,step,highf,sampling_rate,data)
%PSDCAL Summary of this function goes here
% Detailed explanation goes here
f = (lowf:step:highf);
fs = sampling_rate;
[data_psd] = pwelch(data,fs/2,fs/5,f,fs);
end
|
75877c3a555b368c13541b63bdb17c175aa300984f6755534c73ecbd4a57d250 | MATLAB | 244 | 4 | function [e,n] = AdaptiveFilter(x, delay, taps, mu)
% AdaptiveFilter has been deprecated. Use adaptive_filter instead.
warning('AdaptiveFilter has been deprecated. Use adaptive_filter instead.');
[e, n] = adaptive_filter(x, delay, taps, mu); |
a724b0e6cd8d99fbaebd80e2025bcc220029a36e23bb03d61230b2c472c88162 | MATLAB | 244 | 4 | function [lowpassed,a] = KLPFilter(y, fc, varargin)
% KLPFilter has been deprecated. Use lp_filter_kalman instead.
warning('KLPFilter has been deprecated. Use lp_filter_kalman instead.');
[lowpassed,a] = lp_filter_kalman(y, fc, varargin{:}); |
efcd38c707c6ae70e5f8618696b6b4c8cfe1034c604dbe4ae4012f141d713fe5 | MATLAB | 244 | 8 | clear
clc
cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\effect size\f4\d')
%%
control = importdata('control.mat');
control_stats=mestab(control.table)
dreadds = importdata('dreadds.mat');
dreadds_stats=mestab(dreadds.table)
|
95a5e76e24137699260fff469e5f1d9ba166e52c96b7dc0a33a322cdedf168f7 | MATLAB | 245 | 4 | function [x, fs, status] = ReadBinaryFile(ifname)
% ReadBinaryFile has been deprecated. Use read_binary_signal instead.
warning('ReadBinaryFile has been deprecated. Use read_binary_signal instead.');
[x, fs, status] = read_binary_signal(ifname); |
2ed0c1f198b7e60dbe95af35ba1bd42d566b6b553ed4af984a6b6086a681c8a0 | MATLAB | 246 | 12 | function res = newOperator(A,At)
% attempt at making operator that uses given A and At as the mtimes and
% mtimes (adjoint) functions
%
% Daniel Gallichan, October 2012
res.adjoint = 0;
res.A = A;
res.At = At;
res = class(res,'newOperator');
|
f22ecaa32d797566e452e9872a213770d8df6532815131fd6d45a9ac586c97f6 | MATLAB | 246 | 4 | function [y,W,A] = SCA(x, fl, fu)
% SCA has been deprecated. Use spectral_component_analysis_dft instead.
warning('SCA has been deprecated. Use spectral_component_analysis_dft instead.');
[y, W, A] = spectral_component_analysis_dft(x, fl, fu); |
bfb441cd19967e6d7a4bf03b30da03fd44e2fa814fd6ac2c3068a2d59c5ce5e8 | MATLAB | 247 | 8 | function Labels = indexes2labels(Indexes, Chanlocs)
% outputs channel indices based on chanlocs labels
AllLabels = string({Chanlocs.labels});
AllLabels(strcmpi(AllLabels, 'CZ')) = "129";
Labels = AllLabels(Indexes);
Labels = str2double(Labels); |
a42188ec1ca0beee4c3fa04d32b6036a76804e17567204f084e1d573c52ecf05 | MATLAB | 248 | 8 | function out = tril_vec(A)
%Function to out put the lower triangular of a matrix as a vector
%// Mask of lower triangular elements
mask = tril(true(size(A)),-1);
%// Use mask to select lower triangular elements from input array
out = A(mask);
end
|
f109602ee0c681880f68bc92022707735302611774df710fe4e5610557de8220 | MATLAB | 248 | 13 | function closeLog(obj)
%CLOSELOG Close the log file
if obj.logFid ~= -1
try
fclose(obj.logFid);
catch ME
warning('Failed to close log: %s', ME.message);
end
end
obj.logFid = -1;
end
|
1ad848ac31bb825156f6e65786cd6f40f05931ce1cb600e3e0f76860e28444ae | MATLAB | 249 | 9 | function dlgAns = inputdlgNum(prompt, dlgTitle, defAns)
%INPUTDLGNUM Numeric input dialog
dlgAns = inputdlg(prompt, dlgTitle, 1, {num2str(defAns)});
try
dlgAns = str2double(dlgAns{1});
catch
dlgAns = nan;
end
end
|
aece9c235d2f4cc40527f31232865795c761e7230ff01052a4ca10068aee53de | MATLAB | 249 | 11 | function [phi] = gaussian_bf(X,Y,Z,sigma)
phi = 1/(2*pi*sigma^2)*exp( - (X.^2 + Y.^2 + Z.^2)/(2*sigma^2) );
% phi_x = -phi.*X/(sigma^2);
% phi_y = -phi.*Y/(sigma^2);
sp=sum(phi(:));
phi=phi/sp;
% phi_x=fliplr(phi_x/sp);
% phi_y=flipud(phi_y/sp);
|
e6674235223dcba70e988cc9c35bd80a6fbf2356fb62a10bd60b4cca7b8cc803 | MATLAB | 249 | 11 | function akerdcomp(a,b)
% GAR, Glasgow University, 26 Nov 2012
da=akerd(a,a,0);
db=akerd(b,b,0);
figure('Color','w','NumberTitle','off');hold on
plot(sort(a),da,'k','LineWidth',2)
plot(sort(b),db,'k--','LineWidth',2)
box on
set(gca,'FontSize',14)
|
9a45fcb8463e2a8f698dba5637dedb44b1ea8d28e92acdbbb488af68fe04d447 | MATLAB | 250 | 4 | function [phase, phasepos] = PhaseCalculation(peaks)
% PhaseCalculation has been deprecated. Use phase_calculator instead.
warning('PhaseCalculation has been deprecated. Use phase_calculator instead.');
[phase, phasepos] = phase_calculator(peaks); |
bf1371474591f17e8928cb2170b5ede980741ae4211b6b0001561971ced5260a | MATLAB | 251 | 4 | function [index, rank] = ChannelIndex5(x, varargin)
% ChannelIndex5 has been deprecated. Use sqi_zero_crossing instead.
warning('ChannelIndex5 has been deprecated. Use sqi_zero_crossing instead.');
[index, rank] = sqi_zero_crossing(x, varargin{:}); |
cb697ad87c62283a8708213599860e80a19a9bd1c3e7c1b8d81e31af1e8edadc | MATLAB | 251 | 4 | function x = ECGModelTimeBased(params, time)
% ECGModelTimeBased has been deprecated. Use gaussian_mixture_model instead.
warning('ECGModelTimeBased has been deprecated. Use gaussian_mixture_model instead.');
x = gaussian_mixture_model(params, time);
|
171f9b6280c663002a40713c665da87ed3f0b591ac8520feca378a9fca871517 | MATLAB | 252 | 18 | function fo=linebroadening_fid(f,lb)
fo=f;
for nf=1:length(f)
spec = f(nf).spectrum;
fid = f(nf).fid;
t=[0:spec.dw:(spec.np-1)*spec.dw]';
for k=1:size(fid,2)
fid(:,k) = fid(:,k) .* exp(-t*pi*lb);
end
fo(nf).fid = fid;
end |
416238158422a68b7497b652fe00860e8b4115ea415920f0a92ed45ed455b29e | MATLAB | 252 | 10 | %% Function of monoamine transporter in vesicles.
% Transport of histamine from cytosol to vesicles.
% b = cha
% c = vha
function a = VMATHmc(b, c)
k = 24;
V = 21104;
a = (V.*(b./(k + b)) - 5.*c);
a(a<0) = 0; %Make sure a is not negative
end |
586f1edb53e765fde623f27883b59c977c3ab5bb9f6014e939f39095f61f4e0f | MATLAB | 252 | 10 | % Call Directories where ALL scripts are
%% ADDING ALLSCRIPTS
fprintf('\n>>Loading FinderSpiker: ')
if exist('Calcium_Magic.m','file')
fprintf('already ')
else
ActualDir=pwd;
addpath(genpath([ActualDir,'\Scripts']))
end
fprintf('done.\n\n') |
a769c044281a9ba49b3f724979aa4f54ec155e62059a33b9346961d40fd27d35 | MATLAB | 252 | 4 | function [mn, vr_mn, md, vr_md] = RWAverage(x)
% RWAverage has been deprecated. Use robust_weighted_average instead.
warning('RWAverage has been deprecated. Use robust_weighted_average instead.');
[mn, vr_mn, md, vr_md] = robust_weighted_average(x); |
f012a5b54998b95d2ab51d07f405524cc2dd0d2afa4616fb0883bfb46530fa53 | MATLAB | 252 | 13 | data = clusters.matrix;
x = find(cell2mat(data(:,4)) == 4);
for i = 1:length(x)
psth = cell2mat(data(x(i),5:end));
figure
plot(psth)
hold on
plot([30 30],[-5 9],'--k');
plot([130 130],[-5 9],'--k');
title(data{x(i),1})
end |
f0c20f188e5b8ff54505d077b5092ac208c9605128d2c1eefe41eb66cab1caa3 | MATLAB | 252 | 14 | %% Function to make Row Vector any vector
% Input: vector A
% Output: vector B
function B=makerowvector(A)
if isvector(A)
if isrow(A)
B=A;
else
B=A';
end
else
disp(' > Just Tranpose Matrix < ')
B=A';
end |
ffd1ab9a442eeec769855d7e76a52b6a4728cfb7e017b3cf1f94c7bcd12914c0 | MATLAB | 252 | 11 | clear
clc
close all;
fs = 1000;
load('SampleMECG-FECG1.mat');
plot(((6001:12000)-6000)/fs,testdata(6001:12000))
grid
xlabel('time(s)');
ylabel('Amplitude(mV)');
title('Sample maternal-fetal ECG segment (after incomplete mECG cancellation)'); |
73d011d722a4dc8e6f750f0cba015f4dfaf916b47870c295837626f59127915a | MATLAB | 255 | 8 | %% Uptake 2 rate of reuptake into glial terminals.
% b = e5ht
% UNITS IN uM and uM/h.
function a = VUP2(b)
km = 0.17; %Km Wightman-bunin
vmax = 1400; % Vmax Wightman-Bunin .78*1800
a = (vmax.*b./(km + b)); % (4700)
% Km is from Bunin98, see also Daws05 |
88536a9f8fc954f4001100fbf69b6d2cad2455d7371f72421598a8640062145c | MATLAB | 255 | 20 | function [Z, pval] = zscore_forContrastCorr(r1, r2, n1, n2)
%
%
%
%
%
%
% by Hiro Taiyo Hamada, 2020/12/17
z1 = atanh(r1);
z2 = atanh(r2);
Z = z1-z2;
Z = Z/sqrt(1/(n1-3)+1/(n2-3));
P = @(z) erfc(-z/sqrt(2))/2;
p_two = 2*normcdf(Z);
pval = 2 - p_two; |
f125c0b10769c109e64918866693a68f31cc45faf602b8ca07d0d01d6426dd69 | MATLAB | 255 | 4 | function [Q, P] = PolarDecomposition(A, varargin)
% PolarDecomposition has been deprecated. Use polar_decomposition instead.
warning('PolarDecomposition has been deprecated. Use polar_decomposition instead.');
[Q, P] = polar_decomposition(A, varargin{:}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.