资源简介
用matlab画包络图和包络谱用的.大家看有没有用
代码片段和文件信息
function [updown] = envelope(xyinterpMethod)
%ENVELOPE gets the data of upper and down envelope of the known input (xy).
% interpMethod the interpolation method
%
% Input parameters输入参数:
% x the abscissa横坐标 of the given data
% y the ordinate纵坐标 of the given data
%
% Output parameters输出参数:
% up the upper envelope which has the same length as x.
% down the down envelope which has the same length as x.
%
% See also DIFF INTERP1
% Designed by: Lei Wang 11-Mar-2003.
% Last Revision: 21-Mar-2003.
% Dept. Mechanical & Aerospace Engineering NC State University.
% $Revision: 1.1 $ $Date: 3/21/2003 10:33 AM $
if length(x) ~= length(y)
error(‘Two input data should have the same length两个输入数据长度需要一样.‘);
end
strmethod={‘nearest‘ ‘linear‘ ‘spline‘ ‘cubic‘}; %将插值方法定义为单元数组
%插值方法(nearest临近点插值;linear线性;spline三次样条插值;‘pchip’ or ‘cubic’立方插值)
if (nargin < 2)|(nargin > 3) %nargin是用来判断输入变量个数的函数,这样就
评论
共有 条评论