how to reorder the data

i have some values
G1 G2 G3 G4 G5
1 2 4 5 9 0 2 3 6 7
2 3 6 7 1 2 4 5 8 9
I want to reorder the group randomly ,can u tell how to do please

 採用された回答

Andrei Bobrov
Andrei Bobrov 2011 年 10 月 31 日

0 投票

G = [1 2 4 5 9 0 2 3 6 7
2 3 6 7 1 2 4 5 8 9]
G1 = mat2cell(G,2,2*ones(size(G,2)/2,1))
Gout = cell2mat(G1(randperm(numel(G1))))
or
G1 = reshape(G,4,[])
G2 = G1(:,randperm(size(G1,2)))
Gout = reshape(G2,2,[])

4 件のコメント

FIR
FIR 2011 年 10 月 31 日
G = [1 2 4 5 9 0 2 3 6 7
2 3 6 7 1 2 4 5 8 9]
if G has more rows say 990...please tell how to process
Andrei Bobrov
Andrei Bobrov 2011 年 10 月 31 日
n = size(G,1);
G1 = reshape(G,n*2,[]);
G2 = G1(:,randperm(size(G1,2)));
Gout = reshape(G2,n,[])
FIR
FIR 2011 年 10 月 31 日
thanks anrei
FIR
FIR 2011 年 10 月 31 日
anrei there are 4026 datas i want to take 2data from top 100 to genarate FCI,can u tell how to process please

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

タグ

質問済み:

FIR
2011 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by