# `getprop`

Query properties of expressions

MuPAD® notebooks will be removed in a future release. 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

```getprop(`f`)
getprop()
```

## Description

`getprop(f)` returns a set containing all possible values of the expression `f`.

The property mechanism helps to simplify expressions involving identifiers that carry “mathematical assumptions”. The function `assume` allows to set basic assumptions such as '`x` is a real number' or '`x` is an odd integer', say. Arithmetical expressions involving `x` may inherit such properties. E.g., '`1 + x^2` is positive' if '`x` is a real number'.

`getprop(f)` examines the assumptions of all identifiers in the expression `f` and derives a superset of all values of `f`.

Only basic mathematical properties can be represented with the available properties. Therefore, `getprop` performs certain simplifications during the derivation of a property for an expression. Thus it may happen that `getprop` derives a too large set.

`getprop` only shows a mathematical (super-)set of all possible values in respect to the assumptions. The command `property::showprops` displays a list of all valid assumptions for a special identifier.

## Examples

### Example 1

If `x` is a real number, then ```x^2 + 1``` must be positive:

```assume(x, Type::Real): getprop(x^2 + 1)```

If `x` represents a number in the interval ```[1, infinity[```, the expression `1 - x` has the following property:

```assume(x, Type::Interval([1], infinity)): getprop(1 - x)```

`unassume(x):`

### Example 2

An expression returns the superset `C_` or a set if it is constant, or if no properties are attached to the identifiers involved:

`getprop(x), getprop(x + 2*y), getprop(sin(3))`

### Example 3

The functions `abs`, `Re`, and `Im` have a “minimal property”: they produce real values. In fact, `abs` produces nonnegative real values:

```delete x: getprop(abs(x)), getprop(Re(x)), getprop(Im(x))```

## Parameters

 `f`

## Return Values

`getprop(f)` returns a (super-)set containig all possible values of the expression `f`.

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos