Main Content


Restore ordering of symbols


deintrlvd = deintrlv(data,elements)


deintrlvd = deintrlv(data,elements) restores the original ordering of the elements of data by acting as an inverse of intrlv. If data is a length-N vector or an N-row matrix, elements is a length-N vector that permutes the integers from 1 to N. To use this function as an inverse of the intrlv function, use the same elements input in both functions. In that case, the two functions are inverses in the sense that applying intrlv followed by deintrlv leaves data unchanged.


The code below illustrates the inverse relationship between intrlv and deintrlv.

p = randperm(10); % Permutation vector
a = intrlv(10:10:100,p); % Rearrange [10 20 30 ... 100].
b = deintrlv(a,p) % Deinterleave a to restore ordering.

The output is

b =

    10    20    30    40    50    60    70    80    90   100

Extended Capabilities

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

See Also

Introduced before R2006a