Example 1
A typical occurrence happens when a procedure that requires numeric arguments is called with symbolic arguments. Here are three examples with the same underlying problem:
>
|
|
| (2.1) |
>
|
|
>
|
|
>
|
|
Maple evaluates the inputs to a procedure such as plot before it calls the procedure, resulting in being called with the symbolic argument . Since has not yet been assigned a value, Maple cannot determine if is less than . You can either delay the evaluation of the input using unevaluation quotes, or you can supply the arguments with operator form.
Solution 1
Here we use unevaluation quotes around . For details, see Unevaluated Expressions.
Solution 2
Here, we supply the operator form to the plot function. (Note it is not in the first argument to plot.)
Solutions for the fsolve and evalf/Int problems
>
|
|
>
|
|
>
|
|
Example 2
In this example, we want to use a loop to find primes less than 15. The error happens because i needs an initial value.
>
|
|
Solution 1
Before beginning the loop, assign i to a starting value.
>
|
|
Solution 2
Alternatively, use the from clause to set a starting value.
>
|
|
For more information about loops, see The Repetition Statement.