%function
f=@(x) log(x);
fp=@(x) 1/x;
%true value
sol=1;
%initial value
x0 = 2;
%the number of iteration
iter=20;
x=zeros(1,iter);
x(1)=x0;
for i=1:iter
x(i+1)=x(i)-f(x(i))/fp(x(i));
end
x
error=abs(sol-x(iter+1))
ln(x): 0~e면 됨
x^3: 다 됨
x^(1/3): 0 말고는 발산
e^x-1: 다 됨
수치해석 잘 못해서 맞는진 모름
당신의 노력에 압도적 감사... - dc App
글삭은 좀 하지 말자;