Convert cell of matrix into one matrix

2 ビュー (過去 30 日間)
Alejandro Fernández
Alejandro Fernández 2021 年 1 月 28 日
コメント済み: Fangjun Jiang 2021 年 1 月 28 日
Hi, does someone know how can I convert cell A into matrix B as the exameple bellow?
% Where A is:
A{1} = [1 2 3;4 5 6];
A{2} = [7 8 9;10 11 12;13 14 15];
% And B should be:
B = [1 2 3
4 5 6
7 8 9
10 11 12
13 14 15];
Thank you so much for all your help.

採用された回答

madhan ravi
madhan ravi 2021 年 1 月 28 日
B = cat(1, A{:})
  1 件のコメント
Alejandro Fernández
Alejandro Fernández 2021 年 1 月 28 日
It's perfect! Thank you so much!!!

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

その他の回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2021 年 1 月 28 日
cell2mat()
  2 件のコメント
Alejandro Fernández
Alejandro Fernández 2021 年 1 月 28 日
You may have seen it before I edited the response. I had posted an example that wasn't the right one.
Fangjun Jiang
Fangjun Jiang 2021 年 1 月 28 日
It's a matter of cell2mat(A) or cell2mat(A'). It's better to follow a tip to learn something on your own than getting a direct answer.

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by