Writing exponent in pplane for Matlab

5 visualizzazioni (ultimi 30 giorni)
Holli Sharples
Holli Sharples il 8 Nov 2021
Modificato: John D'Errico il 9 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

Risposte (1)

John D'Errico
John D'Errico il 8 Nov 2021
Modificato: John D'Errico il 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 Commento
Holli Sharples
Holli Sharples il 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.

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by