
Checking if wave contains any nan value

ankit7540
Hello all,
The function
numtype(num)
allows to check if the specific number `num` is a nan.
I am facing a use case where I need to make sure that the wave I am processing does not contain any `nan` value. A basic way is to check every value using a for-loop for this. However, my wave is large (over 10,000 points).
Is there a faster way to do this ?
Thank you.
Use WaveStats:
August 25, 2025 at 02:33 am - Permalink
You did not indicate whether the wave is 1D or 2D. Also, if you want to use the remaining data,the following may be of use:with MatrixOP:
August 25, 2025 at 03:46 am - Permalink
Thank you. That is neat.
August 25, 2025 at 04:39 am - Permalink
If you are going to use WaveStats I recommend using:
WaveStats/M=1 myWave.
The flag tells Igor to skip the computation of the second and higher statistical moments.
Another efficient way to get the answer is:
print numtype(sum(myWave))
August 25, 2025 at 01:31 pm - Permalink