how to mix data randomly

7 ビュー (過去 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 Center および File ExchangeRandom Number Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by