Restore ordering of symbols in helical pattern
deintrlvd = helscandeintrlv(data,Nrows,Ncols,hstep)
rearranges the elements in
data by filling a temporary matrix with
the elements in a helical fashion and then sending the matrix contents to the output row
Ncols are the dimensions of the
hstep is the slope of the diagonal, that is, the
amount by which the row index increases as the column index increases by one.
hstep must be a nonnegative integer less than
Helical fashion means that the function places input elements along diagonals of the
temporary matrix. The number of elements in each diagonal is exactly
Ncols, after the function wraps past the edges of the matrix when
necessary. The function traverses diagonals so that the row index and column index both
increase. Each diagonal after the first one begins one row below the first element of
the previous diagonal.
data is a vector, it must have
data is a matrix with multiple rows and columns,
data must have
Nrows*Ncols rows and the
function processes the columns independently.
To use this function as an inverse of the
helscanintrlv function, use the same
hstep inputs in both functions. In
that case, the two functions are inverses in the sense that applying
helscanintrlv followed by
leaves data unchanged.
Apply Helical Deinterleaving to Integer Row Vector
Apply helical scan deinterleaving to the vector [1:12], rearranging the vector using a 3-by-4 temporary matrix and diagonals of slope 1.
helscandeintrlv function creates the 3-by-4 temporary matrix using length-four diagonals. As represented here.
[1 10 7 4; 5 2 11 8; 9 6 3 12]
ans = 3×4 1 10 7 4 5 2 11 8 9 6 3 12
The function then sends the elements, row by row, to the output
d = helscandeintrlv(1:12,3,4,1)
d = 1×12 1 10 7 4 5 2 11 8 9 6 3 12
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced before R2006a