Send variable from c to matlab
2 ビュー (過去 30 日間)
古いコメントを表示
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
採用された回答
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 件のコメント
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 Center および File Exchange で Java Package Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!