Plotting an implicit function?

3 vues (au cours des 30 derniers jours)
J
J le 21 Déc 2014
Commenté : J le 22 Déc 2014
I have the following equation:
F(x,y) = sqrt( (x^2 * y)^-0.2))
where x and y are positive.
The general shape should look like this:
and I was wondering how I would go about plotting that in matlab, after my unsuccessful attempts with ezplot.
  1 commentaire
Matt J
Matt J le 21 Déc 2014
Modifié(e) : Matt J le 21 Déc 2014
Your equation has a typo in it making it unreadable (a missing exponent after the ^)

Connectez-vous pour commenter.

Réponses (1)

Matt J
Matt J le 21 Déc 2014
Modifié(e) : Matt J le 21 Déc 2014
You could use ezplot, e.g.,
>> F=@(x,y) sqrt((x.^2.*y)-0.2)
>> ezplot(F,[0,2]); shg
  8 commentaires
John D'Errico
John D'Errico le 21 Déc 2014
Modifié(e) : John D'Errico le 21 Déc 2014
Therein lies the problem with the internet. Some random person can post a web site that makes any claim they want. You need to think about what you see and decide if it makes sense, or it is simply a pusher of mental pablum. This is true in general, and of course true in mathematics.
An implicit function only makes sense IF there is an equality in there. Otherwise, you have nothing. So what is F(x,y) equal to? Perhaps 1? 0? pi? 17? Ah! Yes it must be 42.
My point is, you will generally see different curves, depending on the value of that unspecified right hand side. Lacking anything else provided by you, MATLAB makes the perfectly reasonable assumption that it must be zero, and that any necessary constant was built into the function F as provided by you. Any other assumption would simply be wrong.
Since you seem confused, I'll offer a web site ( wikipedia ) that explains what is an implicit function. Of course, then you need to read and decide if what you see is true. I might make note of the form it shows, with an equality and a right hand side of zero. I'm not saying that Wikipedia is perfect of course, hey it could be a lie.
J
J le 22 Déc 2014
Ha, thanks. Yeah, I'm not quite with this here.
I think there's probably some pre-plotting problem, post-reading this. Essentially, I know -- like, reputable-text-print-out know -- what the solution is meant to look like and which points through which it's meant to pass. My task was to plot (along with a heap of other stuff) this function, F, after constructing F in some plottable form. The only reason I thought this would be good to plot, (ezplot-it, no-brains stuff) is because a. I'm an idiot and b. this site (kevinmehall.net/p/equationexplorer) nails it. Like, gets the solutions I'm looking for. Which is this:
https://i.imgur.com/RpE6vsE.png
(I'm only interested in the blue-red divide here. That swooping curve, tending towards infinity.)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by