Send variable from c to matlab

조회 수: 2 (최근 30일)
zohar
zohar 2011년 10월 30일
댓글: Walter Roberson 2018년 6월 13일
Hi all,
I have a c program that set variable into matlab, using matlab Engine.
ep = engOpen(NULL);
...
engPutVariable(ep, "var", var);
Everything is OK except that I want to send the variable,
to regular matlab workspace
and not to matlab Engine.
Any help ???
thx
  댓글 수: 1
Marisol Sierra
Marisol Sierra 2018년 6월 13일
Hey did you solve this problem?

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 10월 30일
Your C program is the "MATLAB engine" in MATLAB terminology.
I have not been able to establish this as a fact so far, but as best I can tell reading between the lines, engPutVariable() writes the variable into the "base workspace" of the MATLAB process associated with the engine.
There is no mechanism provided to write a variable in to the workspace of a particular function because no functions can be running in the MATLAB process at the time engPutVariable() is executed (or so my reading suggests.)
  댓글 수: 6
Marisol Sierra
Marisol Sierra 2018년 6월 13일
Hey... did you solve the problem?
Walter Roberson
Walter Roberson 2018년 6월 13일
Correction to a minor point from my 2011 posting:
i and j are not variables that exist by default. Instead, i and j are functions, just like pi and inf and nan

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by