Waves know their axis in Igor Pro
The point number p is not the x value: SetScale is what ties a wave to real units.
Make/O/N=200/D signal
SetScale/P x, 0, 0.001, "s", signal
signal = exp(-x / 0.05) * sin(2 * pi * 60 * x)
SetScale d, 0, 0, "V", signal
Variable start = DimOffset(signal, 0)
Variable step = DimDelta(signal, 0)
Print start, step, WaveUnits(signal, 0)
How it works
SetScale/Psets a starting x and a step;/Isets the first and last.- In a wave assignment
xis the scaled position andpis the point index. DimOffsetandDimDeltaread the scaling back out.
Keywords and builtins used here
DimDeltaDimOffsetMakePrintSetScaleVariableWaveUnitsexppisin
The run, in numbers
- Lines
- 9
- Characters to type
- 250
- Tokens
- 77
- Three-star pace
- 70 tpm
At the three-star pace of 70 tokens a minute, this run takes about 66 seconds.
Step 2 of 4 in Waves, step 2 of 18 in Language basics.