It's actually more the definition of rightx.
rightx(waveName )
The rightx function returns the X value corresponding to point N of the named 1D wave of length N.
Details:
Note that the point numbers in a wave run from 0 to N-1 so there is no point with this X value.
I wonder why writing is "allowed" but reading is not (I'm aware of the rounding / interpolating behavior upon usage of "()" -- It's more a fundamental wondering: I would give an error message in both cases.)
Make/O/N=2 test SetScalex0, 2, "s", test Edit test.id
test(rightx(test))=42// no error and stored in test[1] print test(rightx(test))// OoR error
So, why doesn't rightx actually return the rightx? It returns the real rightx + deltax.
I am guessing a bit here, but in the wording of the SetScale dialog (Data... Change Wave Scaling...) 'Start' and 'End' refer to the x-values of the first and last points where as 'Start' and Right' refer to the first and last-plus-one points.
This makes sense of you look at the x-scaling of the following:
Here w1 uses Start and End option, and the x-scale is 0, 2.22, 4.44, ... 20;
and w2 uses the Start and Right option, and the x-scale is 0, 2, 4, ... 18.
It all depends upon what the x-scale actually means in your data.
Hope this helps,
Kurt
I tried
setscale x 0,42,test
test(rightx(test))=42
without an error in IP6.38B01 and IP700B04.
HJ
November 29, 2015 at 02:43 am - Permalink
SetScale x 0, 2, "s", test
Print pnt2x(test,0)
Print pnt2x(test,1)
Edit test.id
Note that there is no X value equal to 2. For an explanation, look at the documentation for SetScale.
Instead of "wavename(rightx(wavename))", execute:
Print test[lastPoint]
or
Variable lastX = pnt2x(test,lastPoint)
Print test(lastX)
November 29, 2015 at 04:42 am - Permalink
rightx
.rightx(waveName )
The rightx function returns the X value corresponding to point N of the named 1D wave of length N.
Details:
Note that the point numbers in a wave run from 0 to N-1 so there is no point with this X value.
I wonder why writing is "allowed" but reading is not (I'm aware of the rounding / interpolating behavior upon usage of "()" -- It's more a fundamental wondering: I would give an error message in both cases.)
SetScale x 0, 2, "s", test
Edit test.id
test(rightx(test))=42 // no error and stored in test[1]
print test(rightx(test)) // OoR error
HJ
November 29, 2015 at 07:20 am - Permalink
November 30, 2015 at 07:48 am - Permalink
I am guessing a bit here, but in the wording of the SetScale dialog (Data... Change Wave Scaling...) 'Start' and 'End' refer to the x-values of the first and last points where as 'Start' and Right' refer to the first and last-plus-one points.
This makes sense of you look at the x-scaling of the following:
SetScale/I x 0,20,"", w1
SetScale x 0,20,"", w2
Edit w1.id,w2.id
Here w1 uses Start and End option, and the x-scale is 0, 2.22, 4.44, ... 20;
and w2 uses the Start and Right option, and the x-scale is 0, 2, 4, ... 18.
It all depends upon what the x-scale actually means in your data.
Hope this helps,
Kurt
November 30, 2015 at 08:10 am - Permalink