📄 modulusmaxima.sci
字号:
function localmaxima = ModulusMaxima(m,par,ABS,threshold)
// Copyright Aldo I Maalouf
[lhs,rhs]=argn();
coef = 0;
coef2 = 0;
if rhs < 3,
ABS = 1;
end;
if rhs < 2,
par = 1;
end;
if ABS,
m = abs(m);
end;
[nrows,ncols] = size(m);
localmaxima = zeros(nrows,ncols);
t = 1:nrows;
tplus = rshift(t);
tminus = lshift(t);
for i = 1:ncols,
x = ShapeAsRow(m(:,i));
for j = 1:par,
x = max([x(t); x(tplus); x(tminus)],'r');
end;
x = ShapeAsRow(x)';
localmaxima(:,i) = (~(m(:,i)<x));
coef = coef + length2(find(localmaxima(:,i)));
localmaxima(:,i) = localmaxima(:,i) .* (abs(m(:,i))>threshold);
coef2 = coef2 + length2(find(localmaxima(:,i)));
end;
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -