assume that a={[1 2 3],[2 3 4;1 2 3]} I want to convert a into a=[1 2 3;2 3 4;1 2 3]. Is there any easy way? thanks

 채택된 답변

Stephen23
Stephen23 2016년 2월 12일

0 개 추천

>> a={[1 2 3],[2 3 4;1 2 3]}
a =
[1x3 double] [2x3 double]
>> vertcat(a{:})
ans =
1 2 3
2 3 4
1 2 3

추가 답변 (1개)

Kiran
Kiran 2016년 2월 12일

0 개 추천

Hi Song,
You can use 'cat' command to concatenate array according to your need.
m = cat(1,a{1},a{2})
Above command will concatenate the array 'a' along vertical direction as you need.

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2016년 2월 9일

답변:

2016년 2월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by