|
|
Moving columns below other columns, in a matrix
Hi everyone!
Say I have a 6x6 matrix - what is the easiest way of moving the rightmost 3 columns below the leftmost 3 columns, such that the matrix becomes 12x3?
Thanks for any help!
|
|
0
|
|
|
|
Reply
|
Catalin
|
5/5/2010 10:51:06 PM |
|
On May 5, 3:51=A0pm, "Catalin Eberhardt" <longtal...@gmail.com> wrote:
> Hi everyone!
>
> Say I have a 6x6 matrix - what is the easiest way of moving the rightmost=
3 columns below the leftmost 3 columns, such that the matrix becomes 12x3?
>
> Thanks for any help!
A =3D magic(6);
B =3D [A(:,1:3);A(:,4:6)]
or:
B =3D [reshape(A(:,1:3:end),[],1) reshape(A(:,2:3:end),[],1) reshape(A(:,
3:3:end),[],1)]
-Nathan
|
|
0
|
|
|
|
Reply
|
Nathan
|
5/5/2010 11:09:04 PM
|
|
Catalin Eberhardt wrote:
> Say I have a 6x6 matrix - what is the easiest way of moving the
> rightmost 3 columns below the leftmost 3 columns, such that the matrix
> becomes 12x3?
Easiest:
[C(:,1:3);C(:,4:6)];
More generally:
[C(:,1:end/2);C(:,end/2+1:end)]
|
|
0
|
|
|
|
Reply
|
Walter
|
5/5/2010 11:12:05 PM
|
|
Thanks a lot!!
|
|
0
|
|
|
|
Reply
|
Catalin
|
5/5/2010 11:17:04 PM
|
|
|
3 Replies
551 Views
(page loaded in 0.064 seconds)
Similiar Articles: Moving columns below other columns, in a matrix - comp.soft-sys ...Hi everyone! Say I have a 6x6 matrix - what is the easiest way of moving the rightmost 3 columns below the leftmost 3 columns, such that the matri... Copy Rows from One Matrix to Another - comp.soft-sys.matlab ...The second matrix has 6 columns and 81 rows and also has a column for the hour and ... Moving columns below other columns, in a matrix - comp.soft-sys ... Copy Rows from ... Creating copy of columns in Matrix - comp.soft-sys.matlab ...Moving columns below other columns, in a matrix - comp.soft-sys ... Creating ... Matrix into Blob Column - comp.soft-sys.matlab Creating copy of columns in Matrix - comp.soft ... Merge columns in a matrix - comp.soft-sys.matlabI want to combine 300 columns into one matrix. The dimension of each column is 24x1. ... Moving columns below other columns, in a matrix - comp.soft-sys ... merging ... Average Every N rows in a Matrix - comp.soft-sys.matlabWe hash every row/column > of the matrix, then sort the hashed values ... Moving columns below other columns, in a matrix - comp.soft-sys ... Define a matrix A with n rows ... subtracting lines of column data - comp.lang.awkMoving columns below other columns, in a matrix - comp.soft-sys ... subtracting lines of column data - comp.lang.awk Moving columns below other columns, in a matrix - comp ... Multiply each column vector with another column vector - comp.soft ...Moving columns below other columns, in a matrix - comp.soft-sys ..... that sum evenly over the first 20 rows and have the next 28 0's for each column ... Moving data ... creating diagonal matrix - comp.soft-sys.matlabMoving columns below other columns, in a matrix - comp.soft-sys ... creating diagonal matrix - comp.soft-sys.matlab Moving columns below other columns, in a matrix - comp ... Creating matrix of 1's and 0's based on a comparison of values in ...... 0 C is generated by 'asking' for every number in a column of ... Moving columns below other columns, in a matrix - comp.soft-sys ... Creating copy of columns ... moving in 3D - comp.lang.c++Moving columns below other columns, in a matrix - comp.soft-sys ... Say I have a 6x6 matrix - what is the easiest way of moving the rightmost 3 columns ... Moving columns below other columns, in a matrix - comp.soft-sys ...Hi everyone! Say I have a 6x6 matrix - what is the easiest way of moving the rightmost 3 columns below the leftmost 3 columns, such that the matri... Move rows or columns - Excel - Office.comMove or copy rows and columns When you move or ... column or row headings of other rows or columns ... Select a row or column below or to the right of where you want to move or ... 7/24/2012 8:43:01 AM
|
|
|
|
|
|
|
|
|