Azzera filtri
Azzera filtri

Delete NaN in arrays in a cell

3 visualizzazioni (ultimi 30 giorni)
Rudolf
Rudolf il 6 Mag 2021
Commentato: Rudolf il 6 Mag 2021
I have a 1x20 cell containing 20 arrays of double. Some of these arrays contains NaN. How can i delete them?
(If an array of double with 1 NaN is 101 long, it should be 100 after) Hope i explained it good enough.

Risposta accettata

KSSV
KSSV il 6 Mag 2021
Let C be your cell array;
iwant = C ;
for i = 1:length(C)
idx = isnan(C{i}) ;
iwant{i} = C{i}(~idx) ;
end

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by