String of GUIDE-gui-button does not change immediately with command set(handle​s...'Strin​g'...)

1 回表示 (過去 30 日間)
Murphy3012
Murphy3012 2017 年 8 月 27 日
回答済み: ES 2017 年 8 月 28 日
Hi, I've created a GUIDE-gui with a push-button and a buttongroup with two buttons.
On every selection-change in the buttongroup, the string of the push-button changes from "plot" to "LOAD". When pushing the button "LOAD", the selected database (40MB) will load. When pushing the same button but with string "PLOT", the new database will be plotted.
Cause of the 6-7 secconds Matlab needs to load the new database, I wanted the change the button-String before starting to load the new database to "WAIT". But this String "WAIT" will be shown after loading is complete and immediately after this, the string changes again to "PLOT".
Why doesn't change the string to "WAIT" before starting to load?
function btn_group_time_SelectionChangedFcn(hObject, eventdata, handles)
global ...
...
set(handles.btn_plot,'String','LOAD')
end
----
function btn_plot_Callback(hObject, eventdata, handles)
global ...
switch handles.btn_plot.String
case 'LOAD'
set(handles.btn_plot,'String','WAIT')
cla reset
z = load(filename_mat);
...
set(handles.btn_plot,'String','PLOT')
case 'PLOT'
...
Updating the handles right after "set(...String,WAIT)"
set(handles.btn_plot,'String','WAIT')
guidata(hObject,handles);
doesn't change anything...

採用された回答

ES
ES 2017 年 8 月 28 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by