Effacer les filtres
Effacer les filtres

How can I deleate or replace with a 0 all the Nan, Inf anf -Inf values in a time series from the biggining to the end?

17 vues (au cours des 30 derniers jours)
Ive got a time series from Simulink that changes its size every time I run the simulation and I want to get rid of all the Nan anf Inf values.
Any idea of how I can do that?

Réponses (3)

madhan ravi
madhan ravi le 21 Sep 2019
Modifié(e) : madhan ravi le 21 Sep 2019
a(isinf(a)|isnan(a))=0 % replaces with zero

David Hill
David Hill le 21 Sep 2019
A(~isnan(A)&A~=Inf);
  4 commentaires

Connectez-vous pour commenter.


Stephen23
Stephen23 le 8 Juin 2021
Simpler:
a(~isfinite(a)) = 0;

Catégories

En savoir plus sur MATLAB 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!

Translated by