When I press ok button it automatically goes to command window.
Show older comments
% --- 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.
Accepted Answer
More Answers (0)
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!