<< gfcosets FOSSEE_Communication_Systems_Toolbox gfrepcov >>

FOSSEE_Communication_Systems_Toolbox >> FOSSEE_Communication_Systems_Toolbox > gflineq

gflineq

This function finds a solution for linear equation Ax = b over a prime Galois field.

Description

[X, SFLAG] = GFLINEQ(A, B) returns a particular solution (X) of AX=B in GF(2). If the equation has no solution, then X is empty and SFLAG = 0 else SFLAG = 1.

[X, SFLAG]= GFLINEQ(A, B, P) returns a particular solution of the linear equation A X = B in GF(P) and SFLAG=1. If the equation has no solution, then X is empty and SFLAG = 0.

Examples

A=[1 0 1; 1 1 0; 1 1 1]
p=3
[x,vld] = gflineq(A,[1;0;1],p)
disp(A,'A=')
disp(x,'x=');
if(vld)
disp('Linear equation has solution x')
else
disp('Linear equation has no solution and x is empty')
end
disp( pmodulo(A*x,p),'B =')

Authors


Report an issue
<< gfcosets FOSSEE_Communication_Systems_Toolbox gfrepcov >>