how to derivative a function with the vector variable?
10 次查看(过去 30 天)
显示 更早的评论
there is a vectors variable X. And V=[0:0.01:44.8], and a function f(X)=exp(V+3X). I want to get the Difference of f(X), how can I do?
3 个评论
Michael Van de Graaff
2021-12-10
your vectors V and X have 4481 elements each. and you are iterating at follows:
X0 = 0*V
X1 = exp(V+3X0) (if you plot this, its an exponential)
X2 = exp(V+3X1)
and so on. That is my understanding.
now, after iteration N, you'l have some XN, correct? when you say you want the derivative of X, what precisly do you mean. do you mean that you want the differences between adjacent elements of XN, or do you mean you want how the values of each element changes (so for the 20th element of each Xi as an example, we have X0(20) goes to X1(20) goes to X2(20) goes to..... goes to XN(20), and you can define that difference vector.
What specific quantity do you want the derivative of, and with respect to what other quantity. in the end, diff is what you want.
I'm also assuming that you aren't using the symbolic math toolbox. if you are, you should say so.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!