Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

syms - Shortcut for constructing symbolic objects

Syntax

syms arg1 arg2 ...
syms arg1 arg2 ... real
syms arg1 arg2 ... clear
syms arg1 arg2 ... positive

Description

syms arg1 arg2 ... is a shortcut for

arg1 = sym('arg1');
arg2 = sym('arg2'); ...

syms arg1 arg2 ... real is a shortcut for

arg1 = sym('arg1','real');
arg2 = sym('arg2','real'); ...

syms arg1 arg2 ... clear is a shortcut for

arg1 = sym('arg1','clear');
arg2 = sym('arg2','clear'); ...

syms arg1 arg2 ... positive is a shortcut for

arg1 = sym('arg1','positive');
arg2 = sym('arg2','positive'); ...

Each input argument must begin with a letter and can contain only alphanumeric characters. For compatibility with previous versions of the software, syms arg1 arg2 ... unreal has exactly the same effect as syms arg1 arg2 ... clear.

In functions and scripts, do not use the syms command to create symbolic variables with the same names as MATLAB functions. For these names MATLAB does not create symbolic variables, but keeps the names assigned to the functions. If you want to create a symbolic variable with the same name as some MATLAB function inside a function or a script, use the sym command. For example:

alpha = sym('alpha')

Examples

syms x y real is equivalent to

x = sym('x','real');
y = sym('y','real');

To clear the symbolic objects x and y of 'real' status, type

syms x y clear

Note that clear x will not clear the symbolic object of its 'real' status. You can achieve this using

See Also

findsym, reset, sym, symvar

Clearing Assumptions and Resetting the Symbolic Engine

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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