dunswers/ eate & matlab function that solves a syste Your question has been answ
ID: 3114902 • Letter: D
Question
dunswers/ eate & matlab function that solves a syste Your question has been answered Let us know if you got a helpful answer. Rate this answer Question: Create a MATLAB function that solves a system of linear e Create a MATLAB function that solves a system of linear equations using Cramer's rule. The input to the function should be the matrix A and vector B. You may use the built in function "det" to calculate determinants within the function. Confirm you code is working by reproducing the results from Problem 9.6b. 4. 9.6 For the set of equations 2x2 + 5x3 = 1 (a) Compute the determinant. (b) Use Cramer's rule to solve for the xs.Explanation / Answer
Soln.
Matlab code to find determinant and solving for x using cramers rule.
A = [0 2 5;2 1 1; 3 1 0] % Coefficient Matrix
X = [1; 1; 2]
Ax = [1 1 1 ; 1 -1 -1;2 2 1 ]
Ay = [2 1 1; 1 1 -1; 1 2 1]
Az = [2 1 1; 1 -1 1; 1 2 2]
detA=det(A)
x1 = det(Ax)/detA
x2 = det(Ay)/detA
x3 = det(Az)/detA
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.