I'm a noob and the assignment is to create a derivative script without using the polyder function. I have this so far? Does anyone have a more efficient method because I want to learn to code efficiently from the start.

 Respuesta aceptada

Using Symbolic Toolbox might be more efficient and easier for you.
syms x
fun=2*x^4-5*x^3-12*x^2+30*x+10
der1=diff(fun,x)
der2=diff(fun,x,2)
and you may get coefficients by coeffs command.
fliplr(coeffs(fun))
fliplr(coeffs(der1))
fliplr(coeffs(der2))

1 comentario

Thanks I didn't know about syms, or the functions diff and coeffs. I'll look more into them.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Preguntada:

+ +
el 30 de En. de 2018

Comentada:

+ +
el 30 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by