使用matlab的gui实现计算器时,如何解决小数点重复输入的问题

weixin_48878679 2021-05-17 05:04:24
我在gui设计小数点的时候的出来的程序可以重复输入小数点,不知道怎么解决
...全文
109 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_47327362 2021-06-19
  • 打赏
  • 举报
回复

% --- Executes on button press in decimal.
function decimal_Callback(hObject, eventdata, handles)
% hObject    handle to num1 (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.editshowresult,'String');
if textString(end)=='.'
    textString = textString;
else
    textString = strcat(textString,'.');
end
set(handles.editshowresult,'String',textString)

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