I really just need help on where to start with this problem. I know about LU decomposition and Cholesky decomposition as means of efficiently solving a linear system, but I'm unsure how to approach this problem.
An important part of solving a linear system efficiently is to avoid explicitly calculating the inverse, if possible. In MATLAB, this is often done using themldivide (\) operator. See thepage here for a high-level description of the various methods/optimizations it uses.
So in a function, something like:
can be replaced with:
On a related note, the transpose of a matrix or arrayx is written asx' in MATLAB.