Plot the n=1, n=2, n=3 approximations to e^x for x=0:0.05:1, and plot the built-in exp(x) function on this same interval. Ensure that each line has a unique LineSpec format (ie- line style, tickmark, color),
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%HOW DO I ADD THE THREE N APPROXIMATIONS TO THIS CODE?
clear,
clc
err = 1;
order(1) = 1;
while err > 0.000000001
syms x;
approx = taylor(exp(x),x,'Order',order);
x = 0.05;
approx = eval(approx);
err = abs(exp(0.05) - approx);
order = order + 1;
end
order
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots 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!