-2

考虑这个例子:

X = 0:0.01:1;
Y = 0:0.01:1;
[x,y] = meshgrid(X,Y);
z = sin(x.*y);
contourf(x,y,z,'ShowText','on')

在此处输入图像描述

轮廓的值是自动确定的。如何绘制具有特定值(例如 [0.1,0.3,0.44,0.63,0.78,0.89])的特定等高线?

4

1 回答 1

-3

如果所需的值是

  v = [0.1,0.3,0.44,0.63,0.78,0.89]

那么我们有

X = 0:0.01:1;
Y = 0:0.01:1;
[x,y] = meshgrid(X,Y);
z = sin(x.*y);
contourf(x,y,z,[0.1,0.3,0.44,0.63,0.78,0.89],'ShowText','on')

矢量“v”的位置必须在“z”之后。

于 2016-05-09T23:27:28.757 回答