# how to take the derivative of the function saved from curve fitting tool

7 vues (au cours des 30 derniers jours)
zein le 1 Mar 2021
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 ?
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Simon Allosserie le 1 Mar 2021
Modifié(e) : Simon Allosserie le 1 Mar 2021
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 commentairesAfficher 2 commentaires plus anciensMasquer 2 commentaires plus anciens
zein le 3 Mar 2021
I used the equation, but the max slope was increasing with decreasing the step until certain limit then the max slope become constant. I think that is normal, right?
Simon Allosserie le 3 Mar 2021
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!

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by