Find invertible matrix pairs where both matrices are integers
Ältere Kommentare anzeigen
Hello!
I think the summary says it all! Looking for 3x3, but assume that's not critical.
Have found solution for matrix pair where one is integer, but other is not.
Thanks!
Doug Anderson
3 Kommentare
James Tursa
am 7 Jan. 2022
Bearbeitet: James Tursa
am 7 Jan. 2022
Do you mean matrices where both the matrix and its inverse contain only integer elements? What do you mean by "matrix pair"? Can you give an example? Do you mean something like the case where the determinant is 1 so that the cofactors will give you integer elements for the inverse if the original matrix has only integer elements?
James Tursa
am 7 Jan. 2022
Bearbeitet: James Tursa
am 7 Jan. 2022
The cofactors comment was just by way of understanding the problem ... not a suggested method to use. If you have a matrix M with all integer elements and you know the determinant is 1, then you could probably just use round(inv(M)) as a first cut as long as the sizes of the integers are not too big. Do you already have a method for generating the original matrix of integer elements with determinant 1, or are you asking for that as well?
What is this for? I.e., what is the actual problem you are working on?
Douglas Anderson
am 7 Jan. 2022
Akzeptierte Antwort
Weitere Antworten (1)
syms v
M = [1 2 3; 4 5 7; 8 9 v]
sol = solve(det(M) == 1)
newM = subs(M, v, sol(1))
inv(newM)
1 Kommentar
Douglas Anderson
am 7 Jan. 2022
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


