Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

GUI can't read variable with setappdata and getappdata

2 visualizaciones (últimos 30 días)
Indri Djon Hansemit
Indri Djon Hansemit el 16 de Mayo de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I'm working on setappdata and getappdata. My program calls another function within function callback.
function pushbutton1_Callback(hObject, eventdata, handles)
hitung(handles)
d=str2num(get(handles.edit3,'String'));
c=getappdata(handles.pushbutton1,'c2');
set(handles.edit4,'String',c);
while c>d
a=a-1;
c=a/b;
set(handles.listbox1,'String',c);
end
function hitung(handles)
a=str2num(get(handles.edit1,'String'));
b=str2num(get(handles.edit2,'String'));
c=a/b;
set(handles.listbox1,'String',c);
setappdata(handles.listbox1,'c2',c);
I tried edit1 <6>, edit2 <3>, edit3 <1>. But variable c from <c=getappdata(handles.pushbutton1,'c2');> can't display in edit4, and because of that while loops can't run. So the result in listbox1 <2>. Is there any solution? Thankyou.

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by