Solution of linear system of equations Ax=b using LU decomposition, QR decomposition and Householder solver.
y = linsys(A,b,c)
output Array containing the solution of linear system of equations.
Array of real or integer constant term presents in the equations on RHS.
Array containing the real or integer coefficients of unknowns in the equations. The number of elements in A must be equal to the square of elements in array b. e.g. if number of elements in b is n then number of elements in A must be equal to n^2.
Solve system of linear equations using LU decompositon method. This function factorize the matrix A into the LU decomposition PA=LU. On output the diagonal and upper triangular (or trapezoidal) part of the input matrix A contain the matrix U . The lower triangular (or trapezoidal) part of the input matrix (excluding the diagonal) contains L. The diagonal elements of L are unity, and are not stored.
Solve system of linear equations using QR decompositon method. This function factorizes the A into the QR decomposition A = QR. On output the diagonal and upper triangular part of the input matrix contain the matrix R. The columns of the lower triangular part of the matrix A contain the Householder vectors which encode the orthogonal matrix Q.
Solve system of linear equations using Householder transformations. The matrix A is destroyed by the Householder transformations.
This function is used to solve linear system of equations Ax=b using LU decomposition, QR decomposition and Householder solver.
// Solve the linear system of equations 2p+q+r=-1, 3p+2q+r=-12, p+4q+5r=-5 using LU decomposition method A=[2 1 1 3 2 1 1 4 5] b=[-1 -12 -5] c=1 y = linsys(A,b,c) disp(y) | ![]() | ![]() |