Effacer les filtres
Effacer les filtres

save variables in Matlab GUI

5 vues (au cours des 30 derniers jours)
Huda M
Huda M le 9 Mar 2022
Modifié(e) : Stephen23 le 10 Mar 2022
hello;
if I want to save some constant
x=100;
y= 200;
how I save them in the Matlab GUI code as seen below

Réponses (1)

Rik
Rik le 9 Mar 2022
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.
With your current setup you can store them in the guidata:
handles.x=100;
handles.y=200;
guidata(handles.figure,handles)
  10 commentaires
Huda M
Huda M le 10 Mar 2022
so is it impossible to do it?
Stephen23
Stephen23 le 10 Mar 2022
Modifié(e) : Stephen23 le 10 Mar 2022
"so is it impossible to do it?"
I doubt that it would be impossible, but it is unlikely to be good data design or good code.
Accessing the property of a class or field of structure would be simpler. Or perhaps a basic array...
"if I want to save some constant"
Where? In the base workspace or in one of the GUI workspaces or somewhere else?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by