Error, final value in for loop must be numeric or character - Maple Help

Home : Support : Online Help : Error, final value in for loop must be numeric or character

Error, final value in for loop must be numeric or character

 Description The terminal condition in a for loop must be a numeric value, except when iterating over the letters in a string where a character is accepted.

Examples

Example 1

Note that $n$ has no value.

 >

Solution:

Define to correct this error.

 > $n≔4$
 ${n}{:=}{4}$ (2.1)
 >
 ${1}$
 ${0}$
 ${-}{1}$
 ${0}$ (2.2)

Example 2

In this example $x$ is set to $13-j$ where $j$ has no value.

 >
 > $G\left(13-j\right)$

Solution:

As with the previous example, define  to correct this error.

 > $j≔7$
 ${j}{:=}{7}$ (2.3)
 > $G\left(13-j\right)$
 ${46656}$ (2.4)

Example 3

Here is not initialized to a numeric value.

 >

Solution:

Initialize $N.$

 > $N≔5$
 ${N}{:=}{5}$ (2.5)
 >
 ${{x}}_{{2}}{:=}{{x}}_{{1}}{+}{\mathrm{Δx}}\left({1}\right)$
 ${{y}}_{{2}}{:=}{{y}}_{{1}}{+}{\mathrm{Δy}}\left({1}\right)$
 ${{x}}_{{3}}{:=}{{x}}_{{1}}{+}{\mathrm{Δx}}\left({1}\right){+}{\mathrm{Δx}}\left({2}\right)$
 ${{y}}_{{3}}{:=}{{y}}_{{1}}{+}{\mathrm{Δy}}\left({1}\right){+}{\mathrm{Δy}}\left({2}\right)$
 ${{x}}_{{4}}{:=}{{x}}_{{1}}{+}{\mathrm{Δx}}\left({1}\right){+}{\mathrm{Δx}}\left({2}\right){+}{\mathrm{Δx}}\left({3}\right)$
 ${{y}}_{{4}}{:=}{{y}}_{{1}}{+}{\mathrm{Δy}}\left({1}\right){+}{\mathrm{Δy}}\left({2}\right){+}{\mathrm{Δy}}\left({3}\right)$
 ${{x}}_{{5}}{:=}{{x}}_{{1}}{+}{\mathrm{Δx}}\left({1}\right){+}{\mathrm{Δx}}\left({2}\right){+}{\mathrm{Δx}}\left({3}\right){+}{\mathrm{Δx}}\left({4}\right)$
 ${{y}}_{{5}}{:=}{{y}}_{{1}}{+}{\mathrm{Δy}}\left({1}\right){+}{\mathrm{Δy}}\left({2}\right){+}{\mathrm{Δy}}\left({3}\right){+}{\mathrm{Δy}}\left({4}\right)$ (2.6)