文件名称:111
介绍说明--下载内容来自于网络,使用问题请自行百度
function pi = solve2(count,m,cc)
借助布冯投针实验 仿真求pi的值
pi=0
frq=0
randNo = binornd(1,cc,1,m)
pro=zeros(1,count)
for j=1:count
for i = 1:m
if randNo(1,i) == 1
frq = frq + 1
end
pro(i) = frq/i
end
pi = (2*m)/frq
pro(j) = pi
end
pro = pro,num =1:count
plot(num,pro) -function pi = solve2 (count, m, cc) to vote with Buffon needle experiment simulation find the value of pi pi = 0 frq = 0 randNo = binornd (1, cc, 1, m) pro = zeros (1, count) for j = 1: count for i = 1: m if randNo (1, i) == 1 frq = frq+ 1 end pro (i) = frq/i end pi = (2* m )/frq pro (j) = pi end pro = pro, num = 1: count plot (num, pro)
借助布冯投针实验 仿真求pi的值
pi=0
frq=0
randNo = binornd(1,cc,1,m)
pro=zeros(1,count)
for j=1:count
for i = 1:m
if randNo(1,i) == 1
frq = frq + 1
end
pro(i) = frq/i
end
pi = (2*m)/frq
pro(j) = pi
end
pro = pro,num =1:count
plot(num,pro) -function pi = solve2 (count, m, cc) to vote with Buffon needle experiment simulation find the value of pi pi = 0 frq = 0 randNo = binornd (1, cc, 1, m) pro = zeros (1, count) for j = 1: count for i = 1: m if randNo (1, i) == 1 frq = frq+ 1 end pro (i) = frq/i end pi = (2* m )/frq pro (j) = pi end pro = pro, num = 1: count plot (num, pro)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
liti5.m
solvePi.asv
liti2.m
solveP22i.m
solve2.m
solvePi.asv
liti2.m
solveP22i.m
solve2.m
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.