When I press ok button it automatically goes to command window.
이전 댓글 표시
% --- Executes on button press in ok.
function ok_Callback(hObject, eventdata, handles)
% hObject handle to ok (see GCBO)
set(handles.text11,'String','');
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
str=get(handles.inputastext,'String');
money=str2num(str);
str=get(handles.text11,'String');
c = get(handles.buttongroup,'SelectedObject');
sosSelection = get(c,'String');
switch sosSelection
case 'Espresso'
handles.espressoPrice = 2.00;
while money<handles.espressoPrice %to calculate price of espresso
change_e=handles.espressoPrice-money
ve=(strcat(str,(['You need add (',num2str(change_e),' euros): '])));
set(handles.text11,'String',ve);
money=money+input(ve);
if money==handles.espressoPrice
de=(strcat(str,(['Enjoy your coffee'])));
set(handles.text11,'String',de);
else money>handles.espressoPrice
left_e=money-handles.espressoPrice
re=(strcat(str,(['Here your (',num2str(left_e),' euros). ENJOY YOUR COFFEE'])))
set(handles.inputastext,'String','');
end
end
I want to do anything that the program will continue in GUIDE not command window.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!