linking function and GUI

1 次查看(过去 30 天)
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"."

采纳的回答

Walter Roberson
Walter Roberson 2011-10-2
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 .

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by