I have a binary matrix A
(only 1
and 0
), and a vector D
in Galois field (256). The vector C
is calculated as:
C = (A^^-1)*D
where A^^-1
denotes the inverse matrix of matrix A
in GF(2)
, *
is multiply operation. The result vector C
must be in GF(256)
. I tried to do it in Matlab.
A= [ 1 0 0 1 1 0 0 0 0 0 0 0 0 0;
1 1 0 0 0 1 0 0 0 0 0 0 0 0;
1 1 1 0 0 0 1 0 0 0 0 0 0 0;
0 1 1 1 0 0 0 1 0 0 0 0 0 0;
0 0 1 1 0 0 0 0 1 0 0 0 0 0;
1 1 0 1 1 0 0 1 0 1 0 0 0 0;
1 0 1 1 0 1 0 0 1 0 1 0 0 0;
1 1 1 0 0 0 1 1 1 0 0 1 0 0;
0 1 1 1 1 1 1 0 0 0 0 0 1 0;
0 0 0 0 1 1 1 1 1 0 0 0 0 1;
0 1 1 1 1 0 1 1 1 0 1 1 1 0;
0 0 0 1 0 0 0 1 0 0 0 0 0 0;
0 0 1 0 0 0 0 1 0 0 0 0 0 0;
1 1 1 1 0 0 0 0 0 0 0 0 0 0]
D=[0;0;0;0;0;0;0;0;0;0;103;198;105;115]
A=gf(A,1);
D=gf(D,8); %%2^8=256
C=inv(A)*D
%% The corrected result must be
%%C=[103;187;125;210;181;220;161;20;175;175;187;187;220;115]
However, for above code, I cannot achieved as my expected result
C=[103;187;125;210;181;220;161;20;175;175;187;187;220;115]
It produces an error as
Error using * (line 14)
Orders must match.
Could you help me achieve my expected result?