Initial value
>
|
|
If the final value is numeric, ensure that the initial value is numeric, for example, 1.
>
|
|
>
|
|
If the final value is a character, ensure that initial value is also a character.
>
|
|
Final value
>
|
|
Use the type command to verify whether the value is numeric or character.
>
|
|
>
|
|
Ensure that the final value is numeric or character.
>
|
|
Increment of for loop
>
|
|
>
|
|
>
|
|
Use evalf to evaluate the square root of 2, therefore making the increment numeric.
>
|
|
Increment when looping over characters
>
|
|
>
|
|
>
|
|
>
|
|