How can I solve this using \" MATLAB \" ** Please MATLAB only Problem 1: Given t
ID: 2074049 • Letter: H
Question
How can I solve this using " MATLAB "
** Please MATLAB only
Problem 1: Given the linear system of equations 3.y_3x, +x, + 7x4 = 12 a) Find the Matrices A and B b) Check whether matrix A is singular or not c) Solve the linear system of equations using Problem 2: Define the following matrix and perfo ated operations using MATLAB 1 40 5 719 Part f 6 -3 2 Part g Part e a) Define the above matrix in MATLAB b) Find the Eigenvalues and Eigenvectors c) Transpose the matrix d) Find inverse and multiply with the given matrix e) Store the third row of the given matrix in a vector f) Access the element in the 2nd row 3rd column of the matrix and take its cube g) Define a submatrix from the 1st two rows and columns of the above matrixExplanation / Answer
Problem 1:
% Start of Matlab code
clear
syms x1 x2 x3 x4 % Define variables
eq1 = 3*x1-3*x2+x3+7*x4 == 12; % 1st equation
eq2 = x1-x2+2*x3-9*x4 == 3; % 2nd equation
eq3 = 2*x1+4*x2+x3+6*x4 == 1; % 3rd equation
eq4 = 9*x1+x2-3*x3+4*x4 == 5; % 4th equation
[A,B] = equationsToMatrix(eq1,eq2,eq3,eq4);
A = eval(A); B = eval(B);% Convert matrix from symbolic representation to numbers
Determinant = (det(A)); % Returns 1 if matlab is singular, 0 otherwise
if Determinant == 0
fprintf("Matrix A is singular ");
else
fprintf("Matrix A is not singular ");
en
X1 = A^-1*B; % Solution of the equations using X=A^-1*B
X2 = AB; % Solution of the equations using X=AB
% End of code
Problem 2:
% Start of Matlab code
clear
A = [-1 4 0;5 7 9;6 -3 2]; %Define matrix in matlab
[V,D] = eig(A); %D is diagonal matrix of eigenvalues
%V is matrix whose columns are the corresponding
%right eigenvectors
A_transpose = A'; % Transpose the matrix
A_inv = inv(A); % Inverse of the matrix
A_mul = A*A_inv; % Multiplication of matrix with its inverse
A_3row = A(3,:); % Third row of the matrix
A_2row_3col = A(2,3); % element in 2nd row and 3rd column
A_sub = A(1:2,1:2); % Submatrix from 1st two rows and columns
%End of code
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.