How to wait for matlab called from C++ code to finish and resume project afterwards?

I'm calling matlab optimization function through matlab engine by "eval" from visual studio (C++) and I want to get the result. For that I need to know when matlab finishes, wait for it from the C++ project and resume afterwards. I found only documentation about how to do it from Python:
Is there a C++ equivalent?

답변 (1개)

Bo Li
Bo Li 2016년 1월 6일
There are MATLAB Engine APIs for C which should work in C++ environment:
The C version of MATLAB Engine does not support the asynchronous mechanism in Python Engine.

댓글 수: 3

thanks for the answer. I don't need the python engine, I just gave a n example of something that I need in C, that exists in python. Anyway, forget the python, can I wait for a matlab function called from C++ to finish before proceeding to the rest of my code?
The execution is normally synchronous: waiting for it to finish is what normally happens.
MATLAB Engine APIs for C is synchronous by default, which is exactly what you want: "wait for a matlab function called from C++ to finish before proceeding to the rest of my code".

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기

질문:

2016년 1월 6일

댓글:

2016년 1월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by