Writing exponent in pplane for Matlab

3 vues (au cours des 30 derniers jours)
Holli Sharples
Holli Sharples le 8 Nov 2021
I'm trying to use the pplane code to generate a phase portrait for
dn/dt=n^(2/3)*(1n)en
but the graph will not acknowledge 2/3 as a full exponent.I keep getting things that look like this when I type n^(2/3):
Or when I type n^2/3 it'll make a graph using (n^2)/3.
How can I fix this? Or rewrite the equation in pplane to graph the correct form of the equation?
Thank you

Réponses (1)

John D'Errico
John D'Errico le 8 Nov 2021
Modifié(e) : John D'Errico le 9 Nov 2021
pplane is not part of MATLAB, so it must be a package from the file exchange, or some other source. You might want to contact the author with questions.
You raise a number to a fractional power like this:
n^(2/3)
Why? Exponentiation has a higher order of precedence than division. So when you wrote n^2/3, MATLAB sees n^2, and recgnizes that exponentation comes first in the list. So it squares n, and THEN divides the result by 3.
Since you want MATLAB to raise it to the (2/3) power, just use parens as I show.
  1 commentaire
Holli Sharples
Holli Sharples le 9 Nov 2021
yes, unfortunately I did try that the first time and gave me this for the graph:
It only put the first paranthesis in the exponent position and left the rest as scalars.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by