stratified_random.m
来自「This a collection of MATLAB functions fo」· M 代码 · 共 12 行
M
12 行
function s = stratified_random(N)
%function s = stratified_random(N)
%
% Generate N uniform-random numbers stratified within interval (0,1).
% The set of samples, s, are in ascending order.
%
% Tim Bailey 2003, modified 2005.
k = 1/N;
di = 0:k:(1-k); % deterministic intervals
s = di + rand(1,N) * k; % dither within interval
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?