hs923a function for Monte Carlo Approx
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Mathematics and Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!