C# matlab lost output after exit() call
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I'm using the COM automation server to execute some matlab code from C#. Some of the matlab code quits using exit() calls. Unfortunately it seems like these calls kill the matlab window more or less immediately and so the original MLApp.Execute() call doesn't exit cleanly, but instead throws a COMException ("remote procedure call failed") and the output string is lost.
Is there any way of (a) determining if the the COMException was due to an exit call in the matlab code, and (b) gathering the output string after the exit call has been made?
Thanks, Scott
댓글 수: 0
답변 (1개)
A Jenkins
2015년 1월 9일
In my experience, exit() kills MATLAB. I usually rewrite my code in such a way that I can just use a return from it instead so that I can collect the output string.
(I'm sure there may be reasons why you can't do this in your application. If so, then I am just commenting here so I will remember to look back if other people have better answers...)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!