This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Reorder symbols by filling matrix by rows and emptying it by columns


intrlvd = matintrlv(data,Nrows,Ncols)


intrlvd = matintrlv(data,Nrows,Ncols) rearranges the elements in data by filling a temporary matrix with the elements row by row and then sending the matrix contents, column by column, to the output. Nrows and Ncols are the dimensions of the temporary matrix. If data is a vector, it must have Nrows*Ncols elements. If data is a matrix with multiple rows and columns, data must have Nrows*Ncols rows and the function processes the columns independently.


The command below rearranges each of two columns of a matrix.

b = matintrlv([1 2 3 4 5 6; 2 4 6 8 10 12]',2,3)
b =

     1     2
     4     8
     2     4
     5    10
     3     6
     6    12

To form the first column of the output, the function creates the temporary 2-by-3 matrix [1 2 3; 4 5 6]. Then the function reads down each column of the temporary matrix to get [1 4 2 5 3 6].

Introduced before R2006a

Was this topic helpful?