Printing in Igor Pro
Print for a quick look, printf when the shape of the output matters.
Function ShowStats(WAVE w)
WaveStats/Q w
Print "points:", V_npnts
Printf "mean %.3f, sd %.3f\r", V_avg, V_sdev
Printf "range %g to %g\r", V_min, V_max
String summary
sprintf summary, "%s: n=%d", NameOfWave(w), V_npnts
Print summary
End
How it works
Printtakes a comma-separated list and formats it for you.Printftakes a format string and needs the trailing\\ritself.sprintfwrites into a string instead of the history.
Keywords and builtins used here
EndFunctionNameOfWavePrintPrintfStringWAVEWaveStatssprintf
The run, in numbers
- Lines
- 12
- Characters to type
- 238
- Tokens
- 41
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 33 seconds.
Step 3 of 4 in Text, step 14 of 18 in Language basics.