Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
考虑这个例子:
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])的特定等高线?
如果所需的值是
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”之后。