Skip to Main Content Skip to Search
Home |   Select Country  Choose Country  |  Contact Us  |  Cart Store 
Create Account | Log In
Products & Services Solutions Academia Support User Community Company
spacer spacer spacer spacer spacer spacer

Technical Solutions

Why is the result of multiplying a matrix by its inverse different from the identity matrix returned by the EYE function in MATLAB?


Date Last Modified: Friday, June 26, 2009
Solution ID:   1-536MBF
Product:   MATLAB
Reported in Release:   No Release
Platform:   All Platforms
Operating System:   All OS
 

Subject:

Why is the result of multiplying a matrix by its inverse different from the identity matrix returned by the EYE function in MATLAB?

Problem Description:

I created a matrix and computed its inverse using the INV command. However, when I multiply them together, and compare the result to the identity matrix using the ISEQUAL function, the result is 'false' or 0. For example:
a = rand(5);
b = inv(a);
isequal(a*b,eye(5))


ans =

0

Solution:

This behavior is related to floating-point arithmetic and the way numbers are represented in a computer. For more information on this subject, see the related Solution below.

 

Related Solutions:

Please provide feedback to help us improve this Solution
Contact support
E-mail this page
Print this page