Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could someone tell me how to go about doing this? ... Write a function called li

ID: 3551269 • Letter: C

Question

Could someone tell me how to go about doing this? ...

Write a function called linear_equation_solver that will attempt to solve a system of linear equations provided by the user. You may not use the MATLAB built-in matrix functions or matrix operations when computing the solution. You will need to use for-loop(s) to solve this problem. Input arguments to the function will be the matrices A and B. Output arguments will be the matrix X and also was_solved, which is either true or false depending on whether there was a solution to the problem. Your function will first make sure that the system of equations has a solution and if it does not it will set was_solved to false and the function will end. If the system has a solution then was_solved will be set to true and solving for X can proceed. Be sure to test your function with systems of equations that have solutions and some that do not.

Explanation / Answer

function [x] = GaussianEliminate(A, b) %work out the number of equations N = length(b) %Gaussian elimination for column=1:(N-1) %work on all the rows below the diagonal element for row = (column+1):N %work out the value of d d = A(row,column)/A(column,column); %do the row operation A(row,:) = A(row,:)-d*A(column,:) b(row) = b(row)-d*b(column) end%loop through rows end %loop through columns return
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote