I have a output matrix (3,63) of a encoder BCH but this matrix is a Galois Field and i need convert this Galois field in a matrix binary, because matlab treats the elements the Galois field as string and i need treats this values as binary numbers.
---------------------------------------------------------------------------
ENCODE
----------------------------------------------------------------------------
M = 6; %
n = 2^M-1; % Codeword length
k=36; % Message length
rows2=3;
msg=reshape(matrix2,[rows2,k]);
gfmsg=gf(msg);
[genploy,t]=bchgenpoly(n,k);
code=bchenc(gfmsg,n,k);
noisycode = code + randerr(rows2,n,1:t);
I need to compare the columns of code with 000,010,... with a switch case or with an if but the rows of code matrix are in Galois field format The code that i have problem is the follow an the matlab error is SWITCH expression must be a scalar or a character vector.
for i=1:63
test =code(1:3,i)
switch test
case 000
symbol=R(1:500,1);
case 100
symbol=R(1:500,2);
case 010
symbol=R(1:500,3);
case 110
symbol=R(1:500,4);
case 001
symbol=R(1:500,5);
case 101
symbol=R(1:500,6);
case 011
symbol=R(1:500,7);
case 111
symbol=R(1:500,8);
end
symbol=(symboltx(:,i))
end