How to set all elements of a matrix that meet a certain criteria to NaN?

1 visualizzazione (ultimi 30 giorni)
I have a Matrix A with the size of [200 100 20 60]. How do I set all elements larger than 10^20 as NaN?

Risposta accettata

Star Strider
Star Strider il 14 Mar 2018
Try this:
A(A > 1E+20) = NaN;

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by