How can I assign two sets of values randomly among two other sets?
1 回表示 (過去 30 日間)
古いコメントを表示
I have two sets a and b, these sets of values to another two sets s1 and s2. I tried for randperm but i am getting errors. Thanks in advance.....
0 件のコメント
回答 (2 件)
KSSV
2016 年 10 月 7 日
編集済み: KSSV
2016 年 10 月 7 日
Using randsample
% Create two sets
a = rand(10,1) ;
b = rand(20,1) ;
% Assign to s1, s2 randomly
s1 = randsample(a,length(a)) ;
s2 = randsample(b,length(b)) ;
Using randperm
% Create two sets
a = rand(10,1) ;
b = rand(20,1) ;
% Assign to s1, s2 randomly
s1 = a(randperm(length(a))) ;
s2 = b(randperm(length(b))) ;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で ROC - AUC についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!