フィルターのクリア

Concatenation of 3D Array into 2D Array

18 ビュー (過去 30 日間)
Elizabeth
Elizabeth 2014 年 2 月 17 日
コメント済み: Mariana 2017 年 11 月 22 日
Sorry if this is a bit of an elementary issue, but I could use some help concatenating a 3D matrix (20x12x30), A, into a 2D matrix (20x360),B, so that
B(:,1:12) = A(:,:,1)
B(:,13:24) = A(:,:,2)
etc.
I'm hoping to do this outside of a loop to save some computing time.

採用された回答

Image Analyst
Image Analyst 2014 年 2 月 17 日
Try this:
B = reshape(A, [20, 360])
  1 件のコメント
Elizabeth
Elizabeth 2014 年 2 月 18 日
This worked! Thank you!

サインインしてコメントする。

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 17 日
A=rand(20,12,30)
B=A(:,:)
  1 件のコメント
Mariana
Mariana 2017 年 11 月 22 日
This concatenate horizontally. How to concatenate vertically?

サインインしてコメントする。

カテゴリ

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