Error, improper op or subscript selector - Maple Programming Help

Home : Support : Online Help : System : Error Message Guide : improperoporsubscriptselector

Error, improper op or subscript selector

 Description This error occurs when the op command is used to extract an operand that does not exist.   The index must be an integer and must refer to an operand that exists in the expression.

Examples

Example 1

In this example, using the op command to extract the 15th operand results in an error.

 >
 ${s}{:=}{\mathrm{sin}}\left({2}\right){+}{\mathrm{cos}}\left({2}\right)\left({x}{-}{2}\right){-}\frac{{1}}{{2}}{\mathrm{sin}}\left({2}\right){\left({x}{-}{2}\right)}^{{2}}{-}\frac{{1}}{{6}}{\mathrm{cos}}\left({2}\right){\left({x}{-}{2}\right)}^{{3}}{+}\frac{{1}}{{24}}{\mathrm{sin}}\left({2}\right){\left({x}{-}{2}\right)}^{{4}}{+}\frac{{1}}{{120}}{\mathrm{cos}}\left({2}\right){\left({x}{-}{2}\right)}^{{5}}{+}{\mathrm{O}}\left({\left({x}{-}{2}\right)}^{{6}}\right)$ (2.1)
 > $\mathrm{op}\left(15,s\right)$

Solution:

Using the nops command, you see that there are only 14 operands.

 > $\mathrm{nops}\left(s\right)$

 ${14}$ (2.2)

To access the last element, use the following command:

 > $\mathrm{op}\left(14,s\right)$
 ${6}$ (2.3)

Example 2

Again, calling the op command to extract an operand outside the bounds of the list results in an error.

 > $L≔\left[a,b,c,d\right]$
 ${L}{:=}\left[{a}{,}{b}{,}{c}{,}{d}\right]$ (2.4)
 >

Solution:

Modify the arguments to the op command to extract an element within the list. Use the nops command to determine the number of operands.