intrlv
Reorder sequence of symbols
Description
Examples
Use the intrlv
function to rearrange the elements of a vector to a random permutation vector determined by the randperm
function. Use the deintrlv
function to restore the element order of the initial vector by reusing the same random permutation vectorThis illustrates the inverse relationship between the intrlv
and deintrlv
functions.
Generate an input signal, data
, and a permutation vector, elements
.
data = 10:10:100
data = 1×10
10 20 30 40 50 60 70 80 90 100
elements = randperm(10) % Permutation vector
elements = 1×10
6 3 7 8 5 1 2 4 9 10
Permute the input signal according to the permutation vector by using the intrlv
function and the restore the input signal order by using the deintrlv
function.
a = intrlv(data,elements)
a = 1×10
60 30 70 80 50 10 20 40 90 100
b = deintrlv(a,elements)
b = 1×10
10 20 30 40 50 60 70 80 90 100
Use the intrlv
function to rearrange the elements in the columns of a matrix to a random permutation vector determined by the randperm
function. Use the deintrlv
function to restore the element order of the initial matrix by reusing the same random permutation vector. This illustrates the inverse relationship between the intrlv
and deintrlv
functions.
Generate an input signal, data
, and a permutation vector, elements
.
data(:,1) = 10:10:100
data = 10×1
10
20
30
40
50
60
70
80
90
100
data(:,2) = 0.1:0.1:1
data = 10×2
10.0000 0.1000
20.0000 0.2000
30.0000 0.3000
40.0000 0.4000
50.0000 0.5000
60.0000 0.6000
70.0000 0.7000
80.0000 0.8000
90.0000 0.9000
100.0000 1.0000
elements = randperm(10) % Permutation vector
elements = 1×10
6 3 7 8 5 1 2 4 9 10
Permute the input signal according to the permutation vector by using the intrlv
function, and then restore the input signal order by using the deintrlv
function.
a = intrlv(data,elements)
a = 10×2
60.0000 0.6000
30.0000 0.3000
70.0000 0.7000
80.0000 0.8000
50.0000 0.5000
10.0000 0.1000
20.0000 0.2000
40.0000 0.4000
90.0000 0.9000
100.0000 1.0000
b = deintrlv(a,elements)
b = 10×2
10.0000 0.1000
20.0000 0.2000
30.0000 0.3000
40.0000 0.4000
50.0000 0.5000
60.0000 0.6000
70.0000 0.7000
80.0000 0.8000
90.0000 0.9000
100.0000 1.0000
Input Arguments
Input signal, specified as a vector or matrix. If
data
is a matrix with multiple rows and columns,
the function processes the columns independently.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| fi
Complex Number Support: Yes
Permutation vector, specified as an integer vector. The permutation vector
specifies the mapping used to permute the input signal,
data
. The permutation vector length must equal the
input signal length and contain for each integer k in the
range [1 length
(data
,1)]. If
data
is a length-N vector or an
N-row matrix, elements
must be a
length-N vector and contain each integer in the range
[1 length
(data
,1)]. The sequence in
elements
is the sequence in which elements from
data
or its columns appear in
intrlved
.
Data Types: double
Output Arguments
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)