⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmxmn.m

📁 一种新的时频分析方法的matlab源程序。
💻 M
字号:
function h=cmxmn(c)

% The function CMXMN compares the number of max-min points of data against its derivative.
%
% Calling sequence-
% h=cmxmn(c)
%
% Input-
%	c	- 2-D matrix of input data c(n,k)
% Output-
%	h	- 2-D matrix of input data h(k,4) where 
%		  1st column specifies the input column number,
%		  2nd column specifies the number of extrema in c,
%		  3rd column specifies the number of extrema in c',
%		  4th column specifies the relation between 2nd and 3rd

% Z.Shen (Caltech)		March, 1997 Initial

%----- Get dimensions
[n,k]=size(c);

%----- Initialize
z=zeros(k,4);

%----- Define the 1st column
z(:,1)=(1:k)';

%----- Find the number of max-min points for c and c'.
%----- Fill the output matrix 
for j=1:k-1
    j
    j2=2;
    x=c(:,j);
    y=diff(x); 
    amx=0;
    amn=0;
    bmx=0;
    bmn=0;
    while j2<=n-2 ,
        if (x(j2-1)<x(j2))&(x(j2)>=x(j2+1))	
            amx=amx+1;			% max point
        elseif (x(j2-1)>x(j2))&(x(j2)<=x(j2+1))	
            amn=amn+1;			% min point
        end
        if (y(j2-1)<y(j2))&(y(j2)>=y(j2+1))	
            bmx=bmx+1;			% max point
        elseif (y(j2-1)>y(j2))&(y(j2)<=y(j2+1))	
            bmn=bmn+1;			% min point
        end
        j2=j2+1;
    end
    z(j,2)=amx+amn;
    z(j,3)=bmx+bmn;
    z(j,4)=(amx+amn)/(bmx+bmn);
end
h=z;

⌨️ 快捷键说明

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