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 Kommentare

Star Strider
Star Strider am 25 Okt. 2019
@Chole — Deleting the text of your Question is quite definitely NOT COOL!
Stephen23
Stephen23 am 26 Okt. 2019
Original question (from Google Cache):
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
Rena Berman am 28 Okt. 2019
(Answers Dev) Restored edit

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 5 Okt. 2019
Bearbeitet: Star Strider am 5 Okt. 2019

0 Stimmen

It means the first row of the ‘y’ matrix. See Matrix Indexing for details.
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

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 5 Okt. 2019

Kommentiert:

am 28 Okt. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by