summaryrefslogtreecommitdiff
path: root/260/CH4/EX4.3/4_3.sce
blob: d6ec28d2d4f31774ccbcd196b232310bf2e7db90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//Eg-4.3
//pg-145

clear
clc

 
 A=[-3 0 1];
 [r,c] = size(A);
 n = r;
 
 xl=1;
 xu=3;
 fx=poly(A,'x','c')
 
 // using formula |xnew^n-alpha|<=xhigh-xlow/2^n
 
 xhigh=3;
 xlow=1;
 
 t = 1+ (6*2.303/log(2));
 disp(t)
 printf('Analytically 2^(1-n)<10^(-6), solving that implies n > %f\n so n = %d',t,t+1)