Montecarlo simulation

estimation of pi, using montecarlo method
1.5K Downloads
Updated 11 Jun 2008

No License

%Draw a square of area 1 on the ground, then inscribe a circle within it.
%Now, scatter some small objects (for example, grains of rice or sand) throughout the square.
%If the objects are scattered uniformly, then the proportion of objects within the circle vs objects within the square should be approximately ?/4,
%which is the ratio of the circle's area to the square's area.
%Thus, if we count the number of objects in the circle, multiply by four,
%and divide by the number of objects in the square, we get an approximation to pi.

Cite As

Clement Bernard (2024). Montecarlo simulation (https://www.mathworks.com/matlabcentral/fileexchange/20235-montecarlo-simulation), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Chemistry in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0