Retrieve x-value from Scale

Hi,

I have a set of scaled waves, and now I need to divide each point ("Y point", to call it somehow) by its corresponding X-point, to store the result in a new wave and make further operations.

I guess I'd use a for cycle, and tell Igor to store Y[i]/X[i] in NewWave[i] at each i point, but I don't know how to access the X-values in any way (be it by accessing them "directly", or by using the starting index of the scale and the delta to calculate X, whichever is feasible).
Is there a way to do so?

Thank you, best

hegedus

Hi,

I think the function you need is:

pnt2x(waveName, pointNum )
The pnt2x function returns the X value of the named wave at the point pointNum. The point number is truncated to an integer before use.

for an original wave, baseWave,

Duplicate baseWave, newWave

newWave [] =baseWave[p]/pnt2x(baseWave,p)

Andy

 

olelytken

You should be able to just do newWave[]=baseWave[p]/x since x is a valid counter as long as newWave and baseWave have the same x scaling

 

emmegamma

I can in fact, that's an even simpler writing!

Actually, I had just newWave[] = baseWave/x , and it seems to be enough (no for cycle needed, even, and I suspect the [] are superfluous)

chozo

Yes, the [] are not needed in this case, since you do not specify a range. Just note that, as Ole has mentioned, you need to have the same scaling for both waves, since 'x' originates from newWave. But this can always be simply achieved by duplication.