Hi, I have a problem which PCG and minres seem to be built to handle, i.e. I have
A(x) = b,
Where A is a function I've written in a .m file (linear) and b is a known column vector (measurement). I am looking for a least squares solution for x, but I have a question. First, how does MATLAB know what the size of x should be? I know what size it should be in reality, but I don't see if there's a way to set it. My function will happily take any size of x and calculate a column vector, but there is a particular size I am looking for.
Second, none of these methods seem to converge (one spits out a bunch of NaNs, the other spits out a bunch of 0s). Does anyone know wat may be causing this problem or have any suggestions? Thanks very much