Answer 3:
Matlab code:
%code to solve system of liner equations
%given equations are: 3x + 7y -2z = 2
% x - 5y + z +13
% 2x + 3y - 10z = -23
% We know AX = B, so putting the values of A and B
A = [3 7 -2; 1 -5 1; 2 3 -10];
B = [2; 13; -23];
X = linsolve(A, B) %function to get the values of x, y and
z
Screenshot:
Matlab code:
Source code:
%code to solve the system of equation using Gauss-Jordan
method
function [x,er]=gauss_jordan_elim(A,b)
A = [3 7 -2; 1 -5 1; 2 3 -10] % input for augmented matrix A
B = [2 ; 13; -23] % intput for matrix B
[n,m]=size(A); % finding the size of matrix A
er =0; % calculation of error
x=zeros(n,1); % calling fuction zero
if n ~= m
disp('error: n~=m'); % displaying error if found
er = 1;
end % end of the scope of if
if length(B) ~= n % finding the legth of matrix B
disp('error: wrong size of B'); % displaying error, if found
er = 2;
else
if size(B,2) ~= 1
B=B';
end % end of the scope of if-else
if size(B,2) ~= 1
disp('error: B is a matrix'); % displaying erron in matrix B
er = 3;
end
end
if er == 0
Aa=[A,B];
for i=1:n
[Aa(i:n,i:n+1),er]=gauss_pivot(Aa(i:n,i:n+1));
if er == 0
Aa(1:n,i:n+1)=gauss_jordan_step(Aa(1:n,i:n+1),i);
end
end
x=Aa(:,n+1);
end
A=0;
function A1=gauss_jordan_step(A,i) % calling of fuction
function
[n,m]=size(A); % determination of size of matrix A
A1=A; % assigning A to A1
s=A1(i,1);
A1(i,:) = A(i,:)/s;
k=[[1:i-1],[i+1:n]];
for j=k
s=A1(j,1);
A1(j,:)=A1(j,:)-A1(i,:)*s;
end % end of for loop
function [A1,er]=gauss_pivot(A) % calling of fucntion
[n,m]=size(A); % finding the size of matrix A
A1=A; % process of assigning
er = 0; % error flag
if A1(1,1) == 0
check = logical(1); % logical(1) - TRUE
i = 1;
while check
i = i + 1;
if i > n
disp('error: matrix is singular');
er = 1;
check = logical(0);
else
if A(i,1) ~= 0 & check
check = logical(0);
b=A1(i,:); % process to change row 1 to i
A1(i,:)=A1(1,:);
A1(1,:)=b;
end
end
end
end
To run the code, copy the source code in MatLab editor and save is as SomeFileName.m and run it. You will get the following output.
Output:
(I)
(ii)
*NOTE: Drop a comment for queries.
Total(25 marks) 3. Given the system of equation as 3x + 7y - 2z=2 x -...
1. Solve the following system of equations using Gauss-Jordan elimination. 3x - 2y +4z=3 2x +2y-2z=4 x+4y- &z=1
5. For the system, 4x + y + 2z = 1 2x + 3y + 4z = -5 x – y +3z = 3 Find the rank of the coefficient matrix by calculating the determinant. Use Cramer's theorem to find the solution of this system. (10 points) 6. Find the inverse of the following matrix using Gauss-Jordan method. Verify your result by computing the inverse using the method of determinants. (10 points) 1 2 4 2 4 2 1] 1...
5. Solve the following system, using Row-Echelon form or Gauss-Jordan elimination: -x +3y-2z + 4w = 0 2x-6y + z-2w =-3
Solve the system using Gaussian elimination or Gauss-Jordan elimination. -3x-3y-3z = 30 9x- 9y- 9z -90 -1.5x-1.5y-1.5z-15 Select one: a. (2, 2, 6)) Ob. {(x,y,z)1-3x-3y-3z = 30) Ос. { } Solve the system using Gaussian elimination or Gauss-Jordan elimination. -3x-3y-3z = 30 9x- 9y- 9z -90 -1.5x-1.5y-1.5z-15 Select one: a. (2, 2, 6)) Ob. {(x,y,z)1-3x-3y-3z = 30) Ос. { }
3. Solve the system of equations 5x + 3y + z 23 3x + 4y-z 21 4x + 5y 2z 26 4. Solve the system of equations. 4x-2y + 3z 27 5x 7y + 4z 39
Need with help understanding gauss elimination in a simple way. −3x[2] + 7x[3] = 4 x[1] + 2x[2] − x[3] = 0 5x[1] − 2x[2] = 3 Use Gauss elimination with partial pivoting to solve for the x’s. As part of the computation, Calculate the determinant.
Use the Gauss-Jordan method to solve the following system of equations. 3x + 4y - 2z = 0 5x y + 3z = 1 8x + 3y + z = 1 Select the correct choice below and, if necessary, fill in the answer box to complete your choice. A. The solution is 000 in the order x, y, z. (Simplify your answers.) B. There is an infinite number of solutions. The solution is (Q10.2), where z is any real number...
Question 7 O pts + X Given the system 3x – 2y + 5z = -5 3-y + 32 = -3 4x +y + 62 = -6 please box answers ill thumbs up write the augmented matrix and solve using Gaussian or Gauss-Jordan elimination
SOLVE THE FOLLOWING SYSTEM OF EQUATIONS BY THE CRAMER'S METHOD 3X+5Y+3Z-12 2X+5Y-2Z-6 3x+6Y+3Z-3 a) X Y b) CHECK YOUR RESULTS. (USE MATRICE FUNCTIONS, PRESS F2. AND THEN PRESS CTRL+SHIFT+ENTER) 3IF Y-SINC) EXPOO. INTEGRATE Y FROM X-0 Tox-1. COMPARE WITH REAL VALUE IF DX-0 a) INT b) INT ,IF DX- 005 REAL VALUE 3) Plot sin x letting maco c/ Prepave hese cuves 4) SOLVE THE FOLLOWING SYSTEM OF EQUATIONS BY INVERSE METHOD 3 X+3Z-13 2X +5 Y-2Z-2 3 X+6Y+2Z-3 Z-...
PLEASE SHOW WORK Question 7 Ор Given the system 3x – 2y + 5z = -5 3- y + 32 = -3 4x + y + z = -6 write the augmented matrix and solve using Gaussian or Gauss-Jordan elimination