sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
628bbabdd32c0b693c605c1f451720f7eb478f21226181af31377aef819e26e3 | MATLAB | 71 | 7 | function CHECK(expr, error_msg)
if ~expr
error(error_msg);
end
end
|
b02d3392005ceb935858c28cfe0234a8681bb9cfcf24b860053fd45d209eb15e | MATLAB | 73 | 5 |
function KURT = jKurtosis(X,~)
% Kurtosis
KURT = kurtosis(X);
end
|
361708542f3859951600d71316f83f26ec2f31baf6fc92cb271da834023f99d5 | MATLAB | 75 | 5 | function NM = DeleteAll(NM)
defs = NM.defs; clear NM; NM.defs = defs;
end |
44c1fc4df71ae984d3844a718931a162d66961f6fdcbc39cb375af6ae4e892b7 | MATLAB | 77 | 5 | % LME fitting script
%% load and prepair data
load('dPuffCspksAll.mat') |
96fe6fea89a91554713c029be095c6f38b611437b6f769a668ad0667acbc0739 | MATLAB | 77 | 6 | function [ dist ] = euc_dist(X, Y)
dist = sum(sum((X-Y).^2));
end
|
dfd8635faaa3d6d7e29b33d0f183a715db067c7eb9807431aeaa20167eb543b9 | MATLAB | 77 | 4 | function VERSION = MClustVersion()
VERSION = 'MClust 4.4.07; 2017/Oct/03';
|
6f665e16d405da22a99e00ed8b1d9e2ff7956e4445104d7cca074b42ea9c80a3 | MATLAB | 78 | 2 | %dbstop in opxOnline at 340
opx=opxOnline(struct('type','slave','isSlave',1)); |
db16d9918e9cadc42d0d0a7980a4c9b67c181e50150a72075800014d67837883 | MATLAB | 78 | 3 | function x = state_str(self)
self.compress();
x = {self.fit_data.state_str}; |
7c7926df4a3cbd486e33b080e8648fee7de95194457691d83e8b7f3505550944 | MATLAB | 79 | 4 | function c = safenormcdf(x)
thresh=-10;
x(find(x<thresh))=thresh;
c=normcdf(x); |
3b2bd689597088fad6e0b942bd54db40f12a146075acdee292cfb6b9e356c849 | MATLAB | 80 | 3 | function path = optickaRoot()
path = [fileparts(which(mfilename)) filesep];
end |
9c6efc788da3657970181d54d71975ce22f839a98541adf08a8fcac86b949af2 | MATLAB | 80 | 9 |
function K = kern(xp, yp,len)
K = exp( -(xp(:) - yp(:)').^2 /(2*len^2));
|
ec33d99612792b91368bc3c51cab4269dd0762efc32b95ace9c3be9420c6af9b | MATLAB | 81 | 2 | %dbstop in opxOnline.m at 162
opx=opxOnline(struct('type','master','isSlave',0)); |
67f5cca22e9b19e18f182d945823054235083162fc37439b62ade5bb6e907053 | MATLAB | 82 | 3 | function x = xyz(self)
self.compress();
x = reshape([self.fit_data.xyz],3,[]).'; |
ab08753d3b6a0781c84bb798cb305b7917114b1e403c13c8d78284a2fad55218 | MATLAB | 83 | 3 | function [Xnorm] = L11norm(X)
% ||X||_tr = sum_i\sigma_i
Xnorm = sum(sum(abs(X)));
|
1fdd4c61c51f9638b7516756aba534ec6fd941d0499ba1eca59fc03d39f9c092 | MATLAB | 93 | 3 | function [Xnorm] = L12norm(X)
% ||X||_{1,2} = sum_i||X^i||_2
Xnorm = sum(sqrt(sum(X.^2,2)));
|
4532b0f94afac8d02cbaeffa7deaf5880b4f9168f525f5cd681ad1f391293e08 | MATLAB | 96 | 3 | function [Xnorm] = L1infnorm(X)
% ||X||_{1,2} = sum_i||X^i||_inf
Xnorm = sum(max(abs(X),[],2));
|
77e943752f76f7a9e0774ba11f1baaf2ebbbd3539f425a704844e389595b099b | MATLAB | 97 | 7 | function set_mode_cpu()
% set_mode_cpu()
% set Caffe to CPU mode
caffe_('set_mode_cpu');
end
|
7b4d5b135b1f3be28abac647abfcd69b937f45a8192c5841fca969a363e2e270 | MATLAB | 97 | 7 | function set_mode_gpu()
% set_mode_gpu()
% set Caffe to GPU mode
caffe_('set_mode_gpu');
end
|
2d2aafda4320115432a3d4321fa8ec1f2fd65062aa23de9f4efc1a6f55184070 | MATLAB | 98 | 4 | % normalize columns of matrix
function x = normc(x)
x = bsxfun(@times, x, 1./(sum(x.^2,1).^0.5)); |
6f6e07586d8d4312373e257d452b92698cad1a4c6cd19322df4d9316b8f5826d | MATLAB | 98 | 6 | function c = safenormpdf(x)
thresh=35;
x(x<-thresh)=-thresh;
x(x>thresh)=thresh;
c=normpdf(x);
end |
9b71e1d3435eab609dbaa2ab2b689298003b62d33548e5b653b0712bbd4aea5b | MATLAB | 98 | 5 | function Y = cv_TestCustomPreproc(Y, params)
for i = 1:size(params,2)
Y = Y+params(i);
end
end |
068b71bf1a6d3baf4a6e94c1c64adf6e3ea31a31dfda4a54eeba89f601129bd3 | MATLAB | 100 | 5 | function y = bprior(gamma_hat)
m = mean(gamma_hat);
s2 = var(gamma_hat);
y=(m*s2+m^3)/s2;
end |
7770daa5e077da09967c6ac7966477883a85b59c15b00eb94c3ea75471f5dd05 | MATLAB | 100 | 5 | function y = aprior(gamma_hat)
m = mean(gamma_hat);
s2 = var(gamma_hat);
y=(2*s2+m^2)/s2;
end |
922f6b078fe4b0770fc175e1e7ffb074d9182e2025b01efe5959b41feb87e642 | MATLAB | 100 | 3 | function y = postmean(g_hat ,g_bar, n,d_star, t2)
y=(t2*n.*g_hat+d_star.*g_bar)./(t2*n+d_star);
end |
7cd231711964d6c9acc5531bdf675f2ccb71b9df8d3e594fb52566ec65264d80 | MATLAB | 107 | 6 | function F=invPowerLaw(x,ns,es)
% inverse power law
% numN=numel(ns);
F=x(1)*(ns.^(-x(2)))+x(3) - es;
end |
4bf925540a077be86e38f2254729d43f0e78cc483ac978fcc489ce39b73d3dc2 | MATLAB | 110 | 7 | function version_str = version()
% version()
% show Caffe's version.
version_str = caffe_('version');
end
|
5b36e184f9c753f4367e4759be5b0f9aca1e56e0326325dc5eaf37136b4af99b | MATLAB | 110 | 3 | function [Xnorm] = wL1norm(X,lambda)
% ||X||_wL1 = sum_i \lambda_ij|X_ij|
Xnorm = sum(sum(lambda.*abs(X),2));
|
f6e4e30d09e9815394d42781d7478cf887d0f9127b23ec1a3f290c89c5ce77ff | MATLAB | 114 | 4 | function s = col_sum(x)
% COL_SUM Sum for each column.
% A more readable alternative to sum(x,1).
s = sum(x,1);
|
26108f0aece192e9e7b5ec1e5f40b57058d3438f72c81450cebb5731b85907cc | MATLAB | 116 | 6 |
function VAR = jVariance(X,~)
N = length(X);
mu = mean(X);
VAR = (1 / (N - 1)) * sum((X - mu) .^ 2);
end
|
03a809f678fb0bd4b1d10a5430af6a04c68ef746961688ef7e4f357e2e9ee419 | MATLAB | 117 | 7 | function simulResults = simulate_sampleSize(varargin)
%global NM
simSample_App;
%simulResults = simulFunc(a);
end
|
07ea35dcdfc5c5ac08efce0bebd387007ba307997237db7b25b16ca85168d98a | MATLAB | 118 | 8 | function S = sparse_update_native ( S, v )
idx = find(S~=0);
for ii = 1: length(idx)
S(idx(ii)) = v(ii);
end
end |
a245efa6404336f8c1f0648dd39321f55dd2a95453093cf32da89e8219dc55a3 | MATLAB | 118 | 7 | function CHECK_FILE_EXIST(filename)
if exist(filename, 'file') == 0
error('%s does not exist', filename);
end
end
|
2a113187b7fa5b80661d671b29fd31490c4ce6a22057f2eb87831203f9ce2416 | MATLAB | 119 | 5 | function d = idiv(p0,q0)
eps = 1e-9;
p = p0(:) + eps;
q = q0(:) + eps;
d = sum(p.*log(p))-sum(p.*log(q))-sum(p)+sum(q); |
bdbe6f664ab3fe87e740c28f30dd12d395f47d827b238a203cfed432c4cd4d16 | MATLAB | 119 | 9 | function ClusterFunc_01_CheckCluster(self)
% f = DeleteCluster()
%
% ncst 26 Nov 02
% ADR 2008
%
self.CheckCluster(); |
a37efe258486bf0a6a6771419444abc2778731399116f74ccf703c9f2150dc51 | MATLAB | 120 | 3 | function x = fitted_params(self)
self.compress();
x = reshape([self.fit_data.fitted_params],self.model.n_params,[]).'; |
4ba297f3ba35bb337cd54885279ca4dde64857c17c3cbade15f6a17d7e675321 | MATLAB | 121 | 3 | function [X] = proximalwL1norm(D, tau)
% min_X 0.5*||X - D||_F^2 + \sum_i tau_ij*|X_ij|
X = sign(D).*max(0,abs(D)- tau);
|
07cf1e8c6c1d0eb3efa1814e03cfefc62bc78ef7e9e46f1f6513f502ec5a73c4 | MATLAB | 130 | 5 | function [version, release_date] = nmflibrary_version()
version = '1.8.0';
release_date = '30-June-2019';
end
|
1d937c805aab29e2679c9a3776bfa068ff59ee82aaa5cb07a4ae07a1fd61ebb1 | MATLAB | 130 | 7 |
function SD = jStandardDeviation(X,~)
N = length(X);
mu = mean(X);
SD = sqrt((1 / (N - 1)) * sum((X - mu) .^ 2));
end
|
1f6408908da6f39218f9097d9c19aaa3391b7c68691ab5bf00c95d85448ce790 | MATLAB | 130 | 7 | function id = genID
id = [num2str(datenum(date)) '_'];
idrand = ceil(5.*rand(5,1));
for i=1:5
id = [id num2str(idrand(i))];
end
|
7784a89ba4e72ed4f06ce7c178f82c3fe08ab79778a4ddc9ebfa8025c69f18e7 | MATLAB | 131 | 8 | function mse = calc_mse(Vo, W, H)
F = size(Vo, 1);
N = size(Vo, 2);
mse = norm(Vo - W * H,'fro')^2 / (F*N);
end
|
721638fdb12ec7969bddd55b406718b708a183adcfc3602ab6b7a9e17eaafd7f | MATLAB | 133 | 6 | function x = chisq(self,idx)
self.compress();
x = [self.fit_data.fitted_chisq];
if nargin >= 2 && ~isempty(idx)
x = x(idx);
end |
d7eca73dd05c46273acfdb26784004c0d52b9a8451baab5c32cd75d3548c1d17 | MATLAB | 136 | 7 | function R = nk_Range(X, dim)
if ~exist('dim','var'), dim=1; end
min_X = min(X,[],dim);
max_X = max(X,[],dim);
R = abs(max_X - min_X); |
e41a1ece16fcebb5b2f8ec255e6d3f6a251e0c37687b276f6980371c58fd6e12 | MATLAB | 136 | 4 | function output = GaussDist(xo,sigma,PA)
r = sqrt(-2.0.*(sigma^2).*log(rand(PA,1)));
phi = 2.0.*pi.*rand(PA,1);
output = xo+r.*cos(phi); |
fa8ed12cc175aa2b9748b90545bda80aaa45ef876609b09d80d67be5130d70ca | MATLAB | 136 | 7 | function nl = nk_GetLabelDim(MULTILABEL)
if isfield(MULTILABEL,'sel')
nl = numel(MULTILABEL.sel);
else
nl = MULTILABEL.dim;
end |
f56612999c2be695165574a4b60d400fb0186f5b540d2fd31c242b44c6a50938 | MATLAB | 140 | 7 | function res = fft2c(x)
fctr = size(x,1)*size(x,2);
for n=1:size(x,3)
res(:,:,n) = 1/sqrt(fctr)*fftshift(fft2(ifftshift(x(:,:,n))));
end
|
22d2f994e95468ac5de00b2e300d2f8f7e8b08e69f7b7212b0df262c81ee06c7 | MATLAB | 152 | 6 | function [ W, info ] = MTFLCd_SPGWrapper( X, y, lambda1, epsilon, opts )
opts.epsilon = epsilon;
[ W, info ] = MTFLCd_SPG( X, y, lambda1, 0, opts );
|
fac0e5b6d0fe1cd423b19c9dbe837931fe86a80d697bd65528275953bbb26634 | MATLAB | 152 | 7 | %[2018]-"A Novel Multi-Class EEG-Based Sleep Stage Classification System"
%(3)
function HA = jHjorthActivity(X,~)
sd = std(X);
HA = sd ^ 2;
end |
bfeb17654de58a6a00bb419d9021a0482d7ef9994b62ecd7e5087a5aee20f2eb | MATLAB | 153 | 7 | function P = nk_CalibrateProbabilities(P, cutoff)
if ~exist('cutoff','var') || isempty(cutoff)
P = P - 0.5;
else
P = P - (cutoff+realmin);
end
|
96f3426e9f500966dacf28cbe0a907c65cedeb3d933956cfb8c48a64b5b509e9 | MATLAB | 159 | 7 | function [ res ] = getRMSE( Y, P )
%RMSE Summary of this function goes here
% Detailed explanation goes here
res = (((Y-P)'*(Y-P))/length(Y))^0.5;
end
|
b73d61a836454d63ef0ee974d05df2bdf975dba8c8551c75da570f70b7d16b26 | MATLAB | 163 | 9 | function tso = keep(tsin, keep)
% tso = keep(tsin, OK)
% returns a new tsd with only the elements in OK
%
% ADR v6.0 2011/12
T = tsin.range();
tso = ts(T(keep)); |
6000eb37ed5c14776589da14bfe003dbbf4d9d4bf0eab26e9535d97973234509 | MATLAB | 165 | 6 | function MCS = GetSettings()
global MClustInstance
assert(isa(MClustInstance, 'MClust0'));
assert(isvalid(MClustInstance.Settings));
MCS = MClustInstance.Settings;
|
b5442d3bcd639d32497354c9a06448b0659298cca4a9f337edb055b5c204631f | MATLAB | 165 | 5 | function LabelInteraction = nk_Check4LabelInteraction(P)
LabelInteraction = false;
for a = 1:numel(P)
if P{a}.LabelInteraction, LabelInteraction = true; end
end |
572cbfd9d1329dbaad3401b30c40aecebf30167fb2f35863e65979cab29d4d36 | MATLAB | 167 | 9 | function err = tfocs_err()
% tfocs_err : TFOCS error measurement
%
% $Revision: 0.1.2 $ $Date: 2012/09/15 $
%
global subprob_optim
err = subprob_optim;
|
9cead71cf2f4884fb0c126481ca8058b08b5cdd1d43549c06dd10afcd9d15005 | MATLAB | 167 | 8 | function Sj_masked = nk_SparseMaskObserv(Sj, p1)
m = size(Sj,2);
vec = zeros(1,m);
k = round(m*p1);
idx = randperm(m);
vec(idx(1:k)) = rand(k,1);
Sj_masked = Sj.*vec; |
516759b29122c7b50396695d7e47f4761531114d87898a3b773676f6efe64eab | MATLAB | 168 | 8 | function I = nk_RemapData(D, I, remap)
[~, m] = size(I.Y);
tY = nan(D.n_subjects_all, m);
tY(remap.vec2,:) = I.Y(remap.vec1,:);
t_ID = D.cases;
I.Y = tY;
I.ID = t_ID;
|
5e56cb1304b4d6a0f0fe5e358e4ae0413c26a280c42ce6da01c4dbe937831ec2 | MATLAB | 169 | 6 | function min_max = mripy_range(A)
%MRIPY_RANGE Find the smallest and largest element in array.
% 2017-08-14: Created by qcc
min_max = [min(A(:)), max(A(:))];
end
|
5a6b1df0e9c50dd9c50be267559ede53c944efdf318c72211ca9b7090fd56fcb | MATLAB | 171 | 7 | clear; clc;
disp('compile native libraries')
mex -O -largeArrayDims sparse_inp.c
mex -O -largeArrayDims sparse_update.c
disp('done compiling.')
test_consist1
test_consist2 |
fe5d607be15da8091b35c888e4baf48416a8961ce948677d95378d37f730efec | MATLAB | 172 | 8 | function reset_all()
% reset_all()
% clear all solvers and stand-alone nets and reset Caffe to initial status
caffe_('reset');
is_valid_handle('get_new_init_key');
end
|
07d0cc09b2047e7aaa893e0b72f6e7fe44434b6aa10c70e9a40724caaa6c3817 | MATLAB | 173 | 8 | function delser
delete(instrfindall())
ser = serial('COM3', 'Baudrate', 115200);
fopen(ser);
fclose(ser); % close and delete serial comport
delete(ser);
clear ser; |
161cb03ac0f86e14b662572d8de15b878b74782bf751871549808ae0fc0953d7 | MATLAB | 175 | 8 | function ClusterFunc_00_ShowInfo(self)
S = {self.name, ...
sprintf('@%s', class(self)), ...
sprintf('%d spikes', self.nSpikes()), ...
};
msgbox(S, self.name);
end |
516f8919ef2b6cd0a3bed3286ff2a4232110f7afa8dc6086527a7c4a0181750a | MATLAB | 175 | 9 | function retVal=stop_rule(X,gradX)
% Stopping Criterions
% Written by Naiyang (ny.guan@gmail.com)
pGrad=gradX(gradX<0|X>0);
retVal=norm(pGrad);
end
|
96f0ec7aeb07c16cf1e7643b1b6e13a15354d1889680c04e7dc3307d69ab4ae2 | MATLAB | 175 | 10 | function H = nk_ThrowCoin(H)
hi = H==0;
if any(hi) > 0
hx0 = hi;
shx0 = sum(hx0);
i0 = rand(shx0,1);
i0(i0>0.5) = 1; i0(i0~=1)=-1;
H(hx0) = i0;
end
return |
e0cd8463eed62e2f78a807c7283f5c347c07ba2e837a9b01efb6dad5c8effbc2 | MATLAB | 175 | 6 | function point_cloud(self)
% Plots a color-coded point cloud
xyz = self.xyz;
figure
self.scatter_statecolored(xyz(:,1),xyz(:,2),xyz(:,3));
tent.surface_hg2([],false,'a1') |
07e6943275ebd252c99cbe2497ee3281457ecc118f475431bf4921375dffe27b | MATLAB | 179 | 6 | function [pred ret dec] = do_binary_predict(y, x, model)
[pred acc dec] = svmpredict(y, x, model);
if model.Label(1) < 0;
dec = dec * -1;
end
ret = validation_function(dec, y);
|
41bdad67b6a2d04b83d5fd13803a4b4148e4e4b62bd0fc2eccb8c66ee06f1dff | MATLAB | 180 | 8 | % removes all ROIs drawn for multivideo SVD
function h = resetROIs(h)
h.ROI{h.whichfile} = [];
h.eROI{h.whichfile} = [];
h.ROI{h.whichfile}{1} = [];
h.eROI{h.whichfile}{1} = [];
|
a0a97f0f8bccd6a8bb4f310925f4bcc38533d696baa3e50c439fca4fb0e745c6 | MATLAB | 183 | 6 | function spmver = nk_CheckSPMver
spmver=0;
if ~isempty(which('spm')) && (strcmp(spm('ver'),'SPM5') || strcmp(spm('ver'),'SPM8')|| strcmp(spm('ver'),'SPM12')),
spmver = 1;
end
|
7f227f412e03a00cc6c75172ccdc91773bbcff9fd9be1eef24064402eaf40b35 | MATLAB | 185 | 5 | function linsvmfl = determine_linsvm_flag(SVM)
linsvmfl = any(strcmp({'LIBSVM','LIBLIN'}, SVM.prog)) && any(strcmp({' -t 0',' -t 4',' -t 5','lin', 'linear'}, SVM.kernel.kernstr));
end |
e68e013175365b5e8c83da12f8c297310dfef09e3bf40bbf13a737649567d1ae | MATLAB | 185 | 5 | function load_selCase(handles,cases)
popupstr = cellstr(join(string([cellstr(num2str((1:numel(cases))')) cases]),' | '));
handles.selCase.String = popupstr;
handles.selCase.Value = 1;
|
8e45a7083bebb8a29a158ca43f4f99f0d6b5be51d98e20a32d8b7640d34ad0c5 | MATLAB | 188 | 9 | function diffNm = maxNorm(V, V0, U, U0)
n = length(V0);
diffV = zeros(n, 1);
for i = 1: n
diffV(i) = norm(V{i} - V0{i}, 'fro');
end
diffNm = max(mean(diffV), norm(U - U0, 'fro'));
end |
a9456ef591859b05575d71722b94c1337bfd51c5f606596f40eaf092b2b5c5f4 | MATLAB | 188 | 7 | function varargout = nk_ItemSelectorApp(varargin)
app = nk_ItemSelector_App(varargin{:});
%waitfor(app.cmdFinish,'UserData')
if isvalid(app)
varargout = app.output;
app.delete
end
|
c91a86401212361357a95552ed27adfbb0d99ef34e9145b12ec105a46b8780b5 | MATLAB | 189 | 6 | function subject = mripy_infer_suma_subject(suma_dir)
%MRIPY_INFER_SUMA_SUBJECT Infer subject identifier for the suma dir.
% 2017-08-13: Created by qcc
error('NotImplemented!');
end
|
eb45150e12f59e0d23f81dbe1ae246e39b1e90b21ba66fee86e817d53c655d78 | MATLAB | 189 | 7 | function id = nk_ExtractID(nam, ext)
%idstr = regexp([nam ext],'_ID.*\.','match');
%id = idstr{1}(4:end-1);
idpos = regexp(nam,'ID\d\d\d\d\d\d_\d\d\d\d\d');
id = nam(idpos+2:idpos+13);
end |
07d4b971f8e9c5c0f8691e9f1eb1122628ec86fa9ba62527963faa05ea8101aa | MATLAB | 190 | 9 | function S = apply_sparsity_thres2(A, thres)
nEdges = size(A,2)*thres;
nEdges = ceil(nEdges);
%sorteA = sort(A, 'descend');
[B,I] = maxk(A,nEdges);
S = A;
S(setdiff(1:length(A),I)) = 0;
end |
1e188990b6736a8acf7fc11c62f659d0c69c693a7ae30ee3333c57ebbb604e6a | MATLAB | 191 | 12 | function names = GetFeatureNames( self )
% returns feature names for display
nF = length(self.Features);
names = cell(nF,1);
for iF = 1:nF
names{iF} = self.Features{iF}.name;
end
end
|
d07b13c504f06c5c89982fe0bd169c1f721f85675d4dd7f289a6b9567975d744 | MATLAB | 194 | 4 | function [X] = proximalL11norm(D, tau)
% min_X 0.5*||X - D||_F^2 + tau*||X||_{1,1}
% where ||X||_{1,1} = sum_ij|X_ij|, where X_ij denotes the (i,j)-th entry of X
X = sign(D).*max(0,abs(D)-tau);
|
fde7ff789d168b25c3af9b43364bcd2e41880b1d5ed0081173fce177c3e1f8f3 | MATLAB | 197 | 6 | function handles = load_modal(handles, GDdims)
for i=1:numel(GDdims)
popuplist{i} = sprintf('Modality #%g: %s',i,GDdims{i}.datadescriptor.desc);
end
set(handles.selModal, 'String', popuplist); |
8f9e28ee17d684ff28a763463e910fa9bd0902049f749e62418a6606a3532c32 | MATLAB | 201 | 8 | function algostr = getAlgoStr(analysis)
switch analysis.params.TrainParam.FUSION.flag
case 3
algostr = 'DESCFUSE';
otherwise
algostr = analysis.params.TrainParam.SVM.prog;
end
|
8a9150da0b9ff89c2067de8bfeea2454d751658bc631986abcb172a5e5c856f5 | MATLAB | 202 | 13 | function sY = apply_binning(Y, Bins)
[m,n] = size(Y);
sY = zeros(m,n);
for j=1:n
vec = Bins{j};
if isempty(vec), continue, end
for k=1:numel(vec), sY( Y(:,j) >= vec(k) ) = k; end
end
end |
083d05ae3c949f0911a1ac0b83c2d51fbbd4331cc9b045bb3371e6b39634ae6a | MATLAB | 203 | 7 | %[2014]-"A Comparative Study on Classification of Sleep Stage Based on EEG
%Signals Using Feature Selection and Classification Algorithms" (2)
function X_max = jMaximum(X,~)
X_max = max(X);
end
|
11f43454a9b5fa08bedac35151e057d4630f322bc86664aebfdc3eb67020cb98 | MATLAB | 203 | 6 | %[2014]-"A Comparative Study on Classification of Sleep Stage Based on
%EEG Signals Using Feature Selection and Classification Algorithms" (12)
function ME = jMeanEnergy(X,~)
ME = mean(X .^ 2);
end |
357044b010456dbf50dabf0282a401d7ccfbccfdaaad79466dc4c9832924243c | MATLAB | 203 | 7 | function CALIBUSE = nk_AskCalibUse_config(ASKSTR, CALIBUSE)
CALIBUSE = nk_input(sprintf('Do you want to use the calibration sample for %s',ASKSTR), 0, 'yes|no', [1,2], CALIBUSE);
if CALIBUSE
end
|
a26939a21fbbab4d5b2a61fd00617911d25dcf59cb94bf284a6f1757bc5555c1 | MATLAB | 203 | 7 | %[2014]-"A Comparative Study on Classification of Sleep Stage Based on EEG
%Signals Using Feature Selection and Classification Algorithms" (1)
function X_min = jMinimum(X,~)
X_min = min(X);
end
|
70acb1636a594b1b54140fbb43826bcbc012d54b03c12cc85583c27d7499ce19 | MATLAB | 204 | 5 | % update the elements of a sparse matrix .
% sparse_update(S, v, length(v));
% Note: the following must be hold or the MATLAB crashes
% nnz(S) == length(v).
% TODO: write dimensionality check in c. |
d34153ffeed8e3e0207c6cdc29ecdfda6ab7be63a309fc031012f3a1b9f9dcf4 | MATLAB | 205 | 7 | %[2014]-"A Comparative Study on Classification of Sleep Stage Based on
%EEG Signals Using Feature Selection and Classification Algorithms" (4)
function AM = jArithmeticMean(X,~)
AM = mean(X);
end
|
59c7bce35c79f42c78ed93b4892d091454caacac4b1193e6b8d2f97c453d88f6 | MATLAB | 207 | 11 | function f_out = fit(model,f,P,npts)
% Minimal usage example
if nargin < 4 || isempty(npts)
npts = [];
end
f_out = bt.core.fit_spectrum(model,f,P,[],[],npts);
if nargout == 0
f_out.plot()
end
|
a2d981d1446300ab3ec0873127bfd04f3ce9129c079f6bd9e09d4deadd9bce70 | MATLAB | 208 | 7 | %[2014]-"A Comparative Study on Classification of Sleep Stage Based on
%EEG Signals Using Feature Selection and Classification Algorithms" (8-9)
function X_med = jMedian(X,~)
X_med = median(X);
end
|
0dfff7369cfba42befd4910ecef976acf564d8a15b13e764cd58f53f4a49e565 | MATLAB | 214 | 8 | function NM = DeleteCovarsInNM(NM, covind)
if numel(covind) == size(NM.covars,2);
NM = rmfield(NM,'covars');
NM = rmfield(NM,'covnames');
else
NM.covars(:,covind) = [];
NM.covnames(covind) = [];
end |
2906e494915b14034cb1736ad92894df771fdc02e3b0e8186d0868448b1501c3 | MATLAB | 214 | 5 | function contaminated = chisq_outliers(chisq)
if ~isnumeric(chisq) % If the user put a data object in instead
chisq = chisq.chisq();
end
contaminated = utils.romesh_gesd(chisq,0.05,ceil(length(chisq)*0.1),1);
|
a45567d8419b64c9630eb19095e4dd9d173c0d8e7b18ce6f984036776f028d39 | MATLAB | 215 | 10 | function Y = mp2rage_unscale_UNI( Y, integerformat )
%MP2RAGE_UNSCALE_UNI converts back MP2RAGE from -0.5 to 0.5 scale to 0 4095, if necessary
Y = 4095*(Y+0.5);
if integerformat
Y = round( Y );
end
end % end
|
ef9462ea2ceba3c9fbe22a42ea94585cd2476046fc5786405f5d1de4b5ed9ba7 | MATLAB | 215 | 8 | %[2017]-"Automated detection of focal EEG signals using features
%extracted from flexible analytic wavelet transform" (8)
function LogEn = jLogEnergyEntropy(X,~)
% Entropy
LogEn = sum(log(X .^ 2));
end
|
a68042b7fcb8e3244a0605285baad90141b4020f9d1d14ab8f3207b60a846a91 | MATLAB | 216 | 9 | JOB_ID=getenv('JOB_ID');
SGE_TASK_ID=getenv('SGE_TASK_ID');
mydir=getenv('mydir')
[status,cmdout] = system('ls -1 ${mydir} | head -n ${SGE_TASK_ID} | tail -n 1')
if status == 0;
runMsCluster([mydir cmdout]);
end
|
95096a9e3499484b6fd79fcf30bd7be9141e885cf120837980da3924b00e5e4c | MATLAB | 219 | 4 | function [X] = proximalL12norm(D, tau)
% min_X 0.5*||X - D||_F^2 + tau*||X||_{1,2}
% where ||X||_{1,2} = sum_i||X^i||_2, where X^i denotes the i-th row of X
X = repmat(max(0, 1 - tau./sqrt(sum(D.^2,2))),1,size(D,2)).*D; |
906cb82259442e7050bbbd7cc215dcd6d3d2f43bd7342078ad1c9442a9cc4ba1 | MATLAB | 220 | 12 | function ClusterFunc_Copy(self)
% f = CopyCluster(self)
% ncst 26 Nov 02
% ADR 2008
%
self.getAssociatedCutter().StoreUndo(['Copy' self.name]);
newCluster = self.MakeCopy();
newCluster.name = ['Copy of ' self.name];
|
1053c3456a00e58587b1268a86175bcf6b1846bb9ebb4ae46f55926797fb007f | MATLAB | 223 | 10 | function [ opts ] = setOptsDefault( opts, field, defaultValue)
%SETOPTS Summary of this function goes here
% Detailed explanation goes here
if ~isfield(opts, field)
opts.(field) = defaultValue;
end
end
|
af0736c857c601a1618510ef122a92cd20064a6640b5ab12c133cd312d103991 | MATLAB | 223 | 9 | function ncores = nk_CheckNumCoresAvail
global PARALLELENABLE
if isempty(PARALLELENABLE), PARALLELENABLE = false; end
ncores = 1;
a = str2double(getenv('OMP_NUM_THREADS'));
if ~isnan(a) && PARALLELENABLE, ncores = a; end |
4f9c1b03b01a325afcd73ce5c0a8805d6fafeef82d563585d249b376181ed617 | MATLAB | 225 | 7 | % constrain drawn ROI to size of figure
function roi0 = onScreenROI(ROI,nX,nY)
roi0 = ROI;
roi0(1) = min(nX,max(1,ROI(1)));
roi0(2) = min(nY,max(1,ROI(2)));
roi0(3) = min(nX-roi0(1),ROI(3));
roi0(4) = min(nY-roi0(2),ROI(4));
|
a1e425ef66efb35c963d1b4c8959ecc133ab7e98e81ab3802efb4aa902ad6b4d | MATLAB | 225 | 11 | %[2014]-"Feature Extraction and Selection for Emotion Recognition from
%EEG"
function FD = jFirstDifference(X,~)
T = length(X);
Y = 0;
for t = 1 : T - 1
Y = Y + abs(X(t+1) - X(t));
end
FD = (1 / (T - 1)) * Y;
end |
c1082b64c00b786660674d662d130a24332c43eb682c95e30f6f1796a16970a6 | MATLAB | 227 | 11 | %[2014]-"Feature Extraction and Selection for Emotion Recognition from
%EEG"
function SD = jSecondDifference(X,~)
T = length(X);
Y = 0;
for t = 1 : T - 2
Y = Y + abs(X(t+2) - X(t));
end
SD = (1 / (T - 2)) * Y;
end |
0c0823e79cbda92c7440c36f299b0adc0dfb2b613bd2e144e67fdf48a59bb236 | MATLAB | 228 | 13 | function ClusterFunc_02_DeleteCluster(self)
% f = DeleteCluster()
%
% ncst 26 Nov 02
% ADR 2008
%
MCC = self.getAssociatedCutter();
MCC.StoreUndo('Delete Cluster');
Iam = MCC.findSelf(self);
MCC.Clusters(Iam) = [];
MCC.ReGo(); |
cf3be77f147f6aaee04450397396b5adcf2cb4eff9338654d2de14766ff56082 | MATLAB | 233 | 6 | function MCD = GetData()
global MClustInstance
assert(isa(MClustInstance, 'MClust0'), 'MClust has entered an unknown state.');
assert(isvalid(MClustInstance.Data), 'MClust has entered an unknown state.');
MCD = MClustInstance.Data;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.