百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 编程字典 > 正文

基于MATLAB的标准计算器和程序员计算器App

toyiye 2024-04-12 15:48 53 浏览 0 评论

利用MATLAB的App设计一个简单的计算器和程序员计算器,界面如图:

标准计算器界面

程序员计算器界面

点击菜单选择普通简单计算器界面或者程序员计算器界面,在Input可编辑文本中输入计算的表达式——点击等号或者点击进制转换的按键 ——在Result出现结果。需要完整App安装包的,可以进行在微信公众号云龙派打赏后截图(40元及以上),点击公众号“联系掌门”进行联系,或者在公众号内回复截图,几小时内会回复。App编程不易,还请见谅!

主要功能按键介绍:
close:退出App
back:返回上一次的输入
clean:清除input输入文本框内容
DEC2OCT:十进制转换为八进制数
OCT2DEC:八进制转换为十进制数
DEC2BIN:十进制转换为二进制数
BIN2DEC:二进制转换为十进制数
DEC2HEX:十进制转换为十六进制
HEX2DEC:十六进制转换为十进制

1.计算功能操作示意

Step1:点击Calculator.mlappinstall文件,在MATLAB中双击安装APP,点击安装到我的APP。

Step2:在APP 菜单栏中找到我的app中的Calculator,双击运行出App主界面

Step3:默认状态是在标准计算器界面,可以通过按键在Input文本框里输入想要进行运算的表达式,点击等号即可在Result文本框中显示出结果。

Step4:点击菜单栏,进入到程序员计算器界面,可以通过按键在Input文本框里输入想要进行运算的数据,点击相应的进制转换即可在Result文本框中显示出结果。


2.App部分程序

classdef calculatorapp < matlab.apps.AppBase


    % Properties that correspond to app components
    properties (Access = public)
        CalculatorUIFigure      matlab.ui.Figure
        TabGroup                matlab.ui.container.TabGroup
        Tab                     matlab.ui.container.Tab
        atanButton              matlab.ui.control.Button
        sqrtButton              matlab.ui.control.Button
        Button_32               matlab.ui.control.Button
        Button_31               matlab.ui.control.Button
        Button_29               matlab.ui.control.Button
        InputEditField          matlab.ui.control.EditField
        InputEditFieldLabel     matlab.ui.control.Label
        ResultEditField         matlab.ui.control.NumericEditField
        ResultEditFieldLabel    matlab.ui.control.Label
        Button_30               matlab.ui.control.Button
        cleanButton_3           matlab.ui.control.Button
        logButton_2             matlab.ui.control.Button
        Button_28               matlab.ui.control.Button
        tanButton               matlab.ui.control.Button
        cosButton               matlab.ui.control.Button
        sinButton               matlab.ui.control.Button
        backButton              matlab.ui.control.Button
        Button_27               matlab.ui.control.Button
        Button_26               matlab.ui.control.Button
        Button_25               matlab.ui.control.Button
        Button_24               matlab.ui.control.Button
        Button_23               matlab.ui.control.Button
        Button_22               matlab.ui.control.Button
        closeButton_2           matlab.ui.control.Button
        Button_21               matlab.ui.control.Button
        Button_20               matlab.ui.control.Button
        Button_19               matlab.ui.control.Button
        Button_17               matlab.ui.control.Button
        Button_16               matlab.ui.control.Button
        Button_15               matlab.ui.control.Button
        Button_14               matlab.ui.control.Button
        Button_13               matlab.ui.control.Button
        Tab_2                   matlab.ui.container.Tab
        XButton                 matlab.ui.control.Button
        Button_34               matlab.ui.control.Button
        Button_33               matlab.ui.control.Button
        FButton                 matlab.ui.control.Button
        EButton                 matlab.ui.control.Button
        DButton                 matlab.ui.control.Button
        CButton                 matlab.ui.control.Button
        BButton                 matlab.ui.control.Button
        ResultEditField_2       matlab.ui.control.EditField
        ResultEditField_2Label  matlab.ui.control.Label
        OCT2DECButton           matlab.ui.control.Button
        DEC2OCTButton           matlab.ui.control.Button
        HEX2DECButton           matlab.ui.control.Button
        InputEditField_2        matlab.ui.control.EditField
        InputEditField_2Label   matlab.ui.control.Label
        DEC2HEXButton           matlab.ui.control.Button
        BIN2DECButton           matlab.ui.control.Button
        DEC2BINButton           matlab.ui.control.Button
        cleanButton_2           matlab.ui.control.Button
        backButton_2            matlab.ui.control.Button
        AButton                 matlab.ui.control.Button
        Button_11               matlab.ui.control.Button
        closeButton             matlab.ui.control.Button
        Button_9                matlab.ui.control.Button
        Button_8                matlab.ui.control.Button
        Button_7                matlab.ui.control.Button
        Button_6                matlab.ui.control.Button
        Button_5                matlab.ui.control.Button
        Button_4                matlab.ui.control.Button
        Button_3                matlab.ui.control.Button
        Button_2                matlab.ui.control.Button
        Button                  matlab.ui.control.Button
    end




    properties (Access = private)
        textString % Description
        textString1
    end




    % Callbacks that handle component events
    methods (Access = private)


        % Button pushed function: Button_13
        function Button_13Pushed(app, event)
            textString = app.InputEditField.Value;
            textString = strcat(textString,'1');
            app.InputEditField.Value = textString;
        end


