モンテカルロ法による円周率の計算

N = 10000;
x = rand(N,1);
y = rand(N,1);
count = sum(x.*x + y.*y < 1);
est_pi = 4*(count / N);



MARUI Atsushi
2024-04-24