Symbolic Math Toolbox    

Constructing Real and Complex Variables

The sym command allows you to specify the mathematical properties of symbolic variables by using the 'real' option. That is, the statements

or more efficiently

create symbolic variables x and y that have the added mathematical property of being real variables. Specifically this means that the expression

is strictly nonnegative. Hence, z is a complex variable and can be manipulated as such. Thus, the commands

return

respectively. The conj command is the complex conjugate operator for the toolbox. If conj(x) == x returns 1, then x is a real variable.

Clearing Variables in the Maple Workspace

When you declare x to be real with the command

a becomes a symbolic object in the MATLAB workspace and a positive real variable in the Maple kernel workspace. If you later want to remove the real property from x, enter

Note that entering

only clears x in the MATLAB workspace. If you then enter syms x, MATLAB still treats x as a positive real number.


  Symbolic and Numeric Conversions Creating Abstract Functions 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS