row and column Vector cannot be added - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Error Message Guide : row and column Vector cannot be added

Error, a row and column Vector cannot be added together

 

Description

Examples

See Also

Description

This error occurs when you try to add or subtract two Vectors that do not have the same dimensions.

 

To fix this, transpose one of both of the Vectors so that they are both the same dimension.

Examples

In this example we try to add (or subtract) two Vectors.

 

W5|6

W56

(2.1)

X7,8

X78

(2.2)

 

W+X

Error, a row and column Vector cannot be added together


The same error occurs when subtracting:

WX

Error, a row and column Vector cannot be added together

 

The error occurs because W is a row Vector and X is a column Vector:

whattypeW

Vectorrow

(2.3)

whattypeX

Vectorcolumn

(2.4)

 

Solution:

Use LinearAlgebra[Transpose] to convert one Vector to the other Vector's type:

 

W+LinearAlgebraTransposeX

1214

(2.5)

Alternatively, you can use one of the short forms for Transpose (^+ or ^%T):

W+X+

1214

(2.6)

W+X%T

1214

(2.7)

(2.8)

For users of Maple 17 and earlier versions: These examples resulted in a different error message.  The solutions are the same.  For example, the example given above resulted in:

W+X

Error, (in rtable/Sum) invalid arguments

 

See Also

LinearAlgebra[Transpose], Vector