Contains two procedures to convert a two-dimensional matrix of Z values into three separate X, Y, and Z waves. MatrixToXYZ converts the entire matrix into X, Y, and Z waves and MatrixToXYZRange converts a given XY domain into X, Y, and Z waves. The results may be viewed in a graph (as three traces) or in a table (in three columns).
Also contains MatrixToXYZTriplet which converts a two-dimensional matrix of Z values into a XYZ triplet wave (a three-column matrix in which columns 0, 1, and 2 contain the X, Y, and Z data, respectively) such as is used by the 3D plotter Gizmo (see Visualization) and AppendXYZContour.
These routines work on waves in the current data folder only.
Wave inWave
Variable rows=DimSize(inWave,0)
Variable cols=DimSize(inWave,1)
Variable points=rows*cols
Make/O/N=(points,3) tripletWave
Variable x0=DimOffset(inWave,0)
Variable y0=DimOffset(inWave,1)
Variable dx=DimDelta(inWave,0)
Variable dy=DimDelta(inWave,1)
tripletWave[][0]=x0+dx*mod(p,rows)
tripletWave[][1]=y0+dy*trunc(p/rows)
tripletWave[][2]=inWave[mod(p,rows)][trunc(p/rows)]
End
A.G.
WaveMetrics, Inc.
December 20, 2011 at 03:18 pm - Permalink
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
December 20, 2011 at 03:22 pm - Permalink
December 20, 2011 at 08:42 pm - Permalink