Output is giving me "Empty sym: 0-by-1"
9 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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);
0 件のコメント
その他の回答 (1 件)
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))
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!