フィルターのクリア

Struct Field to Matrix large dataset

3 ビュー (過去 30 日間)
Avik Mahata
Avik Mahata 2021 年 10 月 8 日
回答済み: Dave B 2021 年 10 月 8 日
I have a strucure which has a value of the field, 20000x5x100, what it means that it has a set of 100 matrices which has, 20000 rows and 5 columns. How do I convert it to a 2000000x5 matrix printing all the 100 sets in the sequence it has been saved in the structure?

採用された回答

Dave B
Dave B 2021 年 10 月 8 日
You can use reshape but you may wish to use permute first to get things in the right order:
a=cat(3,[1 2;3 4],[5 6; 7 8])
a =
a(:,:,1) = 1 2 3 4 a(:,:,2) = 5 6 7 8
reshape(permute(a,[1 3 2]),[],2)
ans = 4×2
1 2 3 4 5 6 7 8

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by