Splitting 1 column array
古いコメントを表示
Hi all,
I have various column matrices with varying number of elements from 38-202. I want to split each matrix into 5 small matrices each containing the same number of elements. The distribution of numbers into each can be random. If the original matrix has more elements, some can be ignored as well. Like for example if the original matrix has 204 elements and I want to split it into 5 matrices. So only 200 elements can be shuffled and 4 need to be ignored.
Is there any function in MATLAB I can use?
Nancy
1 件のコメント
Azzi Abdelmalek
2012 年 8 月 15 日
are the matrix square?
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2012 年 8 月 15 日
example
A=rand(102,2);B=A(1:100,:)
result=reshape(B,5,8,5)
1 件のコメント
Walter Roberson
2012 年 8 月 16 日
Not quite, as that does not do any shuffling.
カテゴリ
ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!