hello guys, i have mat file < 15151x723 double > but i want this file with 3 columns only. after 15151 rows i want next 3 columns should come bellow that.same with next 3 columns ...hope you understand...
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Jan
2016 年 2 月 5 日
All such resortings can be performed by:
reshape(permute(reshape()))
In you case this could be:
a = [1 2 3 4 5 6; ...
10 20 30 40 50 60; ...
100 200 300 400 500 600; ...
1000 2000 3000 4000 5000 6000]
sizeA = size(A);
b = reshape(permute(reshape(a, sizeA(1), 3, []), [2, 1, 3]), [], 3);
If this does not match your needs, play with the parameters for reshaping and permuting - there is only a limited number of possible combinations, such that you will find the solution fast.
0 件のコメント
その他の回答 (1 件)
Meghana Dinesh
2016 年 2 月 5 日
Have you tried using reshape?
If
a =
[1 2 3 4 5 6
10 20 30 40 50 60
100 200 300 400 500 600
1000 2000 3000 4000 5000 6000]
Then
b = reshape(a,8,3)
gives:
b =
[1 3 5
10 30 50
100 300 500
1000 3000 5000
2 4 6
20 40 60
200 400 600
2000 4000 6000]
Is this what you want?
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!