RANGE = pgmWrite(MTX, FILENAME, RANGE, TYPE, COMMENT) Write a MatLab matrix to a pgm (graylevel image) file. This format is accessible from the XV image browsing utility. RANGE (optional) is a 2-vector specifying the values that map to black and white, respectively. Passing a value of 'auto' (default) sets RANGE=[min,max] (as in MatLab's imagesc). 'auto2' sets RANGE=[mean-2*stdev, mean+2*stdev]. 'auto3' sets RANGE=[p1-(p2-p1)/8, p2+(p2-p1)/8], where p1 is the 10th percentile value of the sorted MATRIX samples, and p2 is the 90th percentile value. TYPE (optional) should be 'raw' or 'ascii'. Defaults to 'raw'.