GUI panels are not showing
古いコメントを表示
I am working on a GUI using matlab r2015b version with multiple panels on it. What im trying to do is only show the panel that is selected on the popup menu (shown on the last picture). However, when i tried to run it, only one panel is showing even though i selected other option. No errors such as reference to non-existent field exist. It only works on the Newtons second law and Newton law of cooling, but on the other two panels, it wont work. Is it a glitch? should i upgrade to 2018 version? or am i missing a small detail? Thanks :)

contents = cellstr(get(hObject,'String'));
popupmenu1 = contents(get(hObject,'value'));
if strcmp (popupmenu1,'Newtons Second Law of Motion')
set(handles.second, 'Visible', 'on');
set(handles.mixture, 'Visible', 'off');
set(handles.logistic, 'Visible', 'off');
set(handles.cooling, 'Visible', 'off');
elseif strcmp (popupmenu1,'Mixture Problem')
set(handles.second, 'Visible', 'off');
set(handles.mixture, 'Visible', 'on');
set(handles.logistic, 'Visible', 'off');
set(handles.cooling, 'Visible', 'off');
elseif strcmp (popupmenu1,'Logistic Growth')
set(handles.second, 'Visible', 'off');
set(handles.mixture, 'Visible', 'off');
set(handles.logistic, 'Visible', 'on');
set(handles.cooling, 'Visible', 'off');
elseif strcmp (popupmenu1,'Newtons Law of Cooling')
set(handles.second, 'Visible', 'off');
set(handles.mixture, 'Visible', 'off');
set(handles.logistic, 'Visible', 'off');
set(handles.cooling, 'Visible', 'on');
end

2 件のコメント
Cris LaPierre
2019 年 1 月 5 日
should i upgrade to 2018 version?
You need to measure the impact that may have on your workflow, but 9 times out of 10, the answer is yes. There are so many new features you are missing out on!
Ma.Cathyrine Ravina
2019 年 1 月 5 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!