When used Matlabelengine to execute the same function from Java, I obtained the same result
古いコメントを表示
matlab = MatlabEngine.startMatlab(options);
matlab.eval("data = "+ dto.getName()+"('"+dto.getId()+"')");
String data = matlab.getVariable("data");
function data = getMyData(id)
data = jsonencode(struct("da",id))
4 件のコメント
波鸿
2023 年 8 月 18 日
It's not clear to me:
- What the problem is here. Unless you're using random data (generated with rand, randn, randi, etc.) it seems like running the same program multiple times and getting the same answer each time is a good thing! Nothing in your code shows that you're using any random numbers.
- What options you're using when you startMatlab.
- What the dto variable that you use in your matlab.eval call represents. There's no function by that name in MATLAB.
which -all dto
- Where the getMyData function is being called.
波鸿
2023 年 8 月 21 日
波鸿
2023 年 8 月 21 日
編集済み: Walter Roberson
2023 年 9 月 8 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Call MATLAB from Java についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!