?? gethalton.m
字號:
function Seq = GetHalton(HowMany, Base)
Seq = zeros(HowMany,1);
NumBits = 1+ceil(log(HowMany)/log(Base));
VetBase = Base.^(-(1:NumBits));
WorkVet = zeros(1,NumBits);
for i=1:HowMany
% increment last bit and carry over if necessary
j=1;
ok = 0;
while ok == 0
WorkVet(j) = WorkVet(j)+1;
if WorkVet(j) < Base
ok = 1;
else
WorkVet(j) = 0;
j = j+1;
end
end
Seq(i) = dot(WorkVet,VetBase);
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -