欢迎大家来到IT世界,在知识的湖畔探索吧!
利用MATLAB的GUI界面设计一个简单的科学计算器,界面如图;
具体功能:四则运算、三角函数计算、对数和指数运算、求多项式方程计算、括号、关闭、清除、后退一步等基本计算功能。下面呈现主要程序,完整程序,需要的可以打赏10元及以上,进行联系,或者发截图到微信公众号云龙派对话窗口或者直接在公众号里,点击“联系掌门”按键,即可获得源程序,编程不易,还请见谅。
数字按键部分程序
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
textString = get(handles.edit1,'String');
textString = strcat(textString,'1');
set(handles.edit1,'String',textString);
guidata(hObject, handles);
欢迎大家来到IT世界,在知识的湖畔探索吧!
退一步back按键程序
欢迎大家来到IT世界,在知识的湖畔探索吧!function pushbutton13_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
textString=get(handles.edit1,'String');
as=char(textString);
n=length(textString);
textString=as(1:n-1);
set(handles.edit1,'String',textString)
guidata(hObject, handles);
清除按键程序
function pushbutton14_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
textString = get(handles.edit1,'String');
textString = get(handles.edit2,'String');
set(handles.edit1,'String','');
set(handles.edit2,'String','');
guidata(hObject, handles);
运算符部分程序
欢迎大家来到IT世界,在知识的湖畔探索吧!% --- Executes on button press in pushbutton17.
function pushbutton17_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
textString = get(handles.edit1,'String');
textString = strcat(textString,'*');
set(handles.edit1,'String',textString);
guidata(hObject, handles);
本文内容来源于网络,仅供参考学习,如内容、图片有任何版权问题,请联系处理,24小时内删除。
作 者 | 郭志龙
编 辑 | 郭志龙
校 对 | 郭志龙
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://itzsg.com/32745.html