MATLAB Answers

0

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

Asked by Nicholas Gillam on 11 Nov 2019 at 1:21
Latest activity Answered by Walter Roberson
on 11 Nov 2019 at 1:44
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 Comments

Sign in to comment.

2 Answers

Answer by JESUS DAVID ARIZA ROYETH about 15 hours ago

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 Comments

Sign in to comment.


Answer by Walter Roberson
about 15 hours ago

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 Comments

Sign in to comment.