Contenido principal

matintrlv

R2026b

Reorder symbols filling matrix by rows and emptying it by columns

Description

intrlvd = matintrlv(data,Nrows,Ncols) rearranges the elements in data by filling a temporary Nrows-by-Ncols matrix with the elements row by row and then sending the matrix contents, column by column, to the output.

example

Examples

collapse all

Use the matintrlv function to reorder the elements filling a matrix by rows and emptying it by columns.

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].

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

     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 3-by-2 matrix [1 2; 3 4; 5 6]. Then the function reads down each column of the temporary matrix to get [1 3 5 2 4 6].

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

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

Input Arguments

collapse all

Input signal to be interleaved, specified as a vector or 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. The function processes the columns independently.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32
Complex Number Support: Yes

Number of rows in the temporary matrix, specified as a positive integer.

Number of columns in the temporary matrix, specified as a positive integer.

Output Arguments

collapse all

Interleaved data, returned with the same dimensions and data type as the input data.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced before R2006a