Created
May 8, 2016 22:03
-
-
Save agaikwad123/695a380789ad6b6b9ce67300cbcfc8c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clc; | |
clear all; | |
close all; | |
k=input(enter the input elements:); | |
n=input(enter the input elements:); | |
I=eye(k) | |
p=input(enter the parity matrix:); | |
for i=1:k; | |
for j=1:n-k; | |
p(i,j)=input(enter the coefficients); | |
end | |
end | |
G=cat(2,I,p) | |
m=0:(2^k)-1 | |
M=dec2bin(m,k) | |
C=M*G | |
Codeword=rem(C,2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment