typestar

Free waves in Igor Pro

A free wave has no name in the experiment and disappears when nothing refers to it.

Function/WAVE Normalized(WAVE src)
    Duplicate/FREE src, out

    WaveStats/Q out
    if (V_max == V_min)
        out = 0
        return out
    endif

    out = (out - V_min) / (V_max - V_min)
    return out
End

How it works

  1. /FREE makes one; it belongs to the function, not to a data folder.
  2. It is how a helper returns a wave without leaving litter behind.
  3. Duplicate/FREE takes a scratch copy for the same reason.

Keywords and builtins used here

The run, in numbers

Lines
12
Characters to type
174
Tokens
43
Three-star pace
80 tpm

At the three-star pace of 80 tokens a minute, this run takes about 32 seconds.

Type this snippet

Step 3 of 4 in Wave assignment, step 3 of 16 in Waves & analysis.

← Previous Next →