summaryrefslogtreecommitdiff
path: root/413/CH7/EX7.1/Example_7_1.sce
blob: 69dee877df3e0278aae4677ec892d346ecda76f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
clc
clear
x=-3
function a=f(x)
    a=exp(x)+2-cos(x);
endfunction
h=1
  y=f(x)
y1=f(x+h)
while(abs(y-y1)>=0.00001)
    y=f(x)
   y1=f(x+h)
     while(y>y1)
    y=f(x)
    y1=f(x+h)
    T=[x+h, y1]
    disp(T)
     x=x+h
     end 
     h=-h/4
     end