Filter löschen
Filter löschen

How to integrate matlab with a GUI in python

54 Ansichten (letzte 30 Tage)
M. Omer Farooq
M. Omer Farooq am 29 Jul. 2020
Beantwortet: Brian Harris am 1 Mär. 2022
So I have made a GUI in python and I have done some simualtions in MATLAB. Now I want the entered values in GUI by the user to pass on to matlab functions. The matlab would run the code and generate some plots. And then I want the plots to be show in GUI that is in python. So can anyone help me on this how to do this in a simple way?
Thank you.
  2 Kommentare
Jimmy Mejia
Jimmy Mejia am 29 Dez. 2020
I was hoping someone would answer this question. I want to do the same thing. Did you find a solution?
Charles Rumberger
Charles Rumberger am 28 Apr. 2021
Yes please! App Designer is extremely frustrating to use in my opinion. If you find a way to use MATLAB code with a Python GUI, please let us know.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Brian Harris
Brian Harris am 1 Mär. 2022
You can call matlab from python (with some contraints) via the matlab external engine.
Any plots you create in matlab during the call from python will pop-up you (the same way they do when running matlab natively). Or, you can save the data to plot in a .mat file, you can read that into python:
and plot using a python plotting routine (matplotlib.pyplot typically).
The matlab.engine needs to be installed in your python site-modules https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
Note: MATLAB R2021B only support python 2.7, 3.7, 3.8, 3.9

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by