How can I run the datasample function 500 times and record each output within a cell array?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nickolai Martonick
el 11 de Nov. de 2022
Comentada: Nickolai Martonick
el 11 de Nov. de 2022
I have a matrix size 101x8 and would like to randomly sample that data 500 times.
My code for sampling and replacing is below. I would like to have Y be a cell array with 500 randomly sampled matrices. Thank you for your help.
Y = datasample(EMG,size(EMG,1))
0 comentarios
Respuesta aceptada
Jan
el 11 de Nov. de 2022
Result = zeros([size(EMG), 500]);
for k = 1:500
Result(:, :, k) = datasample(EMG,size(EMG,1));
end
Más respuestas (0)
Ver también
Categorías
Más información sobre NaNs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!