Exclude NaN cells from a cell array
Ältere Kommentare anzeigen
I have a cell array of n number of rows and one column. Each row contains an array.
I want to exclude these NaN cells or copy this cell array in a new one with skipping the NaN cells in the original.

Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 6 Sep. 2020
Bearbeitet: David Hill
am 6 Sep. 2020
c=[];
for k=1:length(yourCell)
if ~isempty(yourCell{k})
c=[c,k];
end
end
newCell=yourCell(c);
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!