Adding intentionally NaN values to a Wave

I know this is a weird question but I am trying to format data in a very specific way. For the particular analysis, I need data grouped together in one wave, separated by a blank space. In a numerical wave, when adding a blank space, via insertpoints, it just fills the value with "0" by default. I intend to save it as .txt from igor and want those divisions of data to just show up as blank lines.

ex.

1

2

3

4

5

 

6

7

8

9

10

 

11

12

13

14

.

.

.

 

thank you!

in Igor 8 you can use the /V flag to specify the value for inserted points:

InsertPoints /V=NaN beforeElement, numElements, waveName

 

In reply to by Dolbash

Then you must set the value of your added point to NaN after insertion.

InsertPoints N, 1, wave0
wave0[N]=NaN

To add a NaN to the end of a wave

wave0[numpnts(wave0)]={NaN}

 

Wow, So it is that easy. I could have sworn that I tried that first. O well, Thank you!

@tony: Now that's a bummer I did not know what you can append to waves like that. For the curious ones this is explained in

DisplayHelpTopic "Indexing with an index wave"

but also requires you to realize that the indexing wave can also just be one index. And

wave0[inf] = {NaN}

works here as well even with rtGlobals=3.

@thomas_braun: This is an example of why AG can't change the behavior of WaveStats/RMD={inf, nan} :)

(For those wondering, this is a cryptic reference to a recent tech support incident)

@johnweeks: I'm coding it like that because this is currently the way you do igor programming.

But I would like to see a move like from C++98 to C++11 in Igor as well. Or to rephrase that, once you offer rtGlobals=4 or an equivalent I'll use that and adapt my code.