How to plot contour?

2 vues (au cours des 30 derniers jours)
Xu
Xu le 14 Juin 2012
Have 3 random variables, but need to plot in two dimensions.
Here is the function.
f=1+2*r1*cos(omega)+2*r2*cos(2*omega).
X axis: r1 [-1,1]
Y axis: r2 [-1,1]
Plot the contour which makes f>=0 for all omegas. In other words, plot the contour which makes the minimum value of f is 0.
Apparently, (-0.5,0), (0.5,0), (0,0.5), (0,-0.5) are four points on the contour.
Thanks in advance.
  3 commentaires
Xu
Xu le 15 Juin 2012
Yes, you are absolutely right. That's what I asked. I said "plot in two dimensions r1 for x axis and r2 for y axis".
I need to find (r1, r2) which can make fmin=0;
For example, for (r1, r2)=(0.5, 0), f=1+cos(omega), fmin=0 obviously.
Walter Roberson
Walter Roberson le 15 Juin 2012
hints:
ndgrid()
bsxfun()
all()
contour()

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by