Effacer les filtres
Effacer les filtres

linking function and GUI

1 vue (au cours des 30 derniers jours)
rahman
rahman le 2 Oct 2011
Hi all
I want to run a function by clicking a push button and display comment of that function in a text box.How can I do that?
I used set(handles.t1,'String','comment') in that function, but matlab returned error "??? Undefined variable "handles" or class "handles.t1"."

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Oct 2011
handles = guidata(gcf);
Or, alternately, pass handles in to the function in the callback:
..., 'Callback', {@YourFunction,handles}, ...
and adjust the arguments of YourFunction to receive handles .

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by