I have a main program that run an optimization function. The cost function is calculated thanks to a C external function for speed. I have compiled the C function without any problem and created a mex functions from it. The main program using the mex function works without any problem.
I want to deploy this program on other machines which do not need Matlab installed. When I run the deployed program it crashes systematically in one function. The error message is:
(ERROR) Output argument "f" (and maybe others) not assigned during call to "MATLAB\InverseKinematics\distrib\InverseKinematics_mcr\MatlabDev\Tools\Optimization\autoGradGOM2C.m (autoGradGOM2C)".
The function autoGradGOM2C.m which crashes is a function where the mex function is evaluated to calculate the gradient.
WHAT I TRIED
I thought that maybe the mex function was not well linked so I called it from somewhere else within the main program. It gave me the results I was expecting without any problem.
The error message is strange, it tells me that the function autogradGOM2C do not return any results. I modified it so that whatever happen the results variables are set before doing anything. Still the same crash.
I am running out of ideas now.
Thanks for your help,