Filter löschen
Filter löschen

how to acceess variable from another function in GUI ?

4 Ansichten (letzte 30 Tage)
alex
alex am 9 Mär. 2012
I have a question say i building a gui that's loads file if data(array of double ) and calculates and plots a result so in gui,there is 'load file' push button,which has a callback function 'calculate and plot' push button,which also has a function callback
how can i access a data in 'calculate and plot' function callback ? when i doing debug there is no such variable ! F1 !

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Mär. 2012
  3 Kommentare
Walter Roberson
Walter Roberson am 9 Mär. 2012
Use a shared variable, or store the data in your handles structure via guidata(), or use setappdata(), or store the data in the UserData field of some object, or use a persistent variable, or use a global variable.
You can take any of these approaches.
In the place you need to use the data, retrieve it from where-ever you stored it.
alex
alex am 10 Mär. 2012
Thank you !
now it works !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps 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