Variables corresponding with NaN won't graph
Afficher commentaires plus anciens
So in my code there are two variables being gathered from a plot. b1 does not include the NaN because of the code setting all NaN to zero and then excluding all zero values. But the coresponding value in b2 is still there meaning that it wont graph because there are not an equal amount of values in each list. What is the best way to get around this and exclude the value in b2 as well?
Réponse acceptée
Plus de réponses (1)
the cyclist
le 2 Juin 2023
Modifié(e) : the cyclist
le 2 Juin 2023
1 vote
Without seeing your code or your data, it is difficult to give specific advice. But the gist would be something like this:
- identify the NaN values in b1, e.g. nanb1 = isnan(b1)
- remove the values from b2 that correspond to those NaN values, e.g. b2(nanb1) = []
1 commentaire
William
le 2 Juin 2023
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!