Académique Documents
Professionnel Documents
Culture Documents
DOD: 25/07/13
Sem: -
DOP:
DOD: 25/07/13
Sem: -
DOP:
Solve the following system of equations by Gauss Jordan Method by using Scilab:
x+y+z=9
2x - 3y + 4z = 13
3x + 4y + 5z = 40
Scilab Program:
A=[1 1 1; 2 -3 4; 3 4 5]
B=[9; 13; 40]
D=[A B]
rref(D)
DOD: 25/07/13
Sem: -
DOP:
Scilab Program:
A=[27 6 -1; 6 15 2; 1 1 54]
B=[85; 72; 110]
i=[3.15; 3.54; 1.91]
for j= 1:5
x1=((B(1)-A(1,2)*i(2))-(A(1,3)*(i(3))))/A(1,1);
i(1)= x1;
x2=((B(2)-A(2,1)*i(1))-(A(2,3)*(i(3))))/A(2,2);
i(2)= x2;
x3=((B(3)-A(3,1)*i(1))-(A(3,2)*(i(2))))/A(3,3);
i(3)= x3;
end
disp(i);
DOD: 25/07/13
Sem: -
DOP:
10
1
20
3
Scilab program:
X=[10,20,30,40,50,60]
Y=[1,3,5,10,6,4]
n= size(X)
sx=sum(X)
sy=sum(Y)
sxy=sum(X.*Y)
sx2=sum(X^2)
n=6
A=[n sx; sx sx2]
B=[sy; sxy]
linsolve(A,-B)
30 40 50
5 10 6
60
4
DOD: 25/07/13
Sem: -
DOP:
1
25
2
28
3
33
4
39
5
46
Scilab program:
X=[1,2,3,4,5]
Y=[25,28,33,39,46]
n= size(X)
n=5
sx=sum(X)
sy=sum(Y)
sxy=sum(X.*Y)
sx2=sum(X^2)
sx3=sum(X^3)
sx4=sum(X^4)
sx2y=sum((X^2).*Y)
A=[n sx sx2; sx sx2 sx3; sx2 sx3 sx4]
B=[sy; sxy; sx2y]
linsolve(A,-B)