Borrar filtros
Borrar filtros

sym and syms

27 visualizaciones (últimos 30 días)
Dwyane  Wade
Dwyane Wade el 14 de Ag. de 2011
Respondida: Dean WANG el 29 de Sept. de 2018
what is the use of sym and syms and what are their differences?

Respuesta aceptada

Paulo Silva
Paulo Silva el 14 de Ag. de 2011
syms is a shortcut to the function sym, it makes it easier for the user to create symbolic variables.
Example:
x=sym('x');
y=sym('y');
Using the shortcut syms you do the same thing just with the code:
syms x y
  2 comentarios
Dwyane  Wade
Dwyane Wade el 14 de Ag. de 2011
what's the purpose of using them?
Paulo Silva
Paulo Silva el 14 de Ag. de 2011
Symbolic variables aren't constants like regular variables, you don't assign any value to them, you can use them to solve expressions using functions from Symbolic Math Toolbox™, for example:
syms a b c x
solve(a*x^2+b*x+c) %finds the roots of the quadratic expression
%Notice the results, it's the quadratic formula/equation

Iniciar sesión para comentar.

Más respuestas (1)

Dean WANG
Dean WANG el 29 de Sept. de 2018
sym only define one variable,but syms can define more

Categorías

Más información sobre Formula Manipulation and Simplification en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by