本文内容来源于网络,仅供参考学习,如内容、图片有任何版权问题,请联系处理,24小时内删除。


作 者 | 郭志龙

编 辑 | 郭志龙
校 对 | 郭志龙

相关推荐

kong api gateway 初体验(konga github)

kongapigateway初体验(firstsight?)。Kong是一个可扩展的开源API层(也称为API网关或API中间件)。Kong运行在任何RESTfulAPI的前面,并通过插件...

在Ubuntu下开启IP转发的方法(ubuntu20 ip)

IP地址分为公有ip地址和私有ip地址,PublicAddress是由INIC(internetnetworkinformationcenter)负责的,这些IP地址分配给了注册并向INIC提...

基于 Kubernetes 的 Serverless PaaS 稳定性建设万字总结

作者:许成铭(竞霄)数字经济的今天,云计算俨然已经作为基础设施融入到人们的日常生活中,稳定性作为云产品的基本要求,研发人员的技术底线,其不仅仅是文档里承诺的几个九的SLA数字,更是与客户切身利益乃...

跟老韩学Ubuntu Linux系列-sysctl 帮助文档

sysctl一般用于基于内核级别的系统调优,man帮助手册如下。...

如何在 Linux/Unix/Windows 中发现隐藏的进程和端口

unhide是一个小巧的网络取证工具,能够发现那些借助rootkit、LKM及其它技术隐藏的进程和TCP/UDP端口。这个工具在Linux、UNIX类、MS-Windows等操作系统下都...

跟老韩学Ubuntu Server 2204-Linux性能管理-uptime指令帮助手册

uptime指令是每个从事Linux系统工作的相关同学必知必会的指令之一,如下是uptime指令的帮助手册。UPTIME(1)...

Openwrt+Rclone+emby+KODI搭建完美家庭影音服务器

特别声明:本篇内容参考了波仔分享,在此表示感谢!上一篇《Openwrt+emby+KODI搭建家庭影音服务器》只适用影音下载到本地的情形,不能播放云盘中的影音,内容较少,缺少了趣味性,也不直观。...

Linux Shell脚本经典案例(linux shell脚本例子)

编写Shell过程中注意事项:开头加解释器:#!/bin/bash语法缩进,使用四个空格;多加注释说明。命名建议规则:变量名大写、局部变量小写,函数名小写,名字体现出实际作用。默认变量是全局的,在函数...

解决 Linux 性能瓶颈的黄金 60 秒

如果你的Linux服务器突然负载暴增,告警短信快发爆你的手机,如何在最短时间内找出Linux性能问题所在?来看Netflix性能工程团队的这篇博文,看它们通过十条命令在一分钟内对机器性能问题进行诊断。...

跟老韩学Ubuntu Server 2204-Linux性能管理-vmstat指令帮助手册

vmstat可查看ubuntlinux的综合性能,是每个从事Linux人员必知必会、需掌握的核心指令之一。vmstat指令帮助手册如下。VMSTAT(8)...

Python 可视化工具包(python常见的可视化工具)

喜欢用Python做项目的小伙伴不免会遇到这种情况:做图表时,用哪种好看又实用的可视化工具包呢?本文将介绍一些常用的Python可视化包,包括这些包的优缺点以及分别适用于什么样的场景。这篇文章...

Python的GPU编程实例——近邻表计算

目录技术背景...

python算法体验-3.python实现欧式距离的三种方式

欧式距离也称欧几里得距离,是最常见的距离度量,衡量的是多维空间中两个点之间的绝对距离。欧式距离源自N维欧氏空间中两点...

python实现Lasso回归分析(特征筛选、建模预测)

实现功能:...

python语言检测模块langid、langdetect使用

本文首发地址:https://blog.csdn.net/Together_CZ/article/details/86678423欢迎关注我的博客【Together_CZ】,我是沂水寒城!之前使用数据...

取消回复欢迎 发表评论:

请填写验证码