Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Khaing Zin Htwe
Khaing Zin Htwe le 30 Juil 2016
Commenté : Khaing Zin Htwe le 31 Juil 2016
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

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 30 Juil 2016
A={4 [] [] []
5 6 [] []
7 8 9 10}
B=A'
idx=~cellfun(@isempty,B)
out=B(idx)
  4 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 31 Juil 2016
Use cell2mat
Khaing Zin Htwe
Khaing Zin Htwe le 31 Juil 2016
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.

Connectez-vous pour commenter.

Plus de réponses (1)

Andrei Bobrov
Andrei Bobrov le 30 Juil 2016
B = A';
out = cat(1,B{:});

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by