#pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 // Use modern global access method and strict wave access. macro wave2image(prefix, dX, Xi, Xf) string prefix="Sample_" string suffix="_y" variable dX=2 // Example of partition // Cannot create image if one of the following values is odd or there are missing waves in between variable Xi=-10 variable Xf=62 variable nE, nX Silent 1;PauseUpdate nE=numpnts($(prefix+num2str(Xi)+suffix)) // Identical scaling for the 1D waves nX= abs((Xf-Xi)/dX) make/O/N=(nX, nE) $(prefix+"Image"+suffix) variable i, j, k i=Xi k=0 do print i j=0 do $(prefix+"Image"+suffix)[k][j]=$(prefix+num2str(Xi)+suffix)[j] j+=1 while (j