Output is giving me "Empty sym: 0-by-1"

조회 수: 6 (최근 30일)
Nicholas Gillam
Nicholas Gillam 2019년 11월 11일
답변: Walter Roberson 2019년 11월 11일
syms s
g = (s^2-2*s+2)/((s+2)*(s+4)*(s+5)*(s+6))
x = diff(g)
b = roots(x)
I'm trying to solve for the roots of the differentiated function, but I'm getting the "Empty sym: 0-by-1" output, and I'm unsure why. I've followed the syntax on how everything should be, but I don't know why this is being outputted.

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 11일
roots() is not explicitly defined for symbolic expressions, and will not work for scalar symbolic expressions. It is also only defined for polynomials, but g is not a polynomial. Instead use
b = solve(x);

추가 답변 (1개)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 11월 11일
solution:
syms s
g = (s^2-2*s+2)/((s+2)*(s+4)*(s+5)*(s+6))
x = diff(g)
b = double(solve(x))

카테고리

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