Writing exponent in pplane for Matlab

3 views (last 30 days)
Holli Sharples
Holli Sharples on 8 Nov 2021
Edited: John D'Errico on 9 Nov 2021
I'm trying to use the pplane code to generate a phase portrait for
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

Answers (1)

John D'Errico
John D'Errico on 8 Nov 2021
Edited: John D'Errico on 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:
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 Comment
Holli Sharples
Holli Sharples on 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.

Sign in to comment.




Community Treasure Hunt

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

Start Hunting!

Translated by