I want to do bootstrap analysis by using 20*1 matrix.

1 次查看(过去 30 天)
I want to draw 500 samples from the 20*1 matrix (20 pairs of observations).
In this case, what codes do I have to use?

采纳的回答

the cyclist
the cyclist 2022-10-27
One way is
% Pretend input data
M = rand(20,1);
idx = randi(20,500,1);
samples = M(idx);

更多回答(1 个)

the cyclist
the cyclist 2022-10-27
If you have the Statistics and Machine Learning Toolbox, you can do
% Pretend input data
M = rand(20,1);
samples = randsample(M,500,true);

类别

Help CenterFile Exchange 中查找有关 Descriptive Statistics and Visualization 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by