Loading a pre-running function into a static Text Box.

1 visualización (últimos 30 días)
Lee Parker
Lee Parker el 23 de Ag. de 2017
Respondida: Joe S el 23 de Ag. de 2017
Hey Guys. Really new to MATLAB. I have been trolling through pages and pages of comments and threads trying to find out. Basically, I have a large function (A.m) running which at one point calls another function (B.m). Now B.m keeps track of the progress of A.m. I want to print B.m into a static text box of a GUI made in GUIDE. I can't think of a way to do this. Please help. I'm about to throw my computer out the window.

Respuestas (1)

Joe S
Joe S el 23 de Ag. de 2017
1) Be sure to pass the "handles" variable to your subfunctions, so they can "communicate" with your GUI as properties (e.g. string, font size, font color, etc) get updated
Typically Callbacks for buttons, etc, look like:
function pushbutton1_Callback(hObject, eventdata, handles)
2) Assuming your static text box has the tag "update_text"
set(handles.update_text,'String',"Insert updated string here"); %sets new property for static_text
guidata(hObject,handles); %updates the figure with new "handles" information
drawnow;

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by