linking function and GUI

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"."

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Okt. 2011

0 Stimmen

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 .

Weitere Antworten (0)

Kategorien

Mehr zu Function Creation finden Sie in Hilfe-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