I am working with Galois field. I obtained all the 256 values, and now i want to make the matrix form of the obtained values.
5 次查看(过去 30 天)
显示 更早的评论
clear all;
close all;
clc;
m = 8;
p = 2;
prim_poly = p^8+p^6+p^5+p^1+p^0;
a = gf(35, m, prim_poly);
b = gf(15, m, prim_poly);
c = gf(0, m, prim_poly);
d = gf(5, m, prim_poly);
x_gf = gf([a b; c d] , m , prim_poly);
determinant = det(gf(x_gf, m, prim_poly));
% Check singularity
if determinant == 0
disp('The linear fractional transformation is singular.');
else
disp('The linear fractional transformation is not singular.');
end
%s = zeros(1,256);
for x_gf = 0:255
e = conv(a, x_gf);
f = conv(c, x_gf);
h = e + b;
j = f + d;
i = gf(1./j, m, prim_poly);
results = gf(conv(h, i),m, prim_poly)
end
0 个评论
回答(2 个)
Fangjun Jiang
2023-8-30
results = zeros(1,256);
for x_gf = 0:255
e = conv(a, x_gf);
f = conv(c, x_gf);
h = e + b;
j = f + d;
i = gf(1./j, m, prim_poly);
results(x_gf+1) = gf(conv(h, i),m, prim_poly)
end
1 个评论
Voss
2023-8-30
clear all;
close all;
clc;
m = 8;
p = 2;
prim_poly = p^8+p^6+p^5+p^1+p^0;
a = gf(35, m, prim_poly);
b = gf(15, m, prim_poly);
c = gf(0, m, prim_poly);
d = gf(5, m, prim_poly);
x_gf = gf([a b; c d] , m , prim_poly);
determinant = det(gf(x_gf, m, prim_poly));
% Check singularity
if determinant == 0
disp('The linear fractional transformation is singular.');
else
disp('The linear fractional transformation is not singular.');
end
%s = zeros(1,256);
results = zeros(1,256);
for x_gf = 0:255
e = conv(a, x_gf);
f = conv(c, x_gf);
h = e + b;
j = f + d;
i = gf(1./j, m, prim_poly);
results(x_gf+1) = gf(conv(h, i),m, prim_poly)
end
Voss
2023-8-30
clear all;
close all;
clc;
m = 8;
p = 2;
prim_poly = p^8+p^6+p^5+p^1+p^0;
a = gf(35, m, prim_poly);
b = gf(15, m, prim_poly);
c = gf(0, m, prim_poly);
d = gf(5, m, prim_poly);
x_gf = gf([a b; c d] , m , prim_poly);
determinant = det(gf(x_gf, m, prim_poly));
% Check singularity
if determinant == 0
disp('The linear fractional transformation is singular.');
else
disp('The linear fractional transformation is not singular.');
end
%s = zeros(1,256);
results = cell(1,256);
for x_gf = 0:255
e = conv(a, x_gf);
f = conv(c, x_gf);
h = e + b;
j = f + d;
i = gf(1./j, m, prim_poly);
results{x_gf+1} = gf(conv(h, i),m, prim_poly);
end
disp(results);
results{1}
results{2}
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model References 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!