How do I create conditional statements in Symbolic Math Toolbox 3.1.3 (R14 SP3)?

1 view (last 30 days)
I would like to create a discontinous, conditional, symbolic function in MATLAB. When I try to use > (or <) I get the following error:
??? Function 'gt' is not defined for values of class 'sym'.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to perform conditional operations is not available in Symbolic Math Toolbox 3.1.3 (R14 SP3). Boolean logic is available in the Extended Symbolic Math Toolbox 3.1.3 (R14 SP3).
Conditional operation can be approximated using the Symbolic Math step function, HEAVISIDE. Please note that the HEAVISIDE function returns NaN for heaviside(0), and so the resultant symbolic function is not defined for every value.

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!