Symbolic Math Toolbox    

Debugging

The maple command provides two debugging facilities: trace mode and a status output argument.

Trace Mode

The command maple traceon causes all subsequent Maple statements and results to be printed to the screen. For example,

prints all calls made to the Maple kernel for calculating exp(2*a):

To revert back to suppressed printing, use maple traceoff.

Status Output Argument

The maple function optionally returns two output arguments, result and status. If the maple call succeeds, Maple returns the result in the result argument and zero in the status argument. If the call fails, Maple returns an error code (a positive integer) in the status argument and a corresponding warning/error message in the result argument.

For example, the Maple discrim function calculates the discriminant of a polynomial and has the syntax discrim(p,x), where p is a polynomial in x. Suppose we forget to supply the second argument when calling the discrim function

Maple returns

If we then include x

we get the following


  Vectorized Example Extended Symbolic Math Toolbox