필터 지우기
필터 지우기

Finding roots of symbolic expression

조회 수: 22 (최근 30일)
Aleem Andrew
Aleem Andrew 2021년 11월 3일
답변: Walter Roberson 2021년 11월 3일
You cannot directly use the roots function to find the roots of a symbolic expression.
syms x
fx = x^2 + 2*x + 1
How do you find the roots of fx other than by typing the coefficients in an array?

채택된 답변

Walter Roberson
Walter Roberson 2021년 11월 3일
syms x
fx = x^2 + 2*x + 1
fx = 
p = sym2poly(fx)
p = 1×3
1 2 1
roots(double(p))
ans = 2×1
-1 -1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by