gen2par
Convert between parity-check and generator matrices
Syntax
Description
Examples
Convert the parity-check matrix for a Hamming code into the corresponding generator matrix and back again.
Create the parity-check matrix.
parmat = hammgen(3)
parmat = 3×7
1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1
Convert the parity-check matrix into the corresponding generator matrix.
genmat = gen2par(parmat)
genmat = 4×7
1 1 0 1 0 0 0
0 1 1 0 1 0 0
1 1 1 0 0 1 0
1 0 1 0 0 0 1
Convert the generator matrix back again. The output, parmat2, should be the same as the original matrix, parmat.
parmat2 = gen2par(genmat)
parmat2 = 3×7
1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1
Input Arguments
Generator matrix, specified as a k-by-n matrix of binary values. The standard form of a generator matrix for a [n,k] binary linear block code is [Ik P] or [P Ik], where Ik is the identity matrix of size k.
Data Types: single | double
Parity-check matrix, specified as a (n-k)-by-n matrix of binary values. The standard form of a parity-check matrix for a [n,k] binary linear block code is [-P' In-k] or [In-k -P'], where In-k is the identity matrix of size (n-k).
Data Types: single | double
Output Arguments
Parity-check matrix, returned as a
(n-k)-by-n matrix of binary
values corresponding to the generator matrix G. The standard form
of a parity-check matrix for a [n,k] binary linear
block code is [P ' In-k] or
[In-k -P '], where
In-k is the identity matrix of size
(n-k)
Data Types: single | double
Generator matrix, returned as a k-by-n matrix
of binary values corresponding to the parity-check matrix H. The
standard form of a generator matrix for a [n,k]
binary linear block code is [Ik
P] or [P
Ik], where
Ik is the identity matrix of size
k.
Data Types: single | double
More About
Generator matrices and parity-check matrices are parameters that are required in order to process [n,k] generic linear block codes. For more information, see Configure Parameters for Linear Block Codes.
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)