Changing Waveform into XY data

Hi,

I can't seem to find any information about this anywhere in the help file or the web forums. There's a portion of the help file that explains how to change XY data into a waveform. There's nothing that shows how to change a waveform into XY data.

I would like help with one of two things.

1. I would like to convert the x-values of a Waveform into it's own data set.
2. I would like to replace the x-values of one data set with the x-values of another.

Any help on this would be appreciated.
Quote:

I would like to convert the x-values of a Waveform into it's own data set.


Here is one way to do it:
Make/N=100 test
SetScale/P x, 0, .25, "s", test
Make/N=100 xtest
xtest = pnt2x(text,p)


In most cases this is not recommended and indicates you may be taking the wrong approach. To know if that is true in your case I would need to know what you are trying to accomplish.


I would like to replace the x-values of one data set with the x-values of another.


You can copy the X scaling of one wave to another using CopyScales.




Thanks for the quick reply. This works just fine.

Since you asked what I'm doing, I'm trying to do arithmetic with histograms. The new wave I created would have the result I wanted but not the x-scale. So I was just trying to copy the old scale onto the new one.
The Duplicate command will also duplicate the X scaling of a wave. That will perhaps help you with creating the copy of a wave and getting the same X scaling. Duplicate can also help with the problem of converting a Waveform to an XY Pair:
Duplicate test, testx
testx = x

Still two lines, just like HRodstein's answer, but perhaps a bit easier to type.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com