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.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Fangjun Jiang
am 30 Aug. 2023
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 Kommentar
Voss
am 30 Aug. 2023
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
am 30 Aug. 2023
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 Kommentare
Siehe auch
Kategorien
Mehr zu Model References finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!