ZhengguanLi / monte-carlo

Calculate the unit quarter area using Monte Carlo method in Matlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monte Carlo

Using Monte Carlo method to calculate the unit quarter circle area(Pi/4) in Matlab.

Getting started

Usage

  • Set the sample size in monteCarlo.m

    2 totalPointCounts = [100, 1000, 1000]
  • Run monteCarlo.m

Testing

Sample size:

totalPointCounts = [100, 1000, 1000]

100 points:

100 points

1000 points:

1000 points

10000 points:

10000 points

Result:

result

About

Calculate the unit quarter area using Monte Carlo method in Matlab


Languages

Language:MATLAB 100.0%