sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
639cd79785deef3e5a1a6c98d08a58d6599ef0d9463de2afd89e4b535d250202 | MATLAB | 149 | 8 | %% Function of the putative HA transporter in glia.
% UNITS in uM/h.
% b = eha
function a = VHATg(b)
k = 10;
V = 13500;
a = (V.*b./(k + b));
end
|
98c646a4a7d90adcbba987d59bfbffdabcbdd93680b95615fdaba15bbc5c2c8b | MATLAB | 149 | 4 | function flag = hasLog(obj, logTag)
%HASLOG Do we have a log entry with this tag?
flag = ischar(logTag) && isKey(obj.logEntries, logTag);
end |
6158fcea04e8739c71d953bbc5ac2b006e072ebf91343b84cc76a49822150583 | MATLAB | 150 | 9 | function X = removeNANrows(X,type)
if nargin>1 && strcmp(type, 'all')
X(all(isnan(X), 2), :) = [];
else
X(any(isnan(X), 2), :) = [];
end
end |
5423b175b1ebade3b7dd00fcdbf40f2664a4427fb16018920fe8ce59c507edb5 | MATLAB | 152 | 8 | function replot(obj)
%REPLOT Refresh FigWav, FigSim, and selected unit
obj.updateFigWav();
obj.updateFigSim();
obj.updateSelect(obj.selected, 1);
end
|
4179341f8ccf5ba3430b0682d4e796afc7c493fd0cd413ae27f6ec3339df0fac | MATLAB | 154 | 7 | function rgb = hex2rgb(hexstring)
for icol = 1:numel(hexstring)
str = hexstring{icol};
rgb{icol} = sscanf(str(2:end),'%2x%2x%2x',[1 3])/255;
end |
bce0fbd9c55082246328a8d6cae3a475d984efb05d3ac2b79e82d9c3c0302660 | MATLAB | 154 | 4 | function flag = hasMenu(obj, menuKey)
%HASMENU Return true if we have a menu item by key
flag = ischar(menuKey) && isKey(obj.hMenus, menuKey);
end |
cc7208691323230a1c0437c6ac9f7f566fec6204d42c5106a3e8847ee42edea4 | MATLAB | 154 | 9 | function ROI = loadROI(pathnameROI)
tmp = importdata(pathnameROI);
ROI.gmNodeList = tmp(1,:)';
ROI.solutionSpaceNodeList = tmp(2,~isnan(tmp(2,:)))';
|
1d991a0245065bd3292cad6dc49a926c8ae05a5bd674a183108b07848c2d50fe | MATLAB | 155 | 9 | function fatrix2_block_free(arg)
%printm 'freeing fatrix2_block object static memory'
for mm=1:length(arg.blocks)
try
free(blocks{mm})
catch
end
end
|
439725366c107cde868b83a6f4777c46f35e1519cfdb45c1de601fbc5ac12c00 | MATLAB | 155 | 6 | function r = drchrnd(a,n)
% take a sample from a dirichlet distribution
p = length(a);
r = gamrnd(repmat(a,n,1),1,n,p);
r = r ./ repmat(sum(r,2),1,p);
end |
2fbe1128275ff67bdce57d4e5274404ed8a04c1f94129f23bef4d9d26f2d94c6 | MATLAB | 156 | 8 | %% Function of the putative HA transporter in mast cells.
% UNITS in uM/h.
% b = eha
function a = VHATmc(b)
k = 10;
V = 3375;
a = (V.*b./(k + b));
end
|
e9ad325cc4cd84e7a1f102c509fe75fe01233658cac1556db8bea0aa83ec4c93 | MATLAB | 156 | 5 | function dirname = basedir()
%BASEDIR Get root directory of JRCLUST instance
dirname = fileparts(fileparts(fileparts(mfilename('fullpath'))));
end
|
2ae7f1429e356e9020805d12b4f268aa3a965063b5ad2a73b2b6f7b92c352beb | MATLAB | 157 | 9 | function d = softder(d, a)
%comsum = sum(a, 2);
%d = d .* bsxfun(@times, a, 1 - comsum);
comsum = sum(a .* d, 2);
d = a .* bsxfun(@minus, d, comsum);
end
|
ad361a4bbad92b70070a6edb60877a84918924be732e9e868119a4f658244eb4 | MATLAB | 157 | 5 | function ob = horzcat(varargin)
%|function ob = horzcat(varargin)
%| called for ob = [a, b, ...] where any of them is a fatrix2
ob = cat(2, varargin{:});
|
b9fcc5a042c5fc8796a558968f73de9902a69da75524366c199719a9a591b4a2 | MATLAB | 157 | 7 | function [ mat ] = label2mat( label )
if size(label,1) > 1
label = label';
end
mat = (repmat(label,numel(label),1)==repmat(label',1,numel(label)));
end
|
c1652613bbc0f3ac0d019176b842b4550e1858b5887a2dd10e0828cace08ea29 | MATLAB | 157 | 8 | function fo=remove_SerDescr(fi,descrp)
fo=fi;
for k=1:length(fi)
ind = findstr(fi(k).SerDescr,descrp)
fo(k).SerDescr(ind:(ind+length(descrp)))='';
end
|
ea5c9ea6259de7701cd29d9620df4c6ce56e2aeee1fce4f6fe1d39f830fb8678 | MATLAB | 157 | 5 | function ob = vertcat(varargin)
%|function ob = vertcat(varargin)
%| called for ob = [a; b; ...] where any of them is a fatrix2
ob = cat(1, varargin{:});
|
fb26767a24f8ad5284a1034d634751d339de565ce95afc1e084bfdbdbce828d8 | MATLAB | 160 | 9 | function rerun(obj)
%RERUN Rerun commands
if obj.isError
error(obj.errMsg);
else
obj.isCompleted = 0;
obj.run();
end
end |
8f6c5bfd31cc595f7b294936df567c012c10ee528bcf2632b409c0798518cba7 | MATLAB | 161 | 5 | function [ zmat ] = norm2zval( xmat )
% normalize each column of xmat
zmat = (xmat - repmat(mean(xmat),size(xmat,1),1))./repmat(std(xmat),size(xmat,1),1);
end
|
984a4312c7204c9f87a2bb09a1187a5785cad152082b81d7ab5fcb513c99cc85 | MATLAB | 161 | 5 | function findme()
% this little code is so that I can check if the toolbox path is correctly
% set up in matlab. just run try cycy.findme()
disp('cycy in path') |
f1cde4c68d1652d846d561d825214dc4021f7d5e1ff9104d03479547614216b0 | MATLAB | 161 | 9 | function upload_to_teensy(out, port)
out = single(out);
out = typecast(out, 'uint8');
% Send the numbers to the Teensy microcontroller.
fwrite(port, out);
end |
f6481618c7b159137ab495a9b80499586ac76285b651cef02773e30a43f2d17e | MATLAB | 161 | 7 | function dist = weightedEuclideanDistance(x,Y, weights)
dist = nan([size(Y,1), 1]);
for irow = 1:size(Y,1)
dist(irow) = sqrt(sum(weights.*(Y(irow)-x).^2));
end |
59987b25fb806c9032421637dde6cc6a032fc4f2f42759146e7214d046b92b51 | MATLAB | 162 | 9 | function bv = addQuadrant(bv)
qs = zeros(1,length(bv));
for i = 1:length(bv)
qs(i) = get_quadrant(bv(1:2,i));
end
bv = cat(1,bv,qs);
end |
125b9bca775de20b653332a151b89fd0d62cee839d0c6de4986efaedbec584ec | MATLAB | 164 | 7 | function dist = weightedEuclideanDistanceFun(x,Y, weights)
dist = nan([size(Y,1), 1]);
for irow = 1:size(Y,1)
dist(irow) = sqrt(sum(weights.*(Y(irow)-x).^2));
end |
cb9306683e5cffdd733858e340839e87f9fd453901b04988ad14fd7cadbb8bf9 | MATLAB | 164 | 6 | function preview(obj)
%PREVIEW Display Preview GUI
obj.startParPool();
hPreview = jrclust.views.PreviewController(obj.hCfg);
hPreview.preview();
end |
0113bf2cac51579d20757d3f556c3d2011a7ee4b3301895f2b5ed5a3d96ff1ed | MATLAB | 165 | 7 | function pred = dlgAssert(pred, failMsg)
%DLGASSERT Assert with a dialog failure
if ~pred
errordlg(failMsg);
error(failMsg, '');
end
end
|
aefd13b19123a07f22cd0c6b87178b6ace4577bf5603219e3afc60f9f4b741c4 | MATLAB | 165 | 5 | function unitIndices = unitIndex(obj, unitIDs)
%UNITINDEX Get index into showSubset of unitIDs specified
unitIndices = find(ismember(obj.showSubset, unitIDs));
end
|
b4cf00bb6d2b4d0e38b7803d9d70dc6e6293d4c7934c39b54860a042ba792dd5 | MATLAB | 165 | 5 | function showTraces(obj)
%SHOWTRACES Show raw traces with spikes
hTraces = jrclust.views.TracesController(obj.hCfg);
hTraces.show([], 0, obj.hClust);
end |
3e4ee6bfcbe6f2855276600da5998bdc9a738005c42a82a7e82556b002b97a8c | MATLAB | 167 | 8 | function outMats = moveFrame(inMats,applyMat)
nT = size(inMats,3);
outMats = zeros(4,4,nT);
for iT = 1:nT
outMats(:,:,iT) = applyMat*inMats(:,:,iT)/applyMat;
end |
99bbd271e48f1f1a15199d4b5632a809350f2b2d646121ab9fc0b3056532c7cd | MATLAB | 167 | 13 | function o = get_last_modif_dir(indir)
d=dir(indir);
d(1:2)=[];
for k=1:length(d)
dn(k) = d(k).datenum;
end
[i j ] =max(dn) ;
o = fullfile(indir,d(j).name);
|
aa2f79e729bf70848858e417c31e47be538f5281f4cb3be3ff86bc0e2779fa15 | MATLAB | 167 | 5 | function GUI_1_Denoise(P)
% Control_Panel_Grid = P.GUI_Handles.Control_Panel_Objects(1,1).Parent;
% Titles = {'CNN Threshold','Min Object Size','Marker Size'};
end |
758bbbf83261a2d795c4e7e81068f181b124946ed68027e506f8e0b1bc5add16 | MATLAB | 170 | 4 | function val = inProgress(obj)
%INPROGRESS Return true if in progress (not finished or errored)
val = ~(obj.isCompleted || obj.isError) && ~isempty(obj.hCfg);
end |
28db74a6633f5cc101d28fd19061f591402646291b656c787f6e6986c8d8f814 | MATLAB | 171 | 15 | function y = logsig(x)
% Logarithmic sigmoid
%
% Parameters
% ----------
% - x: array
% Input
%
% Returns
% -------
% - y: array
% Output
y = 1 ./ (1 + exp(-x));
end
|
1891f6a85e3e664ce2ef825ed419f992ab8f9a059eb7d94c42632a8b35af8ced | MATLAB | 172 | 9 | %% calculate standart mean error.
% sem = std(data, 0, dim)/sqrt(size(data,dim));
function sem = sem(data, dim)
sem = std(data, 0, dim)/sqrt(size(data,dim));
end |
734cd1ed536e8fb7b7c12bf452d134977d719da254d8b8f0663cc567b07d9f8e | MATLAB | 172 | 4 | function clearPlot(obj, plotKey)
%CLEARPLOT Set XData and YData of a plot to nan
obj.updatePlot(plotKey, nan, nan); % updatePlot checks for existence of plotKey
end |
85e7b214517b19010aff2df913f10be9f09a60e98dc76383ea3fd6ed410a7e99 | MATLAB | 173 | 8 | %% Function of the putative HA transporter in HA neuron.
% UNITS in uM/h.
% b = eha
function a = VHAT(b)
k = 10;
V = 4128.3;
a = V.*(b./(k + b));
end
|
1c3550acfaf38e4b982047567036b0a53c8570708a6e876a5c0cfcfbf2c27771 | MATLAB | 174 | 8 | function Array = windows2array(Starts, Ends, MaxLength)
Array = false(1, MaxLength);
for idxStart = 1:numel(Starts)
Array(Starts(idxStart):Ends(idxStart)) = true;
end
|
a10b7d727a7ee92cc7ebeb349876748d8e08e804e71321921b40339b55758fe1 | MATLAB | 174 | 8 | function flag = keyMod(hEvent, kMod)
%KEYMOD Check for a key modifier
try
flag = any(strcmpi(hEvent.Modifier, kMod));
catch
flag = 0;
end
end
|
62640ff501319f8bc71626f1ece4dbbcaf5fd016c436761b5f38ddcd11587953 | MATLAB | 175 | 20 | [m,n]=size(im_bw);
s1=[0 0];
s2=[0 0];
d1=[0 0];
d2=[0 0];
v=0;
[r c]=find(im_bw);
cnew=zeros(length(c));
for i=i:length(c)
if IX(i)==c(i)
cnew(i) |
d3665284de5275a09de3a11dd450f8c4f4b3e1f05ff1a5b9ac75dea005114646 | MATLAB | 175 | 7 | function out = norm(ob, varargin)
if prod(size(ob)) > (2^12)^2 % 64^2 by 64^2
warn 'norm of large object can be very slow'
end
out = full(ob);
out = norm(out, varargin{:});
|
e84c0963b972addf8aaf6583f2121ccaf206d7807f7158418313b22792c24984 | MATLAB | 175 | 8 | function num_out = clong(num_in)
%
% Convert to long type
%
% For right now I'm using int32, might need an 'if' statement at some
% point
num_out = int32(num_in);
end |
1477024bce321a241c463748fa7c2c71501e21276ab57412e986d9b6dc385bf3 | MATLAB | 176 | 8 | function closeRaw(obj)
%CLOSERAW Close the raw recording file, clear its data
if ~obj.rawIsOpen
return;
end
obj.rawData = [];
obj.rawIsOpen = 0;
end |
84207a5582ee6b9275c825be5d5c5b8af89a1ee1f5a1dcdf78376c39cbd0151e | MATLAB | 178 | 6 | function en = spikeEnergy(spikeWindows)
%SPIKEENERGY Summary of this function goes here
% Detailed explanation goes here
en = shiftdim(std(spikeWindows, 1))';
end
|
f8a176a754dba76f19c5b2625943aaa8db17e242bbf58a7f55da9b53462a18f7 | MATLAB | 178 | 5 | function FlippedVector = flip_vector_with_nans(Vector)
% turns 0s to 1s and 1s to 0s, leaving NaNs intact.
FlippedVector = double(Vector==0);
FlippedVector(isnan(Vector)) = nan; |
8e21f4381f0bf582d8b8cbdf9ce2359ce9eede1b2a8b4894902d19cc933a455c | MATLAB | 179 | 7 | axis tight;
temp_jAXIS = range(ylim);
if(min(ylim)~=0)
ylim([min(ylim)-temp_jAXIS/20 max(ylim)+temp_jAXIS/20]);
else
ylim([min(ylim) max(ylim)+temp_jAXIS/20]);
end
|
4535d88fa2637fc693c30cf47f760b7855d63f3d5121d7bbdb5d665504e74735 | MATLAB | 180 | 4 | function y = LinearWarp(x, L)
% LinearWarp has been deprecated. Use linear_warp instead.
warning('LinearWarp has been deprecated. Use linear_warp instead.');
y = linear_warp(x, L); |
d7b36059f34db3727649ea0b630924cd8b89397cd421c6f156464d36d95b5521 | MATLAB | 180 | 8 | function [layers, loss] = initder2(layers)
batchsize = size(layers{1}.d, 4);
deriv_sq = layers{1}.d.^2;
loss = sum(deriv_sq(:)) / (2 * batchsize);
layers{1}.a = layers{1}.d;
end
|
d2129c9e1f8eea62cad55fe4285326d4ff2041bed6dc98abb9c1c29b186cb596 | MATLAB | 181 | 10 | function [u, ia, ic] = nanunique(varargin)
x = varargin{1};
t = rand;
while any(x(:)==t)
t = rand;
end
x(isnan(x)) = t;
[u, ia, ic] = unique(x,varargin{2:end});
u(u==t)=nan;
end |
8bc270033eb1b1460bb07a6b515180406c10947b947ad3fdf338a9166d754ccd | MATLAB | 183 | 7 | function warn(varargin)
%function warn(varargin)
%
% print concise warning message
[name line] = caller_name(1);
fprintf(['Warn: %s %d: ' varargin{1}], name, line, varargin{2:end})
|
8caa00dbf0b43a5eee05443b524de47ee7e65095655649ddcc20879298384880 | MATLAB | 183 | 6 | %% Function of mast cell degranulation.
%s is neuroinflammation factor, or scale of neuroinflammation.
% f is release rate in hour-1.
function f = degran_ha_mc(s)
f = 3.*s;
end |
dc01a84def114d8f395a401437a8a6bdbe40aaccb7439756d0e88297149f68a1 | MATLAB | 183 | 7 | load('100simul_variable_pns_with_softmax.mat')
figure
plot(mean(e)/2200,'k')
hold on
load('100simul_variable_pns_with_softmax_OFF.mat')
plot(mean(e)/2200,'r')
legend('On','Off') |
3705c68d2906b65e514cfeb2abe8f92fd650ea7f62a94b8f36eba12d3e951e21 | MATLAB | 184 | 8 | function warning(obj, wmsg, varargin)
%WARNING Raise a warning
if obj.batchMode
warning(wmsg);
else
uiwait(warndlg(wmsg, varargin{:}, 'modal'));
end
end |
3eb22fd8d68cb27ecbda61d80ba38e7e59ae75b7a28c047f9c9deff7d7a9c82c | MATLAB | 184 | 9 | function count_touchlick
cd('C:\Users\C238\phase2D_responsive')
LS = ls;
for i=1:length(LS)
if ~isempty(strfind(LS(i,:), '.mat'))
data = load(LS(i,:));
end
end |
b3f4a8e5bd4276324880e8eb9b936d6386b27d6ac95666af67805b9b46a1a415 | MATLAB | 185 | 8 | function addNote(obj, iCluster, note)
%ADDNOTE Annotate a cluster
if iCluster < 1 || iCluster > obj.nClusters
return;
end
obj.clusterNotes{iCluster} = note;
end |
1665e93c900541ceb8f23b9ace5922ef9c600413a3d54b6a6fe1849f6d8f4e40 | MATLAB | 186 | 5 | function mat_ = neCell2mat(cell_)
%NECELL2MAT Like cell2mat, but keeps only nonempty cells
nonempty = cellfun(@(x) ~isempty(x), cell_);
mat_ = cell2mat(cell_(nonempty));
end
|
874ff61d1cc2e5f7a0050444874931980236a3d1bc48bd5cb48ba6ad089d951c | MATLAB | 186 | 12 | function co=expand_dysto_conc(c,contract)
if ~exist('contract')
contract=0;
end
if contract
co = c;
co([1:2;11:12]) = '';
else
co = [c(1),c(3),c(1:8),c(9),c(11),c(9:end)] ;
end |
d3bffdfb9e7270e02dc82d0c4e03d9ce0e1f1c909a97015ddddc64f76c22190b | MATLAB | 186 | 5 | % Methode des trapezes 1D pour un vecteur f de valeurs d'une fonction
% (subdivision homogene)
function int = quadrat_1D_trap(f,dt)
int = 1/2*dt*(f(1) + f(end)) + dt*sum(f(2:end-1));
end |
276998306d73ab96b192b0dc0158c556236ad90616e910d922c4627c8eb2b894 | MATLAB | 188 | 8 | function vec_idx = get_vec_idx( value, vector )
%GET_VEC_IDX Get the index of a value in a vector
% In: value, vector, out: index
[ val, vec_idx ] = min( abs( value - vector ) );
end
|
874915f99de901f53532991c45ea1a6d26e367a23bd8a2a9f00359fbb8f68ac4 | MATLAB | 188 | 10 | function rho = fastPearsonCorr(x, y)
n = length(x);
x_mean = mean(x);
y_mean = mean(y);
x_std = std(x);
y_std = std(y);
rho = sum((x - x_mean) .* (y - y_mean)) / (n * x_std * y_std);
end |
b7a602989c2b48da2f41305a4e314250628c327d11ff12fd56501fb281350372 | MATLAB | 188 | 8 | function jobs = spmup_second_level_qa(varargin)
% routine calling spmup_find_dropout and find_group_outliers
spmup_find_dropout(varargin)
[bad_subject] = find_group_outliers(SPM_file)
|
ca2887d90fdf4704ceaaa30f39a24fc50fb250a1d3c91f11355b6fc9ae221453 | MATLAB | 188 | 8 | function [out] = isbetween(numbers,low,high)
if(isempty(low))
out = (zeros(size(numbers))==1)';
else
out = numbers>=low & numbers<=high;
end
end |
4f901360ea75ffb6063bac249fbcbe9ca317a73bb9a66da108cf150832d952b4 | MATLAB | 189 | 9 | %% Function of histamine methyltransferase,
% Histamine metabolisis in cytosol.
% UNITS in uM/h.
% b = cha
function a = VHNMT(b)
k = 4.2; % Francis 80
V = 185.5;
a = (V.*b./(k + b));
end |
f7d1f4d6f3a1d4365719afffe9c3d0974907e19d0ee9dce1d67a6193693e53ef | MATLAB | 189 | 5 | function mat = setDiag(mat, vec)
%SETDIAG Set diagonal values of a matrix in a robust way
n = min(min(size(mat)), numel(vec));
mat(sub2ind(size(mat), 1:n, 1:n)) = vec(1:n);
end
|
1c9285a007e2979b0f43974555a8b4cd8391fb85ab5eae36bcce7e8806b1310e | MATLAB | 190 | 8 | function out = ifEq(pred, onTrue, onFalse)
%IFEQ If pred is true, return onTrue, otherwise return onFalse
if (pred)
out = onTrue;
else
out = onFalse;
end
end
|
5aaeb750d2458cd1971838c680ec9f2b7ab2c7e153d2338cd504657a82c9623c | MATLAB | 190 | 8 | function closeFilt(obj)
%CLOSEFILT Close the filtered recording file, clear its data
if ~obj.filtIsOpen
return;
end
obj.filteredData = [];
obj.filtIsOpen = 0;
end |
6fca169aa7e36af7f6d2929a53f33cd4d0398f5c8ab8c7da2e2448099aa11687 | MATLAB | 191 | 11 | function free(ob)
%function free(ob)
if isempty(ob.handle_free)
warn('attemp to free %s object with no free() method', class(ob))
return
end
ob.handle_free(ob.arg)
% todo: use onCleanup
|
8b5323c91440b31ae982a1679bebff72d26163ce850ab61e05586609920e30e2 | MATLAB | 192 | 13 | function [p,a] = fitpeak(S,ip)
% function [p,a] = fitpeak(S,ip)
[rs,duh] = size(S);
if ip == 1
p = 1;
a = S(1);
elseif ip == rs
p = rs;
a = S(rs);
else
[p,a] = quadpeaks(ip,S);
end
|
b5acbbac4d697e38aa5407f2c96e4abb202e26929287eb611e60bde0670c506c | MATLAB | 193 | 4 | function y = BPFilter(x, fl, fu)
% BPFilter has been deprecated. Use bp_filter_dft instead.
warning('BPFilter has been deprecated. Use bp_filter_dft instead.');
y = bp_filter_dft(x, fl, fu); |
506479c1ae5f6ccca52726d379ad68db475bd9680afd551797fad7b57b8a3243 | MATLAB | 194 | 11 | %% Function of histamine methyltransferase,
% Histamine metabolisis in glia.
% UNITS in uM/h.
% b = gha.
function a = VHNMTg(b)
k = 4.2; % Francis 80
V = 212;
a = (V.*b./(k + b));
end
|
b0afe8b8c3ee415ea6866d77d11defe24ea25ead49c086b89df5c3c9a392aa5c | MATLAB | 194 | 11 | function fi = extract_fid_first_scan(fi,NUM)
for nbser = 1:length(fi)
if size(fi(nbser).fid,2)>NUM
fi(nbser).fid = fi(nbser).fid(:,NUM);
fi(nbser).Nex = length(NUM);
end
end
|
9e80bc1d0e6892c920474eb66c1d6ab19380dc9c0e03a4109c1641eaa764f16f | MATLAB | 195 | 16 | function [found] = find_ser_descr(f,desc,exa)
found=0;
for k=1:length(f)
if findstr(desc,f(k).SerDescr)
if findstr(exa,f(k).examnumber)
found=found+1;
end
end
end
|
b346015532ed3bf1db71b3f95987a6f14b637cf7ddde78bd5cec3b230d37481c | MATLAB | 195 | 5 | function exportFiringRate(obj)
%EXPORTFIRINGRATE
firingRates = obj.hClust.getFiringRates();
jrclust.utils.exportToWorkspace(struct('firingRates', firingRates), obj.hCfg.verbose);
end
|
f67198ba2cf2e25b4dd0b896ec229bc7402a78d21f9fc80d6670710822e3d95b | MATLAB | 196 | 9 |
function rotatedVector= calcBeamRotation( beamDirection, inputVector )
rotatedVector = rotz( beamDirection(3) ) *roty( beamDirection(2) ) * rotx( beamDirection(1) ) * inputVector;
end
|
2eaf0520db94e9b8f3d9e67f6be91c042853722c99a7874a85b2a8961ed329f5 | MATLAB | 197 | 6 | function cleandata = clean(input, n)
upper=nanmean(input)+n*nanstd(input);
lower=nanmean(input)-n*nanstd(input);
index= input>upper | input<lower;
cleandata=input; cleandata(index==1)=NaN;
end
|
49dd06a9f3a141dc3243240789f5457c3b7911962b6a381e3e36ea095ae89ccc | MATLAB | 197 | 15 | classdef sample_count_manager < handle
%
% Class:
% adi.w.sample_count_manager
%
% We may not need this ...
properties
end
methods
end
end
|
705ceb9fca0bb3b18f66c7c826ab15566b51ab63bb9818884c288c15ba524bf7 | MATLAB | 197 | 8 | function updateFigRD(obj)
%UPDATEFIGRD Update the rho-delta plot
if ~obj.hasFig('FigRD')
return;
end
jrclust.views.plotFigRD(obj.hFigs('FigRD'), obj.hClust, obj.hCfg);
end
|
2737c914b78a680a7815ccd9c3c06ce19bbb9e212ad6546f6698ee1e0391003a | MATLAB | 198 | 9 | %% Function of histamine methyltransferase,
% Histamine metabolisis in mast cell.
% UNITS in uM/h.
% b = gha.
function a = VHNMTmc(b)
k = 4.2; % Francis 80
V = 21.20;
a = (V.*b./(k + b));
end
|
6ddae5092765e8b7f1b3d29b5d0abe7d7ad3358af806a2e0b45d575949cbee00 | MATLAB | 198 | 10 | function y = complexify(x)
%function y = complexify(x)
% make y complex if x is not.
% matlab's built in "complex" command chokes on complex inputs!
if isreal(x)
y = complex(x);
else
y = x;
end
|
71cadfb665092321e43c58306df0a6842911bd77eb2e97a341324d0f541958ad | MATLAB | 198 | 6 | function ob_out = kronI(M, ob_in)
%function ob_out = kronI(M, ob_in)
% ob_out = kron(eye(M), ob_in)
% useful for making 3D from 2D objects working slice-by-slice
ob_out = fatrix2_kroni(M, ob_in);
|
0ae9d28af3cce50d0f13f373222858d99a6d0248cf05d66dbe4f3d85fa620df5 | MATLAB | 199 | 4 | function samplesOut = rawTouV(samplesIn, hCfg)
%RAWTOUV Transform mean-subtracted raw samples to units of uV
samplesOut = jrclust.utils.meanSubtract(single(samplesIn) * hCfg.bitScaling);
end
|
c9f6effc9e3447fc37aba9830d1455c9f4d0dfc0123c2b7a48ed33b608eb5eef | MATLAB | 199 | 9 | function error(obj, emsg, varargin)
%ERROR Raise an error
obj.isError = 1;
if obj.batchMode
error(emsg);
else
uiwait(errordlg(emsg, varargin{:}, 'modal'));
end
end |
e75f9685370efedbace9a100ab56c8cdd6f6a2f92677a73f460de078977665fa | MATLAB | 199 | 14 | function fo=eddycorrection_self(f)
fo=f;
for nf=1:length(f)
fid = f(nf).fid;
for k=1:size(fid,2)
fid(:,k) = fid(:,k) ./ exp(1*i*angle(fid(:,k)));
end
fo(nf).fid = fid;
end
|
eec94b70f927db23cefb5483994cacf4e1bea97f4ce178435fbed93efa89d7e8 | MATLAB | 199 | 7 | function findarea(area)
load('nodelist','nodelist','acros');
id = find(contains(lower(nodelist),area));
for i = 1:length(id)
fprintf('%d\t%s\t%s\n',id(i),acros{id(i)},nodelist{id(i)});
end |
d7afb5a984df5c53ad49e917ac53522c1f8e1b03b6569e1e155b574c8a34bf2f | MATLAB | 200 | 7 | function vals = madScore(vals)
%MADSCORE Transform vals into MAD units
vals = bsxfun(@minus, vals, median(vals));
madsc = median(abs(vals));
vals = bsxfun(@rdivide, vals, madsc);
end
|
d8922a2f6f342b10b68a296cb46cf92359d549f25284fb86a0bd34286ed64afc | MATLAB | 200 | 9 | function startParPool(obj)
%STARTPARPOOL Start the parallel pool
if obj.hCfg.useParfor
try
parpool('local');
catch % parpool already running
end
end
end |
cd832a2ea02e1ca34011fe3dfe5395c6b599bd306da1248049daf1c879accdfe | MATLAB | 201 | 17 | function fo = change_phase (fi,phi)
fo = fi;
for nb_ser = 1:length(fi)
fid = fi(nb_ser).fid;
for k=1:size(fid,2)
ff(:,k) = exp(-1i*phi*pi/180)*fid(:,k);
end
fo(nb_ser).fid = ff;
end |
bbe0970e1e144ebe490f434fb28f35313189defc79a012362151b173132f2e00 | MATLAB | 202 | 8 | function [ output_args ] = saveMovie( movie,savePath )
%SAVEMOVIE saves movie to h5 file
h5create(savePath, '/1', size(movie), 'Datatype', 'single');
h5write(savePath, '/1', movie);
end
|
c92dc4035e3af0c644fa8058d4e9f845453c516902356acb7a61423433dbe5d1 | MATLAB | 202 | 12 | %% Factor of glia histamine reuptake.
% Units in uM.
% a = eha.
function f=H1ha(a)
if a < 19
f = 0.025;
elseif a < 29
f = (0.1)*(a-19);
else
f = 1;
end
end |
6bee9549ec0aaaf9f031ff010f7e4cc49f0e7a2ceb431e2d1e84e2fe082174a1 | MATLAB | 203 | 6 | %% get data
test_data_folder = fullfile(test_folder(), 'ds000117');
subjects = fullfile(test_data_folder, 'spmup_subjects_task-facerecognition.mat');
table_name = spmup_BIDS_QCtables(subjects, 'anat'); |
90e10d2c75af044ecb09ea5c02ac4f9ffa3a15075c6829105d5ae838bad59784 | MATLAB | 206 | 4 | function y = LPFilter(x, fc)
% LPFilter has been deprecated. Use lp_filter_zero_phase instead.
warning('LPFilter has been deprecated. Use lp_filter_zero_phase instead.');
y = lp_filter_zero_phase(x, fc); |
a3102a007c01be382b6ece5eea5e0bcf1d0910b1870105e10fa0a6a505cc95a6 | MATLAB | 207 | 8 | function newAffMats = recentre_affmats(affMats,iCentreVol)
nV = size(affMats,3);
newAffMats = zeros(size(affMats));
for iV = 1:nV
newAffMats(:,:,iV) = affMats(:,:,iV) / affMats(:,:,iCentreVol);
end |
7f158d4f2c9ccd37a89bfa659645161b4cd9457cabd482144d7f7082a4d24b8e | MATLAB | 208 | 18 | clc;
close all;
clear
T = 100000;
fs = 500;
f0 = 30;
BW = 5;
f = 30.5;
n = (0:T-1);
x = sin(2*pi*f/fs*n) + 0.5*randn(1, T);
tau = 3;
ff = IFMCorrelator(x, f0/fs, BW/fs, tau);
figure;
plot(f0 - ff*fs);
grid |
d651552a68aa561b9ebde0a3ab0b3ecea7d9c1cc7fabd1921c68d2f97f9887d8 | MATLAB | 208 | 15 | % shared variable section
a = 2;
%% My old test element
a = 3;
assert(a + a == 2, "Addition doesn't work")
assert(1 - 1 == 2, "Subtraction doesn't work")
%% my new test element
assert(a == 2, "happy!") |
fa031b19ab257d3721926a204f645572cb9d3276513807f712ff4b6e02759d72 | MATLAB | 208 | 7 | function data = xlsread_nan(file, range)
% import data from an exel file assigning to NaN to empty cells
[num,txt,raw] = xlsread(file, range);
raw(cellfun(@ischar,raw)) = {NaN};
data = cell2mat(raw);
end
|
46e8b44e6757ed8f942048159b4104a27c577c41075691f77589a2c873039a37 | MATLAB | 209 | 6 | set(0,'defaultaxesfontsize',12);
set(0,'defaulttextfontsize',24);
% set(0,'defaultaxesfontsize',26);
% set(0,'defaulttextfontsize',28);
set(0,'defaultlinelinewidth',1);
set(0,'defaultlinemarkersize',20)
|
83b26420e821488dfba186fe61e62babd1e4f7198ecc748a2a2c6169c9454b00 | MATLAB | 209 | 8 | function Bursts = average_cycles(Bursts, Fields)
for BurstIdx = 1:numel(Bursts)
for Field = Fields
Bursts(BurstIdx).(['Mean',Field{1}]) = mean(Bursts(BurstIdx).(Field{1}), 'omitnan');
end
end |
3a1973111b151eff2d395eadabcd9e717fc084860b4fc11adff3f2874ebeabb9 | MATLAB | 211 | 13 | function o=get_subdir_regex_multi(indir,reg_ex,varargin)
if length(varargin)>0
fprintf('Check it !! not tested c rrr')
return
end
for ki=1:length(indir)
o{ki} = get_subdir_regex(indir(ki),reg_ex);
end
|
dee7ee0af94f8dd0cdd4473fba3b3d3f06fa4cc28b8434c1bf890486647606ca | MATLAB | 212 | 12 | % test_all_gg_nufft.m
list = {
'ggnuffttest_type1'
'ggnuffttest_type1_2d'
'ggnuffttest_type2'
'ggnuffttest_type2_2d'
'gg_Gnufft_test'
};
run_mfile_local(list)
%run_mfile_local(list, 'draw', 1, 'pause', 1)
|
22a74abf18dfcfe35c6e0123dba83b18feea1c9acaf8b27182013305530fbaeb | MATLAB | 213 | 6 | function pathnameROI = writeROI(ROI,pathnameROI)
fid = fopen([pathnameROI(1:end-4) 'txt'],'w');
fprintf(fid,'%s\n',num2str(ROI.gmNodeList'));
fprintf(fid,'%s\n',num2str(ROI.solutionSpaceNodeList'));
fclose(fid);
|
bbd83895a1f11df1dc20ac3884868d87fb32bebaa387a23d6d6dbed9df2e3093 | MATLAB | 213 | 7 | cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\effect size\figure 1\1h')
x = importdata('sustained_data.mat');
stats=mestab(x.table)
%%
x = importdata('transient_data.mat');
stats=mestab(x.table) |
8591d94b933acf89bf677ed9ad4a68b852cf85fd26ec69b7d230992f7ab69512 | MATLAB | 214 | 8 | function save_invisible_fig(h, filename)
%SAVE_INVISIBLE_FIG Summary of this function goes here
% Detailed explanation goes here
set(h, 'CreateFcn', 'set(gcbo,''Visible'',''on'')');
savefig(h, 'filename')
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.