who i can extract which row hasn't 'NaN' vector
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello, i wrote this code:
damii(sac,xal)=isnan(1./R(sac,xal))
so who i can extract which row hasn't 'NaN' vector
0 commentaires
Réponse acceptée
dpb
le 23 Mai 2015
See
doc isfinite % instead
or ~isnan()
You've written an expression for an individual element of dmii unless sac and/or xal are vectors (I'm guessing not?).
To get the row of an array, use
idx=~any(isnan(dmii),2); % column vector for no NaNs in row
res=dmii(idx,:); % select those rows.
You can, if don't need the locations for other purposes wrap the reference directly and eliminate the temporary--
res=dmii(~any(isnan(dmii),2);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!