Skip to content

Instantly share code, notes, and snippets.

@agaikwad123
Created May 8, 2016 22:03
Show Gist options
  • Save agaikwad123/695a380789ad6b6b9ce67300cbcfc8c9 to your computer and use it in GitHub Desktop.
Save agaikwad123/695a380789ad6b6b9ce67300cbcfc8c9 to your computer and use it in GitHub Desktop.
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