Home License -- for personal use only. Not for government, academic, research, commercial, or other organizational use. 13-May-2025 16:52:59 quad_monte_carlo_test(): MATLAB/Octave version 9.11.0.2358333 (R2021b) Update 7 quad_monte_carlo() is an interactive program which uses n random samples to estimate the integral of a function f(x) over the interval [a,b]. Estimate integral ( 0.000000 < x < 1.000000 ) x.^2 dx quad_monte_carlo: n = 100, integral estimate q = 0.3661149362346841 Estimate integral ( 0.0 < x < 2.0 ) sqrt(x) dx quad_monte_carlo: n = 1000, integral estimate q = 1.864765610737556 Estimate integral ( 0.0 < x < 2.0 ) humps(x) dx quad_monte_carlo: n = 1, integral estimate q = -6.620446448091433 quad_monte_carlo: n = 2, integral estimate q = 4.949749444936288 quad_monte_carlo: n = 4, integral estimate q = 0.8163777562460686 quad_monte_carlo: n = 8, integral estimate q = 18.71704042764326 quad_monte_carlo: n = 16, integral estimate q = 49.40001761039119 quad_monte_carlo: n = 32, integral estimate q = 28.83145397274741 quad_monte_carlo: n = 64, integral estimate q = 26.0172784655622 quad_monte_carlo: n = 128, integral estimate q = 19.78716691143935 quad_monte_carlo: n = 256, integral estimate q = 32.65448495217483 quad_monte_carlo: n = 512, integral estimate q = 26.80145919801749 quad_monte_carlo: n = 1024, integral estimate q = 27.53238278852324 quad_monte_carlo: n = 2048, integral estimate q = 28.87684144749323 quad_monte_carlo: n = 4096, integral estimate q = 29.77098650155325 quad_monte_carlo: n = 8192, integral estimate q = 28.76128249946415 quad_monte_carlo: n = 16384, integral estimate q = 29.43056509410382 quad_monte_carlo: n = 32768, integral estimate q = 29.5861781074986 quad_monte_carlo: n = 65536, integral estimate q = 29.19892111386281 quad_monte_carlo: n = 131072, integral estimate q = 29.23190133151778 quad_monte_carlo: n = 262144, integral estimate q = 29.28579187437449 quad_monte_carlo: n = 524288, integral estimate q = 29.29021917550511 quad_monte_carlo: n = 1048576, integral estimate q = 29.29415594327526 quad_monte_carlo_test(): Normal end of execution. 13-May-2025 16:52:59