summaryrefslogtreecommitdiff
path: root/413/CH8/EX8.5/Example_8_5.sce
blob: 168ae735cc68b5b167605e5dce826ebd59ea51d5 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
clc
clear
for i=1:35
    for j=1:35
        A(i,j)=0
    end
end


for i=1:34
    A(i,i+1)=1
end

for i=2:35
    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:30
    A(i,i+1)=0
end

for i=1:35
    A(i,i)=-4
end
disp(A)
for i=1:35
    B(i,1)=-2
end

X=A\B

for i=1:5:35
T=[ X(i,1), X(i+1,1),X(i+2, 1), X(i+3,1), X(i+4,1)]
disp(T)
end