plot(x,y(1,:) meaning
Show older comments
Hi,
I'm new matlab. I was wondering what the y(1,:) means?
I have ran this code: plot(x,y(1,:),'r-o',x,y(2,:),'g*','LineWidth',2) and can't make sense of the 1 and 2 in regards to the y coordinate.
Thanks
3 Comments
Star Strider
on 25 Oct 2019
@Chole — Deleting the text of your Question is quite definitely NOT COOL!
Stephen23
on 26 Oct 2019
I'm new matlab. I was wondering what the y(1,:) means?
I have ran this code: plot(x,y(1,:),'r-o',x,y(2,:),'g*','LineWidth',2) and can't make sense of the 1 and 2 in regards to the y coordinate.
Thanks
Rena Berman
on 28 Oct 2019
(Answers Dev) Restored edit
Answers (1)
Star Strider
on 5 Oct 2019
Edited: Star Strider
on 5 Oct 2019
EDIT —
To illustrate:
y = [1 2 3 4 5; 6 7 8 9 10]
FirstRow = y(1,:)
SecondRow = y(2,:)
produces:
y =
1 2 3 4 5
6 7 8 9 10
FirstRow =
1 2 3 4 5
SecondRow =
6 7 8 9 10
Categories
Find more on Graphics Object Properties 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!