diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /260/CH4/EX4.19 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '260/CH4/EX4.19')
-rw-r--r-- | 260/CH4/EX4.19/4_19.sce | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/260/CH4/EX4.19/4_19.sce b/260/CH4/EX4.19/4_19.sce new file mode 100644 index 000000000..f5ac2db40 --- /dev/null +++ b/260/CH4/EX4.19/4_19.sce @@ -0,0 +1,28 @@ +//Eg-4.19
+//pg-193
+
+clear
+clc
+
+
+a=[1 -14 71.74 -153.9 122.2525];
+
+b0=0;
+b01=1;
+g=-1;
+d=1;
+printf('The results for 10 iterations are presented below\n\n')
+printf(' i g d b1 b2 r1 r2\n')
+for i=1:10
+ b1=a(2)-g*b01-d*b0;
+ b2=a(3)-g*b1-d*b01;
+ r1=a(4)-g*b2-d*b1;
+ r2=a(5)-d*b2;
+ dnew=a(5)/b2;
+ gnew=(a(4)-dnew*b1)/b2;
+ d=dnew;
+ g=gnew;
+ printf(' %d %f %f %f %f %f %f\n',i,g,d,b1,b2,r1,r2)
+end
+
+
\ No newline at end of file |