how to find a block containing NaN in cell
Ältere Kommentare anzeigen
hi sir,i have cell of 10*10 cell which look like below double <5x10 double> <5x10 double> <5x10 double> <5x10 double> <5x10 double> <5x10 double> <5x10 double> <5x10 double>
i have to find in which 5x10 double NaN is present
1 Kommentar
Jan
am 7 Mai 2015
The description of the data is not clear. Please post some code, which create a relevant set of test data - with small arrays.
Akzeptierte Antwort
Weitere Antworten (1)
Jan
am 7 Mai 2015
Perhaps:
x = {1:5, 2:6, [3,4,NaN,6,7]};
hasNaN = false(size(x));
for ix = 1:numel(x)
hasNaN(ix) = any(isnan(x{ix}));
end
A CELLFUN could do this also, but a loop is easier to understand and fast to write. Please explain at first if my guess matches your data.
1 Kommentar
POOJA KJ
am 7 Mai 2015
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!