I have a vector 3x1 which I multiply by a 3x3 matrix and get a solution (this is all done in a function). I take the resulting 3x1 vector out of the function, then I need to compute the derivative of this vector. Once I find the derivative I can return it to the function.
I tried the diff(x) command but it errors every time does anyone have any suggestions?

4 comentarios

Walter Roberson
Walter Roberson el 15 de Abr. de 2019
Editada: Walter Roberson el 15 de Abr. de 2019
Is the vector numeric or symbolic? Are you looking to approximate the derivative or find the analytical solution?
A vector of 3 would normally imply three independent variables. What do you want to take the derivative with respect to?
Nikolaos Zafirakis
Nikolaos Zafirakis el 15 de Abr. de 2019
It's got symbolic and numerical terms, I am looking to get the analytical solution. I would like with respect to time. Thanks in advance!
madhan ravi
madhan ravi el 15 de Abr. de 2019
Instead of riddling readers show how your x looks like.
Nikolaos Zafirakis
Nikolaos Zafirakis el 15 de Abr. de 2019
my x is time (t)

Iniciar sesión para comentar.

 Respuesta aceptada

Más respuestas (1)

Walter Roberson
Walter Roberson el 15 de Abr. de 2019

0 votos

Take the derivative of the elements of the vector. Now each row of the matrix gives the mixing coefficients to combine the three derivatives.
Note that this does not apply if the matrix contains the variable that you are taking the derivative with respect to.

Categorías

Más información sobre General Applications en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Abr. de 2019

Respondida:

el 15 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by