How to pass values to matlab variables from python

10 ビュー (過去 30 日間)
Sai Likhitha
Sai Likhitha 2018 年 10 月 27 日
回答済み: Mihir Thakkar 2018 年 10 月 29 日
I want to pass some values from python to matlab variables. What package I should use for that. Please give me an example with that package.
  2 件のコメント
Stephen23
Stephen23 2018 年 10 月 27 日
Easy solution: use scipy to save .mat files, and load those in MATLAB.
Or you could call Python from MATLAB using the CPython libraries.
Which would you prefer?
Sai Likhitha
Sai Likhitha 2018 年 10 月 29 日
Passed values should store in one of the matlab variables. Those values will be sent to next level. So How we can store the values passed in matlab variables.

サインインしてコメントする。

回答 (1 件)

Mihir Thakkar
Mihir Thakkar 2018 年 10 月 29 日
As Stephen suggested, you can load values in a MAT-file. Please refer to the following link for an example. https://www.mathworks.com/matlabcentral/answers/329801-passing-from-python-to-matlab-a-cell-array-of-structures?s_tid=answers_rc1-3_p3_MLT. Additionally, you can call your Python module in MATLAB and use data as MATLAB variables. Refer to this documentation, it might be helpful. https://www.mathworks.com/help/matlab/call-python-libraries.html.

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by