Documentation

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.

property::hasprop

Does an object have properties?

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.

Syntax

property::hasprop(object)
property::hasprop()

Description

property::hasprop(object) tests, whether the object has properties and returns TRUE if the object or any subexpression has a property, otherwise FALSE.

Compared with getprop, property::hasprop is a fast function and can be used to determine, whether an object has properties without using the slower functions getprop or is.

    Note:   In some cases, the function is can derive some aspects without any defined property (see Example 2)!

Examples

Example 1

Does the expression 2*(x+1) have any properties?

property::hasprop(2*(x + 1))

assume(x > 0):
property::hasprop(2*(x + 1))

getprop(2*(x + 1))

delete x:

Example 2

property::hasprop returns FALSE, but is can determine an answer unequal to UNKNOWN:

property::hasprop(0 < x/(x + y) + y/(x + y))

is(exp(x) = 0)

Parameters

object

Any MuPAD® object

Return Values

TRUE or FALSE

See Also

MuPAD Functions

Was this topic helpful?