4 lines
90 B
Text
4 lines
90 B
Text
|
|
function result = montepi(n)
|
||
|
|
result = sum(rand(1,n).^2+rand(1,n).^2<1)/n*4;
|
||
|
|
endfunction
|