Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: creating actual eye(N)
Replies: 4   Last Post: Mar 28, 2013 10:41 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Tursa

Posts: 2,096
Registered: 8/5/09
Re: creating actual eye(N)
Posted: Mar 27, 2013 11:41 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Iman Behmanesh" wrote in message <kj0b8m$gsi$1@newscl01ah.mathworks.com>...
> I have a matrix, matrix A, and want to optimize some of its components. The residuals are each index (A-I) where I is an identity matrix. matrix A's components are 1 at the diagonals and 0 at non-diagonal elements. for example A^30 or A^-30 is still have 1 at the diagonals and 0 at non-diagonals. However when I subtract A from I, the results is not all zeros as I expect it to be! they are around 10^-15 to 10^-16. I can't use int16(eye(N)) because I can't subtract it later from A. Does anyone know how I can creat an Identity matrix that has zero/1 elements up to the power of -30?!

Can you post an explicit example? Not really sure what you are asking. It sounds like simple floating point arithmetic errors from your description.

James Tursa



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.