Delete NaN in arrays in a cell

5 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by