필터 지우기
필터 지우기

how to mix data randomly

조회 수: 5 (최근 30일)
Jay Hanuman
Jay Hanuman 2016년 11월 8일
편집: KSSV 2016년 11월 8일
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일
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..

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by