Having problems understanding the command y( size(t) ) in a plot.
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?
Answers (2)
Walter Roberson
on 15 Dec 2011
1 vote
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])
bym
on 15 Dec 2011
0 votes
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...
Categories
Find more on Valentines Day 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!