how to find derivative of function whose values are stored in matrix??

1 view (last 30 days)
I have approximated a function and stored it in matrix G of size (1,10000). Now I want to find derivative of function G at particular time instance t. how to calculate it?? This is small portion of how function G values are. G = [ 0.0084 0.0084 0.0085 0.0085 0.0085 0.0086 0.0086 0.0086 0.0086 0.0087 0.0087] time advances at 0.0001 sec for each value of G.

Answers (1)

Jan
Jan on 14 Mar 2013
Edited: Jan on 14 Mar 2013
This is a job for gradient():
dG = gradient(G, 0.0001);
If this is critical for time, you could use the faster C-mex FEX: DGradient.

Community Treasure Hunt

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

Start Hunting!