0
votes

I am new in learning matlab. when I am using the solve() function, matlab warning me that i must use a symbolic variable before using the solve function. but I actually don't know what the sym variable is. or What is the difference between the symbolic variables and the ordinary variables of the base workspace?

1
You need the Symbolic Math Toolbox, and you need to look at its documentation. Symbolic variables are a special class of objects that have their own methods (see, again, the Symbolic Math Toolbox). Before you dive in too deep as a new user of MATLAB, be warned: MATLAB excels at numerical calculations, and symbolic math is slow. You'll generally want to solve your problems numerically, using doubles (or not use MATLAB at all for the given problem).Andras Deak

1 Answers

-2
votes

Symbolic variables are useful to express equations and manipulate them in an analytic manner. You can use them to manipulte them algebrically, without the need of actually associating any type of numbers.

Suppose you want the exact analytical form of a solution for an equation, in terms of symbols that express this function. Then you can use a sym variable to express and operate with the unkwons, rather than to use on numerical methods to find solutions

Symbolic variables are also useful to operate with tranfer funcions and perform simplications that are very tedious If done without a computer program.

You also can associate numbers with sym variables, once you have done all the all the intended operations.

If you don't want perform operations with algebraic variables, you should checkout the fsolve function