File Exchange

image thumbnail

Monte Carlo Estimation Examples with Matlab

version (5.23 KB) by Hristo Zhivomirov
A set of examples of Monte Carlo numerical estimation methods.


Updated 04 Jun 2020

View Version History

View License

The Matlab codes presented here are a set of examples of Monte Carlo estimation methods – a class of computational algorithms that rely on repeated random sampling or simulation of random variables to obtain numerical results.

Eight examples are given:
MonteCarloCoin.m – estimation of the probability to obtain 8 or more heads, if a coin is tossed 10 times;
MonteCarloDice.m – estimation of the probability to obtain 6 & 6, if two dice are flipped;
MonteCarloInt.m – estimation of the integral of abs(sin(x)), for x = 0 .. 2*pi;
MonteCarloPi.m – estimation of the Pi value;
MonteCarloPower.m – estimation of the worst-case resistor's power dissipation;
MonteCarloSqrt2.m – estimation of the sqrt(2) value;
MonteCarloVol.m – estimation of the unit sphere volume;
MonteCarloVol_visualization.m – a visualization of the MonteCarloVol.m example.

The codes are based on the theory described in:

[1] I. Sobol. A primer for the Monte Carlo method. Boca Raton, CRC Press, 1994.

Cite As

Hristo Zhivomirov (2021). Monte Carlo Estimation Examples with Matlab (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Anthony Dave

vivek vaibhav

dwi kurniawan

Fu Dongqin

Hicham Belh

Georgi Georgiev


MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!