Copy x (time) value from one wave to a "blank" wave
bassman
setX = pnt2x(wave, wave_index ) //gives us the x/time value of this point in wave
From there I would want to try something like
wave2[wave2_index].x = setX //assigns the time value to this point in wave2
Obviously this syntax is wrong, but it gets the idea across of what I am trying to do. Is such an action possible? I am not finding information relating to this in the documentation and am relatively new to Igor (just a few weeks). Thanks for any help.
You can't set the X value of a point independent of the other points. You can only set the x0 and dx properties using the SetScale operation.
For more on X scaling and the idea of a waveform, execute this:
DisplayHelpTopic "The Waveform Model of Data"
If you want to copy the X scaling of one wave to another, you can use CopyScales.
You could also do it using something like this:
Variable dx = DimDelta(wave1, 0)
SetScale/P x x0, dx, wave2
or like this:
Variable dx = pnt2x(wave1,1) - pnt2x(wave1,0)
SetScale/P x x0, dx, wave2
If your data is not evenly-spaced then you need to us an XY pair. In this case, you should not set the X scaling of your waves at all. For more on XY data:
DisplayHelpTopic "The XY Model of Data"
February 3, 2009 at 07:19 pm - Permalink