Default number of terms in series expansions
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
The environment variable
ORDER controls the
default number of terms that the system returns when you compute a
Possible values: Positive integer less than 231. The default value is 6.
asympt have an optional
third argument specifying the desired number of terms of the requested
series expansion, counting from the dominant term on (relative order).
If this optional argument is missing, then the value of
ORDER may also affect the results returned
by the function
Deletion via the statement “
ORDER to its default value 6.
Executing the function
restores the default value.
In the following example, we compute the first 6 terms
of the series expansion of the function
series(exp(x)/x^2, x = 0)
To obtain the first 10 terms,
we specify the third argument of
series(exp(x)/x^2, x = 0, 10)
Alternatively, we increase the value of
This affects all subsequent calls to
series or any other function returning
a series expansion:
ORDER := 10: series(exp(x)/x^2, x = 0)
taylor(x^2/(1 - x), x = 0)
Finally, we reset
ORDER to its default value 6:
delete ORDER: taylor(x^2/(1 - x), x = 0)
The number of terms returned by
series may differ from the value of
cancellation or rational exponents occur:
ORDER := 3:
series(exp(x) - 1 - x - x^2/2 - x^3/6, x = 0)
series(1/(1 - sqrt(x)), x = 0)