Error, (in rtable/Sum) invalid input
Error, (in rtable/Sum) invalid arguments
This error occurs when trying to add or subtract two Arrays, Matrices, or Vectors that are either not of the same type or do not have the same dimensions.
The usual fix for this is to convert one of both of the elements so that they are both of the same type and/or dimension using either convert, Transpose, or the constructors for Array, Matrix, or Vector.
M ≔ 1,2
V ≔ 5,6
Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 2, 1 .. 1) cannot be added to Vector[column](1 .. 2)
In this first example, M and V appear to be of the same type, but they are not:
When addition is attempted an error occurs.
To solve this error, use convert on one (or both) of the elements to be added. Here, we convert V to a Matrix before adding it to M:
Here we try adding two column Vectors.
Error, (in rtable/Sum) invalid input: dimensions do not match: Vector[column](1 .. 3) cannot be added to Vector[column](1 .. 2)
The error occurs because Y is a 3-element column Vector and Z is a 2-element column Vector.
To correct this error, use the Vector constructor to create a 3-element Vector using Z as the initializer for the first two elements. If the new Vector has more elements than the initializer, the remaining elements are set to zero.
Here we try adding two Arrays with different dimension.
Error, (in rtable/Sum) invalid input: dimensions do not match: Array(1 .. 3, 1 .. 3) cannot be added to Array(1 .. 2, 1 .. 2)
Again, the solution is to use Array to construct a 3X3 Array using B as the initializer.
For users of Maple 18 and earlier versions: These examples resulted in a different error message. The solutions are the same. For example, the example 3 given above resulted in:
Download Help Document
What kind of issue would you like to report? (Optional)