Message Boards Message Boards

0
|
2310 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Matrix subtraction not working as it should

Posted 11 months ago

All I want to do is subtract Ab and Bb and then have the result as one matrix.
Please help
I don't get why it shows both matrices on either side of a minus sign. Any ideas?

5 Replies

Try removing the postfix MatrixForm wrapper.

POSTED BY: Daniel Lichtblau

Already tried that. Does not work

Posted 11 months ago

You probably didn't try it everywhere then. To be clear, when you did this,

R1R2 = R1 . R2 // MatrixForm

You assigned to R1R1 an expression with head MatrixForm. Try evaluating this:

FullForm[R1R2]

There is no built in arithmetic defined for MatrixForm. MatrixForm is just a wrapper for display purposes. The convention I use when I want to see a nice representation of a thing is to separate the definition from the display:

R1R2 = R1 . R2; R1R2 // MatrixForm

If you do this throughout your notebook, you'll get what you're looking for.

POSTED BY: Eric Rimbey

Thanks a lot. I apologize for the misunderstanding on my end

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract