Why this little piece of Code don´t work?
purozongo
function refill(onda)
wave onda
variable i,n
do
if (onda[i]==NaN)
print "hola!" //Debug
onda[i]=1
n=n+1 //NaN´s Counter
endif
i=i+1
while (i<=numpnts(onda))
print n
end
wave onda
variable i,n
do
if (onda[i]==NaN)
print "hola!" //Debug
onda[i]=1
n=n+1 //NaN´s Counter
endif
i=i+1
while (i<=numpnts(onda))
print n
end
but it can´t detect the NaN, what i´m doig wrong?
wave onda
variable i,n
do
if (numtype(onda[i])==2)
print "hola!" //Debug
onda[i]=1
n=n+1 //NaN´s Counter
endif
i=i+1
while (i<=numpnts(onda))
print n
end
thanks anyway.
greetings.
September 7, 2010 at 09:56 am - Permalink
That's not your point, I know, but FYI just in case!
HTH,
J
September 7, 2010 at 02:13 pm - Permalink
onda = numtype(onda)==2 ? 1 : onda
September 7, 2010 at 02:19 pm - Permalink
onda = numtype(onda)==2 ? 1 : onda
[/quote]it´´s a good solution, but replace the NaNs with "1", but i want to delete the NaNs.
Thanks awirsing
October 30, 2010 at 06:17 am - Permalink
I see. Try
extract/o onda, onda, numtype(onda)!=2
instead.A
October 30, 2010 at 10:12 am - Permalink
WaveTransform zapNaNs, <wave>
October 30, 2010 at 10:48 am - Permalink
November 9, 2010 at 06:11 am - Permalink