フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Building a calculator, confused with GUI ButtonDownFct

1 回表示 (過去 30 日間)
JP
JP 2013 年 7 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello, I am building a calculator from scratch and Im having trouble with the ButtonPressFct. I am trying to make it so I store a variable ONLY IF you press a certain button. In this case, Im trying to do it for the '+' button. Heres what I have and it is not working
function togglebutton12_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of togglebutton12
global n1
if (get(handles.text1,'ButtonDownFct') ~= 'on'
n1 = get(handles.text1,'String');
else
n1 = 0;
end
textString = get(handles.text1,'String');
textString = '';
set(handles.text1,'String',textString)

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by