This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Convert constant subexpressions to intervals

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.




interval(object) converts all constant subexpressions of object to floating point intervals.

interval is the analogue of float. While the latter converts exact numbers and numerical expressions to floating-point approximations, interval converts numbers and numerical expressions to enclosing floating-point intervals.

If object is an arithmetical expression, interval(object) recursively descends into the subexpressions of object and replaces all integers,rationals, and floating point numbers as well as the constants CATALAN, EULER and PI by floating-point intervals enclosing them. Afterwards, the resulting expression is evaluated via interval arithmetic.

If object is not an arithmetical expression, interval returns the object unchanged.


Example 1

Only constant expressions such as numbers 1, , 0.123 + 4.5 i etc. and numerical expressions PI + sqrt(2), sin(PI/24) etc. are converted to floating-point intervals. Symbolic objects such as identifiers, indexed identifiers etc. are left untouched:

interval(4*x[1] + PI*x[2]^2/sin(1) + 1/4)

interval(f(g(2 + x) + sin(1)*sqrt(PI)))

Example 2

The special MuPAD® constants CATALAN, EULER and PI can be converted to an enclosing floating-point interval:

interval(CATALAN), interval(EULER), interval(PI)



An arbitrary MuPAD object

Return Values

MuPAD object

See Also

MuPAD Domains

MuPAD Functions

Was this topic helpful?