Why delete columns whose output value is NaN not correct?

2 次查看(过去 30 天)
Why delete columns whose output value is NaN not correct?
Why delete columns whose output value is NaN not correct?
2400*10350
(2400 images) (10350 features)
clear all
load ('Vactor1-100')
A=FeatureVector;
Out1 = A(:,~any(isnan(A),1));
my output is [] WHY?
  2 个评论
Vladimir Sovkov
Vladimir Sovkov 2019-12-31
Probably, all the columns of your matrix contain at least one NaN each...
jenifer Ask
jenifer Ask 2019-12-31
Question 1:
How do I delete the values of all rows that are NaN?
Question 2:
How to replace 0 values of all rows that are NaN?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2019-12-31
1)
Out1 = A(~any(isnan(A),2), :);
2)
Out1 = fillmissing(A, 'constant', 0);

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by