Error: wrong number (or type) of arguments
expecting ... arguments, got ...

Many of Maple's commands and functions are very particular about the number, types and order of the arguments they are given, and will cause an error if these are not correct.

Look at the help for a function, in particular the "calling sequence" and "parameters" sections, to see the correct forms to use. Or imitate one of the examples that are given on the help page.

Use the tracelast command to see more about the error. In particular it will show what functions were being called with what arguments when the error occurred. In some cases it may be helpful to use the type or whattype command to check on the type of some argument.

One common way that these errors can occur is when you try to use a name as a symbolic variable, but it turns out that the name has been assigned a value. This is the case in the second example below. If so, either use a different name that does not have a value or unassign the value if it is no longer needed.


> sin(x,y);

Error, (in sin) expecting 1 argument, got 2

> tracelast;

Error, (in sin) expecting 1 argument, got 2

executing statement: ERROR(`expecting 1 argument, got `.nargs)

locals defined as: n = n, t = t

sin called with arguments: x, y

> t:= 2:

> diff(t^2,t);

Error, wrong number (or type) of parameters in function diff

> whattype(t);

[Maple Math]

See also: tracelast , whattype , type

Maple Advisor Database R. Israel, 1997