So I have a rather comlicated matlab function (it calls a simulation that in turn calls an external optimisation suite (cplex or gurobi)). And for certain settings and inputs the MATLAB function and the python function called from Matlab give the same result but for others they differ (correct answer is ~4500) python sometimes returns 0.015... or 162381, so widely varying results I can't spot a pattern or correlation for.
my guess would be either something with int/ float / double variable conversions, or some form of memory problem. The result comes straight from CPLEX so I'm little confused as to why it changes.
On a side note, if I return a structure that contains a structure of arrays, that kills the python kernel. That makes debugging from python a little harder (I have pymatbridge and metakernel installed)
Has anyone, had similar issues of unreliable matlab functions in python? Solution ideas other than, executing matlab from the console and reading in a results file?