how to mix data randomly

I have two data set A and B with both length equal to 40. I want to mix data A and B randomly. how to do it.

Respuestas (1)

KSSV
KSSV el 8 de Nov. de 2016
Editada: KSSV el 8 de Nov. de 2016

1 voto

A = rand(40,1 ); % some random data
B = rand(40,1) ; % some random data
% combining
C = [A ; B] ; % join A and B
C = C(randsample(1:80,80)) ; % shuffle randomly
You can shuffle randomly A, B and merge also..

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Nov. de 2016

Editada:

el 8 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by