How to pass values to matlab variables from python
8 次查看(过去 30 天)
显示 更早的评论
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
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?
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!