how to take the derivative of the function saved from curve fitting tool
9 次查看(过去 30 天)
显示 更早的评论
I want to take the derivative of the following function after extracting the curve fitted from cftool. I have saved the curve fitted curve to my workspace.
I want to know how to get the highest slope (derivate) of the curve with respect to x-data ?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/534954/image.png)
0 个评论
回答(1 个)
Simon Allosserie
2021-3-1
编辑:Simon Allosserie
2021-3-1
If you have the values of your fitted curve saved, you can calculate the first derivative by using the gradient function: https://nl.mathworks.com/help/matlab/ref/gradient.html For example
fx = gradient(x) %calculate first derivative of the vector x containing your curve data.
Hope this works :)
4 个评论
Simon Allosserie
2021-3-3
As per the definition of a slope, this is indeed normal. It is literally called "derivatve" because ultimately it determines the slopes over a infinitesimal x-step. So yes, once it converges to a constant value that should be right I think!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!