summaryrefslogtreecommitdiff
path: root/413/CH8/EX8.4/Example_8_4.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /413/CH8/EX8.4/Example_8_4.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '413/CH8/EX8.4/Example_8_4.sce')
-rw-r--r--413/CH8/EX8.4/Example_8_4.sce40
1 files changed, 40 insertions, 0 deletions
diff --git a/413/CH8/EX8.4/Example_8_4.sce b/413/CH8/EX8.4/Example_8_4.sce
new file mode 100644
index 000000000..829bb9cad
--- /dev/null
+++ b/413/CH8/EX8.4/Example_8_4.sce
@@ -0,0 +1,40 @@
+clc
+clear
+for i=1:35
+ for j=1:35
+ A(i,j)=0
+ end
+end
+for i=1:35
+ A(i,i)=-4
+end
+for i=1:34
+ A(i,i+1)=1
+end
+for i=2:34
+ A(i,i-1)=1
+end
+for i=6:5:30
+ A(i,i-1)=0
+end
+for i=1:30
+ A(i,i+5)=1
+end
+for i=1:30
+ A(i+5,i)=1
+end
+for i=5:5:35
+ A(i,i+1)=0
+end
+
+disp(A)
+for i=1:35
+ B(i,1)=-2
+end
+
+X=A\B
+disp(X)
+for i=1:5:35
+T=[ X(i,1), X(i+2,1),X(i+3, 1), X(i+4,1), X(i+5,1)]
+disp(T)
+end \ No newline at end of file