Using compile version of program including a C/mex function
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
THE PROBLEM
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,
댓글 수: 1
Walter Roberson
2013년 2월 25일
Does your code happen to be of the form (e.g.)
ode45('MexFunctionName', ...)
that is, being referenced by string content? If so then did you add a %#function pragma ?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!