The fix(x) command does not work
Show older comments
Why does the one not become a one when i fix it. I have tried everything but cant get it to work!
A=[4 2 3 1; 2 5 6 2; 0 0 1 3; -1 -2 9 8]
B=inv(A);
C=A*B;
C = fix(C)
D=B*A;
D = fix(D)
C==D

1 Comment
John D'Errico
on 29 Nov 2020
Please don't post a PICTURE of code. That makes it impossible for people to copy what you did, and then use it as an example to help you. Is there a good reason why you WANT to make it more difficult for someone to help you???????
Accepted Answer
More Answers (1)
Just because a number is displayed as 1 in the default display format does not mean that the stored value is exactly 1. It's close but not exactly equal to 1. It's ever so slightly less than 1.
A=[4 2 3 1; 2 5 6 2; 0 0 1 3; -1 -2 9 8];
B=inv(A);
C=A*B;
1 - C(2, 2)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!