mardi 9 février 2021

How to find which column contains only one finite value in MATLAB?

I have a dataset similar to the one below where N columns have some NaNs and one has only one finite value:

X=randn(50,20);
X(randsample(20,10),randsample(20,15)) = NaN;
X([1:13,15:50],17) = NaN;

How do I find with a code column 17, i.e the column that has only one finite value among all the columns?

Thanks!

Aucun commentaire:

Enregistrer un commentaire