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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -