中国数学建模-编程交流-【编程学习】matlab实用程序百例
k1dd 重登录 隐身 用户控制面板 搜索 风格 论坛状态 论坛展区 社区服务 社区休闲 网站首页 退出
>> VC++,C,Perl,Asp...编程学习,算法介绍. 我的收件箱 (0)
中国数学建模 → 学术区 → 编程交流 → 【编程学习】matlab实用程序百例
您是本帖的第 3031 个阅读者
* 贴子主题:【编程学习】matlab实用程序百例
宝宝
头衔:不可不信缘
等级:贵宾
威望:3
文章:1140
积分:3646
门派:宝宝堂
注册:2003-7-8
第 71 楼
实例62:简单计算器
h0=figure('toolbar','none',...
'position',[200 60 220 240],...
'name','实例62');
b0=uicontrol('parent',h0,...
'units','points',...
'tag','b0',...
'style','pushbutton',...
'string','0',...
'fontsize',12,...
'position',[5 15 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'if k==''0''&i==0,',...
'errordlg(''数字首位不能为0''),',...
'else,',...
'k=[k,''0''];,',...
'if k==''00'',',...
'k=''0'';,',...
'end,',...
'set(e1,''string'',k);,',...
'end']);
b15=uicontrol('parent',h0,...
'units','points',...
'tag','b15',...
'style','pushbutton',...
'string','=',...
'fontsize',12,...
'position',[45 15 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'k=get(e1,''string'');,',...
'if g==''+'',',...
'm=m+str2num(k);,',...
'end,',...
'if g==''-'',',...
'm=m-str2num(k);,',...
'end,',...
'if g==''*'',',...
'm=m*str2num(k);,',...
'end,',...
'if g==''/'',',...
'if k==''0'',',...
'errordlg(''除数不能为0'');,',...
'end,',...
'm=m/str2num(k);,',...
'end,',...
'set(e1,''string'',num2str(m));,',...
'i=0;']);
b11=uicontrol('parent',h0,...
'units','points',...
'tag','b11',...
'style','pushbutton',...
'string','+',...
'fontsize',12,...
'position',[85 15 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'i=i+1;,',...
'if i==1,',...
'm=str2num(k);,',...
'set(e1,''string'',''0'');,',...
'end,',...
'if i>1,',...
'k=get(e1,''string'');,',...
'if g==''+'',',...
'm=m+str2num(k);,',...
'end,',...
'if g==''-'',',...
'm=m-str2num(k);,',...
'end,',...
'if g==''*'',',...
'm=m*str2num(k);,',...
'end,',...
'if g==''/'',',...
'if k==''0'',',...
'errordlg(''除数不能为0'');,',...
'end,',...
'm=m/str2num(k);,',...
'end,',...
'set(e1,''string'',num2str(m));,',...
'i=1;,',...
'end,',...
'k=''0'';,',...
'g=''+'';']);
b16=uicontrol('parent',h0,...
'units','points',...
'tag','b16',...
'style','pushbutton',...
'string','关闭',...
'fontsize',12,...
'position',[125 15 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback','close');
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','1',...
'fontsize',12,...
'position',[5 45 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'if k==''0'',',...
'k='''';,',...
'end,',...
'k=[k,''1''];,',...
'set(e1,''string'',k);']);
b2=uicontrol('parent',h0,...
'units','points',...
'tag','b2',...
'style','pushbutton',...
'string','2',...
'fontsize',12,...
'position',[45 45 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'if k==''0'',',...
'k='''';,',...
'end,',...
'k=[k,''2''];,',...
'set(e1,''string'',k);']);
b3=uicontrol('parent',h0,...
'units','points',...
'tag','b3',...
'style','pushbutton',...
'string','3',...
'fontsize',12,...
'position',[85 45 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'if k==''0'',',...
'k='''';,',...
'end,',...
'k=[k,''3''];,',...
'set(e1,''string'',k);']);
b14=uicontrol('parent',h0,...
'units','points',...
'tag','b14',...
'style','pushbutton',...
'string','/',...
'fontsize',12,...
'position',[125 45 35 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'callback',[...
'i=i+1;,',...
'if i==1,',...
'm=str2num(k);,',...
'set(e1,''string'',''0'');,',...
'end,',...
'if i>1,',...
'k=get(e1,''string'');,',...
'if k==''0'',',...
'errordlg(''除数不能为0'');,',...
'end,',...
'if ~(k==''0''),',...
'if g==''+'',',...
'm=m+str2num(k);,',...
'end,',...
'if g==''-'',',...
'm=m-str2num(k);,',...
'end,',...
'if g==''*'',',...
'm=m*str2num(k);,',...
'end,',...
'if g==''/'',',...
'm=m/str2num(k);,',...
'end,',...
'set(e1,''string'',num2str(m));,',...
'end,',...
'i=1;,',...
'end,',...
'k=''0'';,',...
'g=''/'';']);
b4
没有合适的资源?快使用搜索试试~ 我知道了~
100examples_for_matlab.rar_matlab
共12个文件
txt:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 32 浏览量
2022-07-15
09:05:28
上传
评论
收藏 40KB RAR 举报
温馨提示
100个matlab得小程序,涉及matlab处理得较多方面
资源推荐
资源详情
资源评论
收起资源包目录
100examples_for_matlab.rar (12个子文件)
实用程序百例
中国数学建模-编程交流-【编程学习】matlab实用程序百例6.txt 35KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例4.txt 19KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例11.txt 36KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例10.txt 40KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例3.txt 12KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例8.txt 52KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例.txt 13KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例5.txt 29KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例7.txt 49KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例9.txt 35KB
中国数学建模-编程交流-【编程学习】matlab实用程序百例2.txt 13KB
www.pudn.com.txt 218B
共 12 条
- 1
资源评论
寒泊
- 粉丝: 78
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功