output = self.model.solver.callhandle(self.model);
runs callquadprog.m, which ultimately calls out to Matlab's quadprog solver.
In the case of the problematic point, [3;3], quadprog returns an empty x and the following output at line 63 of callquadprog.m
algorithm: 'interior-point-convex'
iterations: 0
cgiterations: []
constrviolation: []
firstorderopt: []
message: 'The problem is infeasible.…'
For comparison, the point [3;2] is also infeasible but runs without error, and quadprog returns an x of the appropriate dimension and the following output
message: 'No feasible solution found.…'
algorithm: 'interior-point-convex'
firstorderopt: 4.8901e+07
constrviolation: 1.2786
iterations: 6
cgiterations: []
The returned x values are set as Primal and passed back to subsref.m. Lines 167-187 of subsref.m seem to be where u is set to a vector full of NaN, but my failure example does not have an empty self.output.z and then is not handled at all by the else block at line 177 because output.Primal is empty, so u remains equal to an empty vector.
At this point, I am not sure if what I'm seeing is unexpected behavior from quadprog, a bug in the logical structure of lines 167-187 (which doesn't address the possibility that self.output.z may not be empty when output.Primal is empty, although possibly this state is logically inconsistent), or user error, either on my part of that of MPT. Any advice would be greatly appreciated.
Greg
if isempty(x) x = nan(length(model.c),1); end