How can I remove empty arrays of cell

2 vues (au cours des 30 derniers jours)
Farshid Daryabor
Farshid Daryabor le 16 Avr 2020
Commenté : Stephen23 le 16 Avr 2020
please find attached file, how can I remove empty row of cell arrays. Thanks in advance,
  2 commentaires
Stephen23
Stephen23 le 16 Avr 2020
Modifié(e) : Stephen23 le 16 Avr 2020
"how can I remove empty row of cell arrays"
None of the cells are empty:
>> any(cellfun(@isempty,time))
ans = 0
All of the cells contain a scalar structure (which is inefficient storage: one non-scalar structure would be much better).
Farshid Daryabor
Farshid Daryabor le 16 Avr 2020
I don't understand, what do you mean?
I want just remove '[]' arrays from 'time'

Connectez-vous pour commenter.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 16 Avr 2020
Run this
idx = cellfun(@(x) isempty(x), time);
time(idx) = [];
  2 commentaires
Farshid Daryabor
Farshid Daryabor le 16 Avr 2020
Thanks, it's what I expected
Stephen23
Stephen23 le 16 Avr 2020
No need for an anonymous function:
idx = cellfun(@isempty, time);

Connectez-vous pour commenter.

Plus de réponses (0)

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