Quick Question Regarding Vectors!!

So i was just wondering if i had a x value that consisted of 2 columns of numbers such as
x=
1 2
1 2
1 2
1 2
is there any way that i can split this x into two values so that i can plot the 1's on one graph and the 2's on another? This is a simplified version of what i am trying to do in my attached picture.

 採用された回答

Honglei Chen
Honglei Chen 2014 年 7 月 28 日

0 投票

You can do as following, did you try this and it didn't serve your needs?
figure; plot(x(:,1));
figure; plot(x(:,2));

2 件のコメント

David
David 2014 年 7 月 28 日
wow how did i not think of that?! Thanks! and by the way what does the colon represent? Just trying to understand
Honglei Chen
Honglei Chen 2014 年 7 月 28 日
colon means taking all elements in that dimension. You can also use it to specify a range, like x(1:10,1)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

タグ

質問済み:

2014 年 7 月 28 日

コメント済み:

2014 年 7 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by