Quick Question Regarding Vectors!!
4 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Honglei Chen
on 28 Jul 2014
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 Comments
Honglei Chen
on 28 Jul 2014
colon means taking all elements in that dimension. You can also use it to specify a range, like x(1:10,1)
More Answers (0)
See Also
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!