How to find a certain content with index in cell array by looping

조회 수: 1 (최근 30일)
Dear senior,
I have a cell array like the following code. I want to sort like the following answer . How can I solve this? Help me. Thanks all.
if true
% 4 [] [] []
5 6 [] []
7 8 9 10
Desired Answer: 1x1 cell
4
5
6
7
8
9
10
end

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 7월 30일
A={4 [] [] []
5 6 [] []
7 8 9 10}
B=A'
idx=~cellfun(@isempty,B)
out=B(idx)
  댓글 수: 4
Khaing Zin Htwe
Khaing Zin Htwe 2016년 7월 31일
it does not work well. The result is like 12555555x512. These contents are cell type. I want to convert all these contents to double 512x512 double . How can i do this ,sir. Please help me.

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

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2016년 7월 30일
B = A';
out = cat(1,B{:});

카테고리

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