Partial Differentiation of a function with exponential is different from other calculators
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Eric Chen
le 3 Juil 2022
Réponse apportée : Dyuman Joshi
le 3 Juil 2022
function being tested:
first differentiation with respect to 'h' in matlab code as follows:
syms x c h s
fn1 = exp(-0.5 * (((h-c)/s)^2));
diff(fn1,h)
I got the answer = (exp(-(c - h)^2/(2*s^2))*(2*c - 2*h))/(2*s^2)
but in other calculators I got the answer = 

Is there any thing wrong with my code?
0 commentaires
Réponse acceptée
Dyuman Joshi
le 3 Juil 2022
There's nothing wrong with your answer, it's just simplified version of it. 2 from numerator and denominator is cancelled out and 1/2 is converted to 0.5 in the exponential.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
