convert column inside a cell

조회 수: 4 (최근 30일)
neamah al-naffakh
neamah al-naffakh 2017년 1월 10일
댓글: the cyclist 2017년 1월 10일
Hi everyone,
I have a cell (called AA ) that contains 1 row * 36 columns (as shown in the attached image)
As we could see that each column in that cell contains 3 values ( means inside each column there are 1*3)
I need to have an array that has 36 Rows * 3 columns
For example,
the first column in the Cell will be converted into 1 Row and three columns, the second column in the Cell will be converted in the same way and finally add all of them together in order to generate an array that contains 36 Rows and 3 Columns
as shown in this example
-1.48247427405830e-15 0.185513882360673 -0.185513882360676
-9.59200039657764e-16 0.211729497802758 -0.211729497802760
3.69087930153418e-16 0.224791092084074 -0.224791092084073
Really appreciate any help
Regards.

채택된 답변

the cyclist
the cyclist 2017년 1월 10일
I think this does what you want
reshape(cell2mat(AA'),36,3)

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 10일
This can be done much more simply as
vertcat(A{:})
  댓글 수: 1
the cyclist
the cyclist 2017년 1월 10일
That's twice in one day that I've been schooled by Walter.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by