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.


Enable or disable warnings

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.




intlib::printWarnings lets you enable or disable warnings.

By default, MuPAD® does not display warnings during integration. To enable warnings, use the intlib::printWarnings(TRUE) function call. If later you want to disable warnings, use the intlib::printWarnings(FALSE) function call. See Example 1.

The intlib::printWarnings() function call shows whether warnings are enabled or disabled. See Example 1.

The output of intlib::printWarnings displays the previous setting. You can save this previous setting and switch to a new setting in a single function call. See Example 2.


Example 1

Enable the warnings by setting the value of intlib::printWarnings to TRUE:


Compute the integral of |x| under the assumption that x is an integer. MuPAD cannot integrate the expression over a discrete subset of the real numbers. The system issues a warning and integrates over the set of real numbers:

int(abs(x), x) assuming x in Z_
Warning: Cannot integrate when 'x' has property 'Z_'. The assumption that 'x' has the property 'R_' is used for integration. [intlib::int]

If you evaluate the same integral again, MuPAD does not recalculate the integral. The system remembers the previous result and returns it, skipping the warning:

int(abs(x), x) assuming x in Z_

To check whether the warnings are enabled or disabled, use the intlib::printWarnings() function call:


Disable the warnings for further computations:


Example 2

Enable the warnings and save the previous setting in a single function call:

old := intlib::printWarnings(TRUE):

Assume that x is positive. Then, integrate x over the interval [- 2, 1]. In this case, the system issues a warning, temporarily disregards the assumption x > 0, and integrates over the interval [- 2, 1]:

assume(x > 0):
int(x, x = -2..1)
Warning: The assumption that 'x' has property 'Dom::Interval([-2], [1])' instead of given property 'Dom::Interval(0, infinity)' is used for integration. [int]

Restore the setting of intlib::printWarnings:


The warnings are disabled now:


For further computations, clear the assumption on the variable x:


Return Values

Previously set value TRUE or FALSE

See Also

MuPAD Functions


Was this topic helpful?