why r= stem(5/2) = 174.0181 ?

Hello, See the next line
r= stem(5/2); r= 174.0181
Note: The value of 'r' changes slightly ( & randomly), over time. Question: Yes, it shows the plot correctly (i.e. stem of 5/2), but I wonder why the value of 'r' is such? I will appreciate your time answering this!
Regards

 Accepted Answer

The result of
r = stem(5/2);
is a plot handle. If you want to understand what it actually is, type:
get(r)
and see what it returns.

3 Comments

Note: the return from stem() and other graphics routines changed a lot in R2014b
Upon this, get(r) tells 'Invalid handle object'.
In R2017a this:
r = stem(5/2)
returns:
r =
Stem with properties:
Color: [0.0000e+000 447.0000e-003 741.0000e-003]
LineStyle: '-'
LineWidth: 500.0000e-003
Marker: 'o'
MarkerSize: 6.0000e+000
MarkerFaceColor: 'none'
BaseValue: 0.0000e+000
XData: 1.0000e+000
YData: 2.5000e+000
Show all properties
Using ‘get(r)’ would have returned all the properties.
I no longer have access to R2014a and earlier versions, so I cannot explore that.
In my experience, the get function with the correct argument has always returned the properties of the object that created it.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!