フィルターのクリア

How to join several matrices into one matrix?

1 回表示 (過去 30 日間)
Martha
Martha 2014 年 2 月 24 日
コメント済み: Martha 2014 年 2 月 24 日
Hello,
I have a variable in a form of a matrix but repeat several times, 4794 rows, 1 column and 588 files, e.g. 4794x1x588 double. However, I want a matrix that join all the columns in the same matrix, having 4794 rows and 588 columns all in the same matrix, like this: 4794x588 double.
I'll appreciate any help. Martha

採用された回答

Mischa Kim
Mischa Kim 2014 年 2 月 24 日
編集済み: Mischa Kim 2014 年 2 月 24 日
Martha, check out the squeeze command. An example:
Y(:,:,1) = [1; 2];
Y(:,:,2) = [3; 4];
Y(:,:,3) = [5; 6];
size(Y)
Z = squeeze(Y)
size(Z)
  1 件のコメント
Martha
Martha 2014 年 2 月 24 日
Thank's Mischa, it worked well!

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

その他の回答 (1 件)

Iain
Iain 2014 年 2 月 24 日
Either of these will do what you've asked.
matrix = reshape(matrix,4794,588);
matrix = permute(matrix,[1 3 2]);
  1 件のコメント
Martha
Martha 2014 年 2 月 24 日
Thank's Ian

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by