fp::expr_unapply

Create a functional expression from an expression

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

fp::expr_unapply(e, <x, …>)

Description

fp::expr_unapply(e,x) tries to interpret the expression e as a function in x and to return a functional expression computing that function.

fp::expr_unapply views the expression e as a function in the indeterminates x,... and tries to return a functional expression computing that function. If fp::expr_unapply cannot find a functional expression FAIL is returned.

If no indeterminates are given, any indeterminates of e found by indets are used.

Examples

Example 1

Get the functional expression computing sin(x):

fp::expr_unapply(sin(x), x)

fp::expr_unapply(sin(x[1]), x[1])

Example 2

Get the functional expression computing sin(x)^2+cos(x)^2:

fp::expr_unapply(sin(x)^2 + cos(x)^2)

Parameters

e

Expression

x

Identifier or indexed identifier

Return Values

Functional expression or FAIL.

See Also

MuPAD Functions

Was this topic helpful?