comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Mean = NaN if NaN present
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Mean = NaN if NaN present [message #91770 is a reply to message #91766] Tue, 25 August 2015 01:11 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
How about defining a function to do that?

function mn, subarray
if (total(finite(subarray)) eq n_elements(subarray)) then return, mean(subarray) else return, !Values.F_NAN
end

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Unable to allocate memory: to make an array. Not enough space
Next Topic: how to prevent NaNs

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:07:16 PDT 2025

Total time taken to generate the page: 0.88150 seconds