# setscale of a matrix dimension with the content of a wave

Hi,

my problem is relatively easy to describe: I have a matrix with position data in x, y direction and spectra in z direction. For the spectra I have a wave with the energies. Since the energies do not have an even spacing, I cannot get further with the proposed variants of setscale.
Is there a possibility to use a wave as a scale, e.g.

`setscale z, scalewave, matrix`

or is there only this possibility?

`display matrix[x][y][] vs scalewave`

Thanks!

(used version 8.04 (Build 34722))

Waveform scaling has to be linear, so you cannot use a wave as input for SetScale. However, your second approach will work, i.e. you can set up a scaling wave for display. Note that such a wave needs to be larger than the target dimension by one point and you need to set the content so that the values fall on the edges between each desired z value. For example, if you have 3 data points in z direction which should be centered at 1,2,3 you need to create a scaling wave with the values {0.5, 1.5, 2.5, 3.5}. Hope that helps.

The display operation does not need the N+1 number of elements. I would say it's not really clear what the intention is. If you are trying to make a standard XY 2D graph using a "beam" from the matrix, then scalewave would need to have the same number of points as the matrix has layers. But the use of "x" and "y" suggests other possibilities.

@g.germer Did you figure out the answer to your problem? If so, please post a description so that others can benefit.

`display matrix[1][2][] vs scalewave`
`setscale/X dim,scalewave,wave`