Determinant of integer matrices
조회 수: 1 (최근 30일)
이전 댓글 표시
Is there a version of the det function in R2020a that alway gives determinant 0 for small singular integer matrices?
댓글 수: 4
Matt J
2021년 4월 23일
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.
답변 (2개)
Matt J
2021년 4월 23일
편집: Matt J
2021년 4월 23일
Since you know A is an integer matrix, can't you just do,
d=round(det(A));
댓글 수: 3
John D'Errico
2021년 4월 23일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!