The approximation of the ln(1.9) using the Taylor series ln(1-x) = -sum of x^k/k, -1 less than or equal to x less than 1, I can't figure out how to code this properly
5 views (last 30 days)
Show older comments
x=-0.9;
target_equation = log(1-x);
series_sum = 0;
difference = abs(target_equation - series_sum);
threshold = 1*10^-10;
count = 0;
while difference > threshold
k=count+1;
N=series_sum + ((x^k)/k);
error = (target_equation - N);
end
disp(k,N,error);
0 Comments
See Also
Categories
Find more on Octave in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!