summaryrefslogtreecommitdiff
path: root/964/CH6/EX6.3/6_3.sce
blob: 173686ddbfaeca32d522da01164687de4f96b3d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//clc()
//f(x) = exp(-x)-x
//f'(x) = -exp(-x)-1
for i = 1:5
    if i == 1 then
        x(i) = 0;
    else
         x(i) = x(i-1) - (exp(-x(i-1))-x(i-1))/(-exp(-x(i-1))-1);
         et(i) = (x(i) - x(i-1)) * 100 / x(i);
         x(i-1) = x(i);
    end
end
disp(x)
disp(et)