필터 지우기
필터 지우기

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