Effacer les filtres
Effacer les filtres

Removing NaN values in Structure

15 vues (au cours des 30 derniers jours)
Diego Fonseca
Diego Fonseca le 11 Juin 2019
Commenté : Diego Fonseca le 11 Juin 2019
Hello!
I have a struct called "modelo" that contains (among other variables) a numeric variable called "Val", which is 41714x81X29. There are random NaN's scattered throughout the data in this struct and I would like to remove them, creating a new variable without any NaN. I have tried writng:
modelo2 = modelo(~isnan([modelo.Val(:,:,:]));
but it says "Index exceeds matrix dimensions".
Does anyone could helpe me, please?

Réponse acceptée

madhan ravi
madhan ravi le 11 Juin 2019
modelo2 = modelo.Val(~isnan(modelo.Val));
  1 commentaire
Diego Fonseca
Diego Fonseca le 11 Juin 2019
Thanks a lot, Madhan Ravi! It worked fine!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by