필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Does Matlab support the creation of COM components? Is that a scripting language?

조회 수: 1 (최근 30일)
Jamal
Jamal 2015년 9월 4일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi, I need to call Matlab from GenXPro software (in which we code with Java) to calculate something and return it to the original software. To do this the first condition is that the programming language (e.g. Matlab) support the creation of COM components which is the feature of many of scripting languages. So, I would be thankful to answer my questions in the subject; I search for that, but the answers are not consistent.
Many Thanks, Jamal

답변 (1개)

Guillaume
Guillaume 2015년 9월 4일
Matlab implements a COM server, so you can indeed control matlab from any software that supports instantiating COM components. it's actually well documented in the help.
However, as far as I know, Java does not natively allow you to interface with COM.
  댓글 수: 3
Guillaume
Guillaume 2015년 9월 4일
It would have been useful if you'd linked the correct page. Anyway, this may work:
var matlab = new ActiveXObject("Matlab.Application");
matlab.PutWorkspaceData("gxptTarget", "base", gxptTarget);
matlab.PutWorkspaceData("gxptOutput", "base", gxptOutput);
matlab.PutWorkspaceData("gxptParams", "base", gxptParams);
matlab.PutWorkspaceData("gxptModelInfo", "base", gxptModelInfo);
matlab.Execute("result = somefunc(gxptTarget, gxptOutput, gxptParams, gxptModelInfo);")
return matlab.GetWorkspaceData("result", "base");
Jamal
Jamal 2015년 9월 4일
I really appreciate it. Please let me try it and get back to you.
Cheers, Jamal

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by