urs*_*oth 1 matlab plot contour matlab-figure
我在 matlab 中做了一个等高线图(参见代码)。我想找到值等于 1 的等高线。现在我刚刚找到它大约在等高线图之间:
这可以做到吗?例如,如果我想从值 0 到 1 绘制 5 条等高线
更新我设法绘制等于 1 的轮廓线,但我希望轮廓线在内部,而不是在轮廓线 =1 外部,正如我使用此代码得到的那样。
[x,y] = meshgrid(-3 : 0.01: 3, -3 : 0.01: 3);
s = x + i*y;
z=abs(1+s+((s.^2)/2)+((s.^3)/6));
figure;
[C,h] = contour(x,y,z,[1 1]);
clabel(C,h)
hold on;
[R,k] = contour(x,y,z,25);
clabel(R,k)
Run Code Online (Sandbox Code Playgroud)
怎么样:
[C,h] = contour(x,y,z,0.1:0.1:1);
clabel(C,h)
% no need for 'hold on' and all the rest...
Run Code Online (Sandbox Code Playgroud)
这就是你要找的?