replace all the array with NaN if any of the value is NaN
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i am working with some data and the condition i want to set is that, if in the data there is NaN value in any column i want to replace that whole column with NaN values. following is a screen shot of my data structure. where i am working on the third dimension (144) of the data. Thanks in advance for help
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167575/image.jpeg)
0 commentaires
Réponse acceptée
Plus de réponses (1)
Jan
le 27 Sep 2017
Without a loop and bsxfun:
A = randi(9, 4, 3, 2);
A(6) = NaN;
A(:, any(isnan(A), 1)) = NaN;
1 commentaire
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!