reshape 3d matrix

1 回表示 (過去 30 日間)
Nirit Alkalay
Nirit Alkalay 2017 年 9 月 3 日
回答済み: Walter Roberson 2017 年 9 月 3 日
I have image matrix A (3dim matrix) which is (size1 x size2 x size3). (size1 x size2) is the image and size3 is number of images. I want to reshape matrix A so it will be ( (size1*size2) X 1 X size3 ) matrix. meaning it each image will turn to (size1* size2) column vector, and I will have size3 images like this. (so it will still be 3dim matrix) I know how to do this in a for loop running on size3, but is there a better way to do this?
Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 9 月 3 日
newA = reshape(A, [], 1, size(A,3));

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by