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),

2 ビュー (過去 30 日間)
%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 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by