Restore ordering of symbols by filling matrix by columns and emptying it by rows
deintrlvd = matdeintrlv(data,Nrows,Ncols)
deintrlvd = matdeintrlv(data,Nrows,Ncols) rearranges
the elements in
data by filling a temporary matrix
with the elements column by column and then sending the matrix contents,
row by row, to the output.
the dimensions of the temporary matrix. If
a vector, it must have
Nrows*Ncols elements. If
a matrix with multiple rows and columns,
Nrows*Ncols rows and the function processes
the columns independently.
To use this function as an inverse of the
use the same
in both functions. In that case, the two functions are inverses in
the sense that applying
matintrlv followed by
The code below illustrates the inverse relationship between
Nrows = 2; Ncols = 3; data = [1 2 3 4 5 6; 2 4 6 8 10 12]'; a = matintrlv(data,Nrows,Ncols); % Interleave. b = matdeintrlv(a,Nrows,Ncols) % Deinterleave.
The output below shows that
b is the same
b = 1 2 2 4 3 6 4 8 5 10 6 12