Control GUI with a script
Mostrar comentarios más antiguos
I have a GUI wich shows a plot and Buttons wich should set some Datas.
Is it possible to plot in this GUI with an script?
For example:
H=GUIcontrol
Function setPlot(x,y)
H.plot(x,y)
End
3 comentarios
Adam
el 30 de Jul. de 2019
Depends entirely how the GUI is created. If GUIcontrol is a class then sure, you can add methods to it to do whatever you want. If it is a GUIDE GUI then you would have to do very ugly things with findall or findobj to fish out components of the GUI, which you should never be needing to do with good design.
Gabriel Bischof
el 30 de Jul. de 2019
Editada: Gabriel Bischof
el 30 de Jul. de 2019
Adam
el 30 de Jul. de 2019
If you want to control it externally I would, yes.
Respuestas (1)
Kanishk
el 26 de Dic. de 2024
To plot data inside the axes of an App, you can design a simple app in MATLAB App Designer with axes. In MATLAB, create an object of the app and plot the data using the plot function. Here is an example code with MATLAB App named "appWithAxes".
app = appWithAxes;
x = linspace(0,10);
y = sin(x);
plot(app.UIAxes, x, y);
This plots the data in the MATLAB App.

You can also create public functions and execute them from external MATLAB script.
To learn more about plot function you can execute the following command in MATLAB command window.
web(fullfile(docroot, 'matlab/ref/plot.html'))
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!