How to create matlab workspace in python

답변 (2개)

Hans-Joachim Steinort
Hans-Joachim Steinort 2021년 9월 1일

1 개 추천

In your python file it looks for example like:
import matlab.engine
eng = matlab.engine.start_matlab()
eng.workspace['yourVar1'] = 1
eng.workspace['yourVar2'] = 'YourSecondValue'
You can also start this process directly from your python interpreter.
>>> import matlab.engine
>>> eng = matlab.engine.start_matlab('-desktop')
>>> eng.workspace['yourVar1'] = 1
If you start the matlab session with the -desktop option Matlab's GUI is opened and you can directly see the changes.
Vineet Joshi
Vineet Joshi 2021년 3월 23일

0 개 추천

As per my understanding of your question, you wan to use MATLAB with Python.
All information regarding this can be found here:
You can also consult the following webinar for a detailed overview.

카테고리

도움말 센터File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기

태그

질문:

2021년 3월 17일

답변:

2021년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by