10-14-2014, 02:41 PM
Post: #1
 DrD Senior Member Posts: 1,133 Joined: Feb 2014
In CAS, adding two matrices of differing dimensions seem to get zero-filled to equalize dimensions of both(??):

CAS: [[1,2],[3,4]] + [[1,2,3], [4,5,6]] => [[2,4,3],[7,9,6]]

Home: [[1,2],[3,4]] + [[1,2,3], [4,5,6]] => Error: Invalid dimension

Why?

-Dale-
10-14-2014, 03:44 PM
Post: #2
 Tim Wessman Senior Member Posts: 2,293 Joined: Dec 2013
RE: Matrix addition: 2x2 + 2x3
The philosophy of the CAS authoer is that you should know better, and that is a helpful shortcut to those that do so (based on my understanding).

TW

Although I work for HP, the views and opinions I post here are my own.
10-14-2014, 04:00 PM
Post: #3
 DrD Senior Member Posts: 1,133 Joined: Feb 2014
RE: Matrix addition: 2x2 + 2x3
Hmm ... that sounds logical.
10-17-2014, 03:01 AM
Post: #4
 resolved Member Posts: 55 Joined: Jun 2014
RE: Matrix addition: 2x2 + 2x3
(10-14-2014 03:44 PM)Tim Wessman Wrote:  The philosophy of the CAS authoer is that you should know better, and that is a helpful shortcut to those that do so (based on my understanding).

sorry i'm missing something here?? a "helpful shortcut" to what???
10-17-2014, 06:23 AM
Post: #5
 parisse Senior Member Posts: 1,313 Joined: Dec 2013
RE: Matrix addition: 2x2 + 2x3
The design philosophy of giac is: the user knows what he does, it's important to provide features to advanced users.
If you have 2 lists of different sizes to add, you can
b/ add them by adding 0 at the right of the shortest
c/ add them by adding 0 at the left of the shortest
On the Prime, if you add two matrices with different sizes that are tagged as matrices a/ happens. For example matrix[[1,2],[3,4]]+identity(3)
Otherwise and in Xcas, b/ applies if the list are tagged as 1-dimensional polynomials (poly1[1,2]+poly1[1,2,3]) because coefficients are written in decreasing order and c/ applies otherwise.
10-17-2014, 06:37 AM
Post: #6
 DrD Senior Member Posts: 1,133 Joined: Feb 2014
RE: Matrix addition: 2x2 + 2x3
A shortcut to the consequences of matrix dimensions with respect to addition.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)