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.

답변 (1개)

KSSV
KSSV 2016년 11월 8일
편집: KSSV 2016년 11월 8일

1 개 추천

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..

카테고리

도움말 센터File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2016년 11월 8일

편집:

2016년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by