- 10
- 0
- 约2.73千字
- 约 4页
- 2016-10-15 发布于河南
- 举报
实验6蒙特卡洛模拟
Using Monte Carlo simulation, write a Matlab program to calculate an approximation to ( by considering the number of random points selected inside the quarter circle
where the quarter circle is taken to be inside the square
n=50000;
counter=0;
for k=1:n
x=rand(1);
y=rand(1);
if x.^2+y.^2=1
counter=counter+1;
end
end
PI=4.*counter./n
运行结果:
PI =
3.1420
Using Monte Carlo simulation, write a Matlab program to calculate the volume of an ellipsoid(椭球体)
n=50000;
counter=0;
for k=1:n
x=rand(1)*6;
y=rand(1)*8;
z=
您可能关注的文档
最近下载
- 湖北省十一校2026 届高三第二次联考化学+答案.docx
- 马工程《刑事诉讼法》(第四版)第一章 课后思考题参考答案.pdf VIP
- 2025年中国化学奥林匹克竞赛福建预赛试题及答案_可搜索.pdf VIP
- 异型盖冲压模具设计.doc VIP
- 建设项目安全设施设计专篇.pdf VIP
- 教科版船的研究3.用沉的材料造船 五年级科学下册教学设计教案(教学反思全).docx VIP
- 新能源有限公司年产10万吨生物质颗粒建设项目安全设施设计专篇.doc VIP
- 奥的斯电梯OTIS-SKY电气原理图.pdf VIP
- 机电设备有限公司年产10万件机械零部件生产线建设项目安全设施设计专篇.doc VIP
- ISO9227-2022(2024)人工大气腐蚀试验(中文版本).pdf
原创力文档

文档评论(0)