How to call a script when clicking on a button in matlab app.designer?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ErikJon Pérez Mardaras
am 14 Jan. 2021
Kommentiert: Cris LaPierre
am 14 Jan. 2021
I am trying to do the following app:
In which, when clicking on the button, a script is executed and its numerical calculations performed and its result appears in the white window
I have defined as private property the following variables with those values.
So when the button is clicked, the script (which name is: operasion.m) is called and the result (j) appears on the white window
The script is the following
Thank you very much for the help. By the way, the script.m and the app are saved in the same folder
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 14 Jan. 2021
You run a script by calling it by name.
However, is there a reason you don't just include the code and parameters inside your app? It seems unnecessary to have this code in an external m file.
app.solu.Value= app.a + app.b;
8 Kommentare
ErikJon Pérez Mardaras
am 14 Jan. 2021
Bearbeitet: ErikJon Pérez Mardaras
am 14 Jan. 2021
Cris LaPierre
am 14 Jan. 2021
At least based on the original example you don't have to do j=app.j since j is calculated in the script. If you want to save the value in your app, you probably want to do the opposite.
app.j = j;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer 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!