Why does matlab not evaluate equations properly?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Lin Wu
le 20 Juin 2022
Commenté : Balaji Udayagiri
le 22 Juin 2022
I'm trying to evaulate taylor series at x = 6.42855, however with my equation it does not evaluate it at that point and just outputs the taylor series. What should i do to fix it? Anyone able to write a better code for this?
1 commentaire
Balaji Udayagiri
le 22 Juin 2022
Hi Lin Wu,
As per my understanding, you want to evaluate the Taylor expansion at a particular point.
Here is how you can modify your code:
clearvars
clc
syms x
f = log(0.7*x+0.5);
x0 = 4.2857;
t0 = taylor(f,x,x0,'Order',2);
h = subs(t0,x,6.42855);
Réponse acceptée
David Hill
le 20 Juin 2022
Modifié(e) : David Hill
le 20 Juin 2022
syms x
f=log(.7*x+.5);
x0=4.2857;
t=taylor(f,x,x0,'Order',2);
a= double(subs(t,6.42855))
0 commentaires
Plus de réponses (1)
Torsten
le 20 Juin 2022
syms x
f = log(0.7*x+0.5);
x_0 = 4.2857;
t0 = taylor(f,x,x_0,'Order',2);
h = matlabFunction(t0);
h(6.42855)
log(0.7*6.42855+0.5)
0 commentaires
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!