Having problems understanding the command y( size(t) ) in a plot.
4 views (last 30 days)
Show older comments
The whole command is given as:
plot(x,y,’k’,xmax,y(size(t)),’o’,xmax/2,ymax,’o’)
x, y, xmax, t, and ymax are all assigned variables. However I have no idea what the size command does. Does anyone know what this does?
0 Comments
Answers (2)
Walter Roberson
on 15 Dec 2011
It is a fancy (and confusing) way to draw a vertical line at xmax that shows the range of y values. It would be clearer to use y([1 end])
0 Comments
bym
on 15 Dec 2011
it just plots xmax vs y(size(t)) as a second trace on the plot, but with the same markings as [xmax/2,ymax]...Have to see more code to figure why...
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!