필터 지우기
필터 지우기

cell to matrix conversion

조회 수: 1 (최근 30일)
John
John 2013년 5월 29일
I have following cell matrix X(1x4):
[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]
how do i split them into four seperate matrices?

채택된 답변

Wayne King
Wayne King 2013년 5월 29일
Then as Azzi says, just extract them in a for loop
X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
for ii = 1:4
size(X{ii}) % do whatever you want here
end

추가 답변 (1개)

Wayne King
Wayne King 2013년 5월 29일
편집: Wayne King 2013년 5월 29일
X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
[A,B,C,D] = deal(X{:});
Note that A and B are empty as expected.
  댓글 수: 4
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 29일
Then just use
X{1}
X{2}
X{3}
X{4}
John
John 2013년 5월 29일
thankyou!

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by