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?
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (3)
madhan ravi
el 21 de Sept. de 2019
Editada: madhan ravi
el 21 de Sept. de 2019
a(isinf(a)|isnan(a))=0 % replaces with zero
David Hill
el 21 de Sept. de 2019
A(~isnan(A)&A~=Inf);
4 comentarios
David Hill
el 21 de Sept. de 2019
If you want to replace with 0.
a(isnan(a))=0;
a(a==Inf)=0;
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!