pyigal
pyigal

Reputation: 389

Find all-NaN columns in a martix

I have an m x n matrix. I would like to get a logical 1 x n vector where 'True' in the 4'th element indicates that the 4'th column was all NaN elements. What is the fastest way to accomplish that?

Upvotes: 0

Views: 47

Answers (1)

Vahe Tshitoyan
Vahe Tshitoyan

Reputation: 1439

This should do nancols = all(isnan(A), 1)

Upvotes: 4

Related Questions