ursmooth
ursmooth

Reputation: 311

matlab contour plot specific value

I have made a contour plot in matlab (See code). And I want to find the contour line where the value is equal to 1. Now I just have found it approximately between to lines contour plot: enter image description here Can this be done? For example if I want to plot 5 contour lines from the values 0 to 1

Update I managed to plot contour line equal to 1, but I want the contour lines inside, not outside the contour line =1 as I get with this code.

[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)

Upvotes: 1

Views: 1792

Answers (1)

EBH
EBH

Reputation: 10440

How about:

[C,h] = contour(x,y,z,0.1:0.1:1);
clabel(C,h)
% no need for 'hold on' and all the rest...

contour

That's what you look for?

Upvotes: 5

Related Questions