Converting a 2D Array into a 3D Array
7 ビュー (過去 30 日間)
古いコメントを表示
Hi, Hope someone can help, I have a 2D array of 1062 x 300 doubles in the format of Xn Yn Zn and I am trying to convert it into a 1062 x 100 x 3 matrix where each of the 3 dimensional points are collected together.
2 件のコメント
James Tursa
2017 年 12 月 11 日
編集済み: James Tursa
2017 年 12 月 11 日
How is the Xn, Yn, Zn stored in your 2D array? I.e., are X1, Y1, Z1 stored in your array(1,1:3), or are they stored in your array(1,1), array(1,101), array(1,201)? Or ...?
回答 (1 件)
Stephen23
2017 年 12 月 11 日
Perhaps:
reshape(M,[1062,100,3])
or
permute(reshape(M,[1062,3,100]),[1,3,2])
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!