Convert cell of matrix into one matrix

조회 수: 1 (최근 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개)

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 CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by