Professional Documents
Culture Documents
Ax=c
Given A and c, find x
% Generic Linear Equation Solver
% MATLAB does all of the work, you just enter the data.
% CHANGE, c( ), a( ) as necessary to suit your problem.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c = [2;8;1;2];
a = [2,-1,0,1;-2,2,0,-3;4,1,3,-1;0,-1,-2,5];
% LU factorization to find solution:
w = a\c;
w