matlab中limit函数,关于limit函数求极限

~~~参考如下~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~我是分隔线~~~~~~~~~~~~~~~~~~~~

第一个m文件:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function [] = btnCall()

syms n

global edit1 edit2 edit3

p=str2double(get(edit1,'String'));

e=str2double(get(edit2,'String'));  %判断是否满足条件你自己加约束,我要睡觉了,回来的有点晚~~~

value=p*(1-p)/(n*power(e,2));

LimitR=double(limit(value,n,inf));

set(edit3,'String',LimitR);

end

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

第二个m文件:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

global edit1 edit2 edit3

edit1=uicontrol(gcf,'style','edit','unit','normalized','position',...

[0.2,0.70,0.12,0.06],'ForegroundColor',[1 0 0],'string','','fontsize',10);

edit2=uicontrol(gcf,'style','edit','unit','normalized','position',...

[0.2,0.50,0.12,0.06],'ForegroundColor',[1 0 0],'string','','fontsize',10);

edit3=uicontrol(gcf,'style','edit','unit','normalized','position',...

[0.2,0.30,0.12,0.06],'ForegroundColor',[1 0 0],'fontsize',10);

uicontrol(gcf,'style','text','String', 'p_value','unit','normalized','position',...

[0.2,0.80,0.12,0.06],'ForegroundColor',[0 0 1],'fontsize',10,'fontname','微软雅黑');

uicontrol(gcf,'style','text','String', 'e_value','unit','normalized','position',...

[0.2,0.60,0.12,0.06],'ForegroundColor',[0 0 1],'fontsize',10,'fontname','微软雅黑');

uicontrol(gcf,'style','text','String', 'limit','unit','normalized','position',...

[0.2,0.40,0.12,0.06],'ForegroundColor',[0 0 1],'fontsize',10,'fontname','微软雅黑');

uicontrol(gcf,'style','push',...

'unit','normalized','position',[0.4,0.50,0.12,0.08],...

'BackgroundColor',0.6*[1,1,1],'ForegroundColor',[1 0 0],...

'String','计算极限','fontsize',10,'fontname','微软雅黑','callback','btnCall');

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~我是分隔线~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

试运行结果:

79e73f8a8300d886341171906bdc7d2f.png

001.png (43.58 KB, 下载次数: 6)

2015-5-9 23:52 上传

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值