OutputPort1=InputPort1;

n=15; %codeword length
k=5; %msg length
m=5; %symbol rate

%received binary msg to decimal
b=2.^(3:-1:0);
y=reshape(InputPort1.Sequence,4,15);
receivedmsg=b*y;

receivedmsg=receivedmsg(:); %received msg as column vector

%decoding
h=comm.RSDecoder(n,k);
decode=step(h,receivedmsg);
final=reshape(code,1,5);

%converting back to binary
c=de2bi(final,'left-msb');
c=c';
msg=reshape(c,1,20);

OutputPort1.Sequence=msg;