write a Matlab function file to solve system Ax=b byusing the output of the function lufac2a your function should haveinputs f=matrix return from lufac2a, piv=array return by lufac2aand b=right hand side of your system.the only output for yoursystem should be x
1.use the column access for the matrixentries
2. do not create any other matrix in your function-getyour data directly from the matrix passed into yourfunction
3.do not use Matlab command designed for solvingsystem
function file LUFAC2A GIVEN BELOW
function [f, rp, flag] = lufac2a(a)
% The purpose of this function is to apply Gaussianelimination with
% partial pivoting to the input matrix a . (Thisfollows the LINPACK
% algorithm except uses elementary Gaussiantransformations from Matrix
% Computations). This function returns:
% f - matrix containing the information about the Land U matrices in the
% rp - array containing information about the rowinterchanges used in the
% flag - error flag (set to 0 if a is invertible, andset to k>0 if a
% nonzero pivot could not be found for columnk)
% The calling sequence is [f, rp, flag] =lufac2(a)
disp('The matrix must be a square matrix.')
[mx,p] = max(abs(f(j:n,j)));
f(i,i) = f(i,i) - f(i,j)*f(j,i);