When I'm doing row operations on matlab, and i'm trying to make a number zero, an asterisk appears. I dont know why this is.
format rat
B = [-6 8 -9 4 ;4 -3 5 7 ;-9 7 -8 -8 ;4 -3 3 3 ]
B =
-6 8 -9 4 4 -3 5 7 -9 7 -8 -8 4 -3 3 3
B(1,:) = B(1,:)/-6
B =
1 -4/3 3/2 -2/3 4 -3 5 7 -9 7 -8 -8 4 -3 3 3
B(2,:) = B(1,:)*-4 + B(2,:)
B =
1 -4/3 3/2 -2/3 0 7/3 -1 29/3 -9 7 -8 -8 4 -3 3 3
B(3,:) = B(1,:)*9 + B(3,:)
B =
1 -4/3 3/2 -2/3 0 7/3 -1 29/3 0 -5 11/2 -14 4 -3 3 3
B(4,:) = B(1,:)*-4 + B(4,:)
B =
1 -4/3 3/2 -2/3 0 7/3 -1 29/3 0 -5 11/2 -14 0 7/3 -3 17/3
B(2,:) = B(2,:)*(3/7)
B =
1 -4/3 3/2 -2/3 0 1 -3/7 29/7 0 -5 11/2 -14 0 7/3 -3 17/3
B(1,:) = B(2,:)*(4/3) + B(1,:)
B =
1 * 13/14 34/7 0 1 -3/7 29/7 0 -5 11/2 -14 0 7/3 -3 17/3

 채택된 답변

Matt J
Matt J 2022년 10월 22일
편집: Matt J 2022년 10월 22일
Presumably, it's just a display choice to keep things readable. The number there does exist, but they don't want to give you the mistaken impression that it is exactly zero:
B(1,:)
ans =
1 * 13/14 34/7
B(1,2)
ans =
-1/4503599627370496

댓글 수: 1

Steven Lord
Steven Lord 2022년 10월 22일
Matt J is correct. From the documentation for the rats function (which uses the same algorithm as format rat): "Asterisks indicate elements that cannot be printed in the allotted space, but which are not negligible compared to the other elements in X."

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2022년 10월 22일

댓글:

2022년 10월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by