1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# # matrix.m # # (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule # n = 4 N = 20; p = 2; d = 0; while d == 0 A = round(N * rand(n,n)); B = mod(A, p); d = det(B); d = mod(d, p); d = d * B(1,1); end A det(A) B det(B)