norm_max.m

来自「Matlab 二进小波变换程序」· M 代码 · 共 43 行

M
43
字号
function [m,n]=norm_max(x)
%--------------------------------------------------------------------------
%
% NORM_MAX calculate the norm max of the wavelet decomposition.
% 
%    M = NORM_MAX(X) returns the Norm Max of the matrix X.
%    
%    Yang Yu-shan 15-Nov-2006.
%    Last Revision: 15-Nov-2006.
%    Institude of Geophysics and Geomatics, China Univercity of Geosciensis.
%    $Revision: 1.0 $ $Date: 2006/11/15 10:40:30 $
% 
%--------------------------------------------------------------------------

[rn,cn] = size(x);
m = zeros(rn,cn);
n = m;
for i = 1:cn
    xx = x(:,i);%xx = abs(x(:,i));
    for j = 2:rn-1
        if xx(j-1)<xx(j)&xx(j+1)<xx(j)|xx(j-1)>xx(j)&xx(j+1)>xx(j)
            m(j,i)=x(j,i);
        end
    end
end

for i = 1:rn
    b=1;
    for j = 1:cn
        b=(b~=0&m(i,j)~=0);
    end
    if b~=0, n(i,:)=m(i,:); end
end

for i = 1:cn
    subplot(cn,1,i);
    plot(m(:,i));
end
figure
for i = 1:cn
    subplot(cn,1,i);
    plot(n(:,i));
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?