MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB数学相关] 求极限 (https://www.labfans.com/bbs/showthread.php?t=10068)

nnsghhz 2009-11-03 18:57

求极限
 
matlab程序如下,现要求当Nfinal趋向于正无穷时,P1和P2的值

Nfinal=1e6;
P=0;
Q=0;
for N=1:Nfinal;
pp=rand(1,2);
Q=Q+(1./(1+pp(1,1).^2)>=pp(1,2));
P=P+(pp(1,1)./(1+pp(1,1).^2)>=pp(1,2));
end
P1=Q/Nfinal
P2=P/Nfinal


所有时间均为北京时间。现在的时间是 02:53

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.