I'm a grad student, and one of my professors does not like his students to use "black box" functions when we could "easily" code a function ourselves.
So I need to be able to write a function, in Matlab, that will generically be able to take the inverse of an input matrix (probably of size 100x100 to 500x500). The only other guidance I have is that: "You should use an iterative method, whereas your function inputs should be the matrix you would like to invert and a specified amount of tolerable error. You may use any error estimator you would like."
Looking around, I have found a lot of estimation techniques that allow us to directly solve for Ax=b as opposed to solving for A^-1 (think Gauss-Seidel Method). The only other hint I have is that it might be useful to deconstruct my input matrix into upper triangular, diagonal, and lower triangular elements, and then to somehow invert them all individually.
Obviously, I'm not expecting someone to give me a code. What I would like is if anyone has a good resource that would give me some kind of basic numerical matrix inversion technique that I could form into a Matlab code.