Documente Academic
Documente Profesional
Documente Cultură
x1 + x 2 + 2 ⋅ x3 − x 4 = 5
x + 3 ⋅ x + 2 ⋅ x + x = 17
1 2 3 4
3 ⋅ x1 + x 2 + 3 ⋅ x3 + x 4 = 18
x1 + 3 ⋅ x 2 + 4 ⋅ x3 + 2 ⋅ x 4 = 27
functionmetinv ()
A=input('matricea atasata sistemului = ');
B=input('matricea rezultatelor = ');
C=eye(size(A));
[m1 n1]=size(A);
if m1==n1,
D=[A B C];
[m n]=size(D);
wert=1:m;
for p=1:(m)
D(p,:)=D(p,:)/D(p,p);
wert1=[wert(1:(p
wert1=[wert(1:(p-1)) wert((p+1):m)];
for j=wert1
D(j,:)=D(j,:)-D(p,:)*D(j,p);
end;
end;
disp('Matricea inversa: ');
disp(D);
x=D(:,m+1);
disp('Solutia sistemului este: ');
disp(x);
else
disp('Atentie! Matricea atasata sistemului trebuie sa fie patrata!');
end;
endfunction