Determinant of integer matrices
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Is there a version of the det function in R2020a that alway gives determinant 0 for small singular integer matrices?
4 comentarios
Matt J
el 23 de Abr. de 2021
And it should work without prior knowledge whether the entries are integer or not. Probably asking too much...
No, one of hte answers below meets that requirement.
Respuestas (2)
Matt J
el 23 de Abr. de 2021
Editada: Matt J
el 23 de Abr. de 2021
Since you know A is an integer matrix, can't you just do,
d=round(det(A));
3 comentarios
Matt J
el 23 de Abr. de 2021
OK. Well, maybe the A(i,j) are supposed to be "small" in mangitude as well...
John D'Errico
el 23 de Abr. de 2021
A = randi(3,29,30);
A(end+1,:) = round(rand(1,29)*2-1)*A
rank(A)
det(A)
round(det(A))
Ok, I guess it works, some of the time. But not this one.
If the matrix is truly tiny, well yes.
A = magic(4)
rank(A)
det(A)
round(det(A))
But you really cannot trust that rounding the determinant will work unless things are truly tiny.
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!