Taylor series for e^x with loop
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How would I solve this problem and only compute the first 12 interations?
Antworten (1)
Lateef Adewale Kareem
am 19 Jul. 2022
%% 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)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!