hs923a function for Monte Carlo Approx

조회 수: 3 (최근 30일)
gracias claude
gracias claude 2021년 4월 11일
답변: Andreas Apostolatos 2021년 4월 11일
I found this function online and getting an error when using halton. Has the function changed in Matlab if so what do I use now ?
function hs923a(n)
x=2*halton(2,n)-1;
y=2*halton(3,n)-1;
count=1;
for i=1:n
if x(i)>=-1
if y(i)<=1
if 13*(x(i)^2)+34*x(i)*y(i)+25*y(i)^2 <= 1
count=count+1;
end
end
end
end
disp(['Number of points inside the ellipse =', num2str(4*count)])
end

답변 (1개)

Andreas Apostolatos
Andreas Apostolatos 2021년 4월 11일
Hello,
Function 'halton' does not appear to be a built-in MATLAB function. However, there is below a link to a custom MATLAB function with the name 'halton' that can be used in conjuction with your program,
which is part of a Gitlab repository.
I hope this helps.
Kind Regards,
Andreas

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by