replace "inf " with a value
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi all. i have a 8192*300 matrix. some of its elements are "inf". i want to replace these values with average of cells before and after them. could you give me an advice? thank you very much
3 commentaires
per isakson
le 14 Fév 2015
Modifié(e) : per isakson
le 14 Fév 2015
Replace inf by nan and use inpaint_nans by John D'Errico or Inpaint over missing data in 1-D, 2-D, 3-D,... N-D arrays by Damien Garcia
Réponses (1)
Stephen23
le 14 Fév 2015
Modifié(e) : Stephen23
le 14 Fév 2015
Use TriScatteredInterp or scatteredInterpolant (newer MATLAB versions). You can pass these vectors of your data points excluding the Inf values, and then they will interpolate new points at the grid locations that you specify.
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!