Output is giving me "Empty sym: 0-by-1"
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nicholas Gillam
le 11 Nov 2019
Réponse apportée : Walter Roberson
le 11 Nov 2019
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 commentaires
Réponse acceptée
Walter Roberson
le 11 Nov 2019
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 commentaires
Plus de réponses (1)
JESUS DAVID ARIZA ROYETH
le 11 Nov 2019
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 commentaires
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!