sym and syms

27 次查看(过去 30 天)
Dwyane  Wade
Dwyane Wade 2011-8-14
回答: Dean WANG 2018-9-29
what is the use of sym and syms and what are their differences?

采纳的回答

Paulo Silva
Paulo Silva 2011-8-14
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 个评论
Dwyane  Wade
Dwyane Wade 2011-8-14
what's the purpose of using them?
Paulo Silva
Paulo Silva 2011-8-14
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

请先登录,再进行评论。

更多回答(1 个)

Dean WANG
Dean WANG 2018-9-29
sym only define one variable,but syms can define more

类别

Help CenterFile Exchange 中查找有关 Formula Manipulation and Simplification 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by