matlab中peak的意思,peak time是什么意思,matlab中peak是什么意思a?

是峰函数,peaks(30)是产生30×30的guassian分布矩阵,你可以去查查,它的help说的很明白

看看源程序就明白了。

>> type peaks

function [xz,y,z] = peaks(arg1,arg2)

%PEAKS A sample function of two variables.

% PEAKS is a function of two variables, obtained by translating and

% scaling Gaussian distributions, which is useful for demonstrating

% MESH, SURF, PCOLOR, CONTOUR, etc.

% There are several variants of the calling sequence:

%

% Z = PEAKS;

% Z = PEAKS(N);

% Z = PEAKS(V);

% Z = PEAKS(X,Y);

%

% PEAKS;

% PEAKS(N);

% PEAKS(V);

% PEAKS(X,Y);

%

% [X,Y,Z] = PEAKS;

% [X,Y,Z] = PEAKS(N);

% [X,Y,Z] = PEAKS(V);

%

% The first variant produces a 49-by-49 matrix.

% The second variant produces an N-by-N matrix.

% The third variant produces an N-by-N matrix where N = length(V).

% The fourth variant evaluates the function at the given X and Y,

% which must be the same size. The resulting Z is also that size.

%

% The next four variants, with no output arguments, do a SURF

% plot of the result.

%

% The last three variants also produce two matrices, X and Y, for

% use in commands such as PCOLOR(X,Y,Z) or SURF(X,Y,Z,DEL2(Z)).

%

% If not given as input, the underlying matrices X and Y are

% [X,Y] = MESHGRID(V,V)

% where V is a given vector, or V is a vector of length N with

% elements equally spaced from -3 to 3. If no input argument is

% given, the default N is 49.

% CBM, 2-1-92, 8-11-92, 4-30-94.

% Copyright 1984-2006 The MathWorks, Inc.

% $Revision: 5.10.4.3 $ $Date: 2006/06/27 23:02:56 $

if nargin == 0

dx = 1/8;

[x,y] = meshgrid(-3:dx:3);

elseif nargin == 1

if length(arg1) == 1

[x,y] = meshgrid(linspace(-3,3,arg1));

else

[x,y] = meshgrid(arg1,arg1);

end

else

x = arg1; y = arg2;

end

z = 3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) ...

- 10*(x/5 - x.^3 - y.^5).*exp(-x.^2-y.^2) ...

- 1/3*exp(-(x+1).^2 - y.^2);

if nargout > 1

xz = x;

elseif nargout == 1

xz = z;

else

% Self demonstration

disp(' ')

disp('z = 3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) ... ')

disp(' - 10*(x/5 - x.^3 - y.^5).*exp(-x.^2-y.^2) ... ')

disp(' - 1/3*exp(-(x+1).^2 - y.^2) ')

disp(' ')

surf(x,y,z)

axis('tight')

xlabel('x'), ylabel('y'), title('Peaks')

end

peaks是Matlab内置的,常用于做演示使用的函数,特别是绘制三维图形的时候

peaks函数根据输入参数不同,返回一个山峰的三维坐标数据

因为突然要我们找一个合适的三维数据还真有些不太方便,而此时通过这个peaks数据我们可以演示一些三维的绘图或处理,比如等高线、网格图、曲面图等

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值