MATLAB API automation

조회 수: 10 (최근 30일)
Zohar
Zohar 2011년 6월 7일
Hi,
I wrote on Windows a C++ standalone application, which communicates with the MATLAB engine through its API. Namely:
#include <engine.h>
engPutVariable( ...
In order for this to work, I should run in the background:
matlab.exe /automation
which puts it in a server mode.
Three questions please:
1. Can I open such an automation with a full GUI support, and not just a console window? I'd like afterwards to work with the created workspace conveniently.
2. Can I do the same thing in Linux, since the automation flag seems to have gone missing?
3. Considering it, MathWorks didn't actually invest much in a full decent API. It just opens a socket to get data and run scripts, instead of doing so through the console. Maybe someone already wrote something better, which can listen in the background of a fully fledged matlab instance, and work on all platforms?
Thanks.

답변 (3개)

Zohar
Zohar 2011년 6월 7일
In Windows we can run the following command in matlab gui, and the automation would be enabled:
enableservice('AutomationServer', true)

James Tursa
James Tursa 2011년 6월 7일
Just don't close the engine. i.e., don't call engClose at the end of your program. Once the program ends, your MATLAB Engine session will still be up and running with all engine data intact.

Zohar
Zohar 2011년 6월 7일
Actually in windows if you enableservice() as I pointed out, or run matlab /automation before executing your app, the rule is that if the engine was already opened engClose would leave it that way. So actually for windows I resolved the problem using the enableservice, which allowed me full gui.
But enableservice doesn't work on linux, and currently I don't have a system to try it out and see what happens. I'm not sure if linux just opens a console window or a full gui instance, and if there's a way to control it.

카테고리

Help CenterFile Exchange에서 Manage Products에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by