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: Matrix operations associativity?
Replies: 3   Last Post: Nov 11, 2013 6:00 PM

Advanced Search

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

Posts: 1
Registered: 11/11/13
Matrix operations associativity?
Posted: Nov 11, 2013 4:22 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I am currently banging my head on the following problem: I want to split a matrix A in two components A+ and A-.

I define A- as A- = A - A+ and obtain the following disturbing result:

Aminus = A-Aplus;
nnz(Aplus-A+Aminus)
ans = 0

nnz(Aminus-A+Aplus)
ans = 1257

Thinking that it may arise from some parenthesation issue, I tried the following.

nnz((Aminus-A)+Aplus)
ans = 1257

nnz((Aminus-(A-Aplus)))
ans = 0

Could someone please explain me what's going on?

Thanks a lot!



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.