?? emax.m
字號:
function [ma, ta]=emax(x)
% The function EMAX returns the data max points and their coordinates.
%
% Calling sequence-
% [ma, ta]=emax(x)
%
% Input-
% x - vector of input data x(n)
% Output-
% ma - vector that specifies max points
% ta - vector that specifies the coordinates of max points
%
% Used by-
% NFA, NFA5, NFAM, NFAM5, NFAM5M
% Norden Huang (NASA GSFC) November 11, 1999 Initial
%----- Get dimensions
n=length(x);
%----- Initialize
n_x=1;
ma=0;
ta=0;
%----- Extract the set of max points and their coordinates
for i=2:n-1
if (x(i-1)<x(i))&(x(i)>=x(i+1))
ma=[ma x(i)];
ta=[ta i];
n_x=n_x+1;
end
end
%----- Define the output
ma=ma(2:n_x);
ta=ta(2:n_x);
ma=ma';
ta=ta';
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -