Own command window for each process?

I´m working on a project, where a C# process interacts with Matlab via COM. I start the Matlab command window like this:
Type matlabApp = Type.GetTypeFromProgID("Matlab.Application");
matlab = Activator.CreateInstance(matlabApp); %//late binding
It´s working fine so far.
But when I run my application twice, I still only get one Matlab command window where both C# processes share a common workspace which yields in different problems in my application (e.g. race conditions as each process can also change the other´s Matlab variables).
How can i force each process to open its own Matlab command window with its own workspace?

 採用された回答

jb179
jb179 2019 年 12 月 2 日
編集済み: jb179 2019 年 12 月 2 日

1 投票

Got it!
Thanks to the MathWorks support!
I just fixed the problem with this simple supplement:
Type matlabApp = Type.GetTypeFromProgID("Matlab.Application.Single");
matlab = Activator.CreateInstance(matlabApp);
The ".Single" achieved, that the command window will be opened for every single Application.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2019 年 11 月 18 日

編集済み:

2019 年 12 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by