Hi,
In the .m file attached, I have a plot of a contour.
The plot for the contour is on line 111. Please how can I include the contour at imag(taumin)=0.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Oct. de 2023
taumin is not complex, so imag(taumin) is zero everywhere. There is no contour to create.
You initialize
taumin=ones(nu,nxi);
which is not complex.
You set
taumin(i,j)=min(tausolR);
where
tausolR=imag(tausol_found);
You extract the imaginary component from tausol_found so the result is a strictly real number, and real numbers always have an all-zero imaginary component.
If the task is to include 0 in the level list then use
LL = union(0, min(min(taumin)):10000:max(max(taumin)));
contourf(U,Xi,taumin,LL);
Beware though, that min(min(taumin)) is -4.32538271227367e-07 and max(max(taumin)) is 1, so min(min(taumin)):10000:max(max(taumin)) is -4.32538271227367e-07:10000:1 which is just -4.32538271227367e-07

9 comentarios

University
University el 10 de Oct. de 2023
Okay, thank you for your explanation.
University
University el 11 de Oct. de 2023
Hi Walter,
I tried contourf(U,Xi,taumin, [-1, 0]); just to see if the zero contour will apppear but it couldn't work? From the attached fig. I you see is only the -1 contour that showed. I was expecting to see the zero contour too. Please is the rationale behind this?
Walter Roberson
Walter Roberson el 11 de Oct. de 2023
Why does your code only produce a single taumin() value per inner loop, but plots everything for every iteration ?
Walter Roberson
Walter Roberson el 11 de Oct. de 2023
Extracting the data from the contour plot, I see that the maximum Z data for the plot is -2.61427978861032e-08 -- so there is no zero to be plotted.
University
University el 11 de Oct. de 2023
Editada: University el 11 de Oct. de 2023
Hi Walter,
Thanks for your question. I'm only interested in the minimum value of tau for each inner loop.
I have also checked that the mintau = -1.051870082314296e+05 and maxtau =-2.614279788610316e-08. I think this is inline with what I in mind.
Thank you for your assistant.
Yes, but -2.614279788610316e-08 is less than 0, so you cannot contourf() the 0 level
You might be interested in using
surf(U, Xi, taumin); view(3)
University
University el 11 de Oct. de 2023
Thank you for assisant @Walter. I have tried using the surf function as suggested but I don't see how the surf plot will help us virtualize the data better. I don't know why you suggested the surf plot anyways...
N=[0:0.1:1];
map = [0.95*(1-N') 0.95*(1-N') N'];
fig = openfig('cont1.fig');
fig.Visible = true;
ax = fig.Children(2);
C = ax.Children;
X = C.XData;
Y = C.YData;
Z = C.ZData;
figure();
surf(X, Y, Z); view(3)
colormap(map); colorbar;
That gives me a much better understanding of the data than the contour plot does. The contour plot gives no feeling for the sharp trenches.
University
University el 11 de Oct. de 2023
Okay, thank you so much for your help. I get what you mean.

Iniciar sesión para comentar.

Más respuestas (1)

Torsten
Torsten el 9 de Oct. de 2023

0 votos

You want to plot imag(taumin(U,xi)) = 0.
Thus use fimplicit:

3 comentarios

University
University el 9 de Oct. de 2023
Hi Torsten,
Thank you for your response. I have checked the link above but it seems the example posted in the link is when dealing with a function. In case, my taumin is 61 by 61 matrix not a function.
Torsten
Torsten el 10 de Oct. de 2023
Editada: Torsten el 10 de Oct. de 2023
But in principle, you can compute "taumin" given U and xi ? This would define a function.
Maybe this method is easier to implement:
University
University el 10 de Oct. de 2023
Okay Torsten. Thank you for your repsonse. I will try it.

Iniciar sesión para comentar.

Categorías

Más información sobre Contour Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2023a

Preguntada:

el 9 de Oct. de 2023

Comentada:

el 11 de Oct. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by