Answer to Question #278507 in Electrical Engineering for Manmeet

Question #278507

Solve by using gaussian elimination


x+2y-3z=-1


-3x+y-2z=-7


5x+3y-4z=2


1
Expert's answer
2021-12-14T05:22:01-0500
close all,
clear all,
clc,


%     x + 2y - 3z =-1
%   -3x +  y - 2z =-7
%    5x + 3y - 4z = 2
C = [1, 2, -3;-3, 1, -2;5, 3, -4];
b = [-1, -7, 2]';


dett = det(C)
if dett == 0
    fprintf('No Solution possible as det(C) = 0 ')
else
b = b';
A = [ C  b ];
for j = 1:(n-1)
        for i= (j+1) : n
            mult = A(i,j)/A(j,j) ;
            for k= j:n+1
                A(i,k) = A(i,k) - mult*A(j,k) ;
            end
        end
end


for p = n:-1:1
    for r = p+1:n
        x(p) = A(p,r)/A(p,r-1)
    end
end
disp('Solution using Gauss-Elimination Method');
x
end




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS