# Fill all points in a wave with a certain value? Is it possible to fill a wave completely with a certain value without using a loop?

For example after performing `Make /O /N=5`, is there a way (besides a loop) to assign "nan" or "0" to all points in the wave?

Greets,
Peter
`Make/O/N=5 wave0=NaN`
`Make/O/N=5 wave0=0`
DisplayHelpTopic "Waves"
and in particular,
DisplayHelpTopic "Waveform Arithmetic and Assignment"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
`Make/O/N=5 wave0=NaN`
`Make/O/N=5 wave0=0`
DisplayHelpTopic "Waves"
and in particular,
DisplayHelpTopic "Waveform Arithmetic and Assignment"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com

Hello John

I'm in a similar problem.

I need to make a wave with same number points as the other one, so I use Make/O/N=(numpnts(wave0)) wave1

Now I need all points in the new wave as integers as 1,2,3.....
How could I make it?

Thank you so much.

hegedus wrote:
If your new wave has the default scaling, i.e. start at 0 and delta of 1.

then:

Newwave = x

will populate it with values 0,1,2,3,4.

if you want the first value as 1

Newwave = x+1

gives 1,2,3,4,5

For some reason, when called inside of the function, this gives me a wave filled with ones (or with twos if x+1 is used) but called from the command window it works ok. What am I missing here?