Combine two cell arrays
조회 수: 1 (최근 30일)
이전 댓글 표시
I have two cell arrays:
X{1,1}=[18;21;17;20;19];
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
How to create new cell array like this:
Z=[X{1,1}(:,:) X{1,2}(:,:)]
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 8월 10일
편집: Azzi Abdelmalek
2013년 8월 10일
Maybe you want
X=[num2cell([18;21;17;20;19]) cellstr(['m';'f';'m';'m';'f'])]
댓글 수: 0
추가 답변 (1개)
Andrei Bobrov
2013년 8월 10일
편집: Andrei Bobrov
2013년 8월 10일
X{1,1}=num2str([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
strcat(X{:})
OR
X{1,1}=num2cell([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
[X{:}]
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!