Réponses (2)

Paolo
Paolo le 4 Juil 2018
Modifié(e) : Paolo le 4 Juil 2018

1 vote

str = '4x^3 + 5x^2 + 6x^1 + 5'
num = regexp(str,'(?<!\^)(\d)','match');

2 commentaires

abdullah ek
abdullah ek le 5 Juil 2018
i also want to extract the missing cofficients i am using the function sym2pol like syms x c = sym2poly(x^3 - 2*x - 5); but i dont know how to convert my value from textbox into symbolic polynomial which can be placed in sym2poly function.
Paolo
Paolo le 5 Juil 2018
What missing coefficients? I don't see any for the equation you shared. Perhaps you need to use str2sym to convert the string to a symbolic expression before you can use sym2pol or coeffs as suggested by Stephen. I am unable to test it for you because of this bug.

Connectez-vous pour commenter.

Stephen23
Stephen23 le 5 Juil 2018
Modifié(e) : Stephen23 le 5 Juil 2018

0 votes

If you are using symbolic toolbox then you could use the appropriate function:

Produits

Version

R2014b

Tags

Commenté :

le 5 Juil 2018

Community Treasure Hunt

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

Start Hunting!

Translated by