Matlab, How to get each column in a matrix -
i got 4-by-n matrix, like
a =
1 5 9 3 0 6 2 3 10 7 8 4
what want getting each half column of as
line1point1 = [1 3]
line1point2 = [2 7]
line2point1 = [5 0]
line2point2 = [3 8]
line3point1 = [9 6]
line3point2 = [10 4]
how that? i’m pretty new matlab coding.. appreciated..
cheers
use reshape function, example:
>> = [1 5 9; 3 0 6; 2 3 10; 7 8 4]; >> reshape(a,2,6) ans = 1 2 5 3 9 10 3 7 0 8 6 4
Comments
Post a Comment