Taylor series for e^x with loop
7 ビュー (過去 30 日間)
古いコメントを表示
回答 (1 件)
Lateef Adewale Kareem
2022 年 7 月 19 日
%% This is more efficient
x = 2;
v = 1;
n = 1;
d = 1;
for i = 1:20
n = n*x;
d = d*i;
v = v + n/d;
end
fprintf('Computed Value: %f', v)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!