📄 zmax.m
字号:
function h=zmax(x)
%
% h=zmax(x):
%
% Function to extract the set of max points of a 1-D data.
%
% Input-
% x - vector of input data x(n)
% Output-
% z - vector that specifies the values of max points
%
% Z.Shen (Caltech) May, 1997 Initial
% Jelena Marshak (NASA GSFC) March 9, 2004 Edited
%
%----- Get dimensions
n=length(x);
%----- Initialize
n_x=1;
h=0;
for i=2:n-1
if (x(i-1)<x(i))&(x(i)>=x(i+1))
h=[h x(i)];
n_x=n_x+1;
end
end
%----- Define the output
h=h(2:n_x);
h=h';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -