x2pnt vs FindValue

rhjpires
Posts: 56
Joined: 2009-09-17
Location: Portugal

Hi guys,

I'm a bit confused with the usage of x2pnt and its relationship with FindValue.
In the past I have been able to use x2pnt to delimit a region of a wave to be fitted by an equation and all worked good.

Today, when attempting to use x2pnt again in another procedure I still cannot understand the output I was getting.
For example, for a random wave with n number of points, every time I tried to print x2pnt(wavename, xvalue), instead of printing out the point/position of the xvalue on the wave, I just got xvalue itself. I ended up going for FindValues which worked fine.

What am I missing here? Is there any limitation in the use of x2pnt that I am not considering? the documentation seems quite trivial about it.
What is the difference between the two functions in terms of usage?

Thanks in advance.

R.
PS: Incidentally, pnt2x was also printing the point number rather than the xvalue.


wings
Posts: 20
Joined: 2016-04-27
Location: China

can you show your "random wave" or how you create the wave?


HJDrescher
Posts: 283
Joined: 2015-01-20
Location: Germany

Maybe the delta value is set to 1 by accident? Are you using an x-wave?
what does

print dimdelta(wavename, 0)

say?

HJ


[ last edited March 17, 2017 - 07:50 ]
olelytken
Posts: 45
Joined: 2015-10-12
Location: Germany

FindValue searches the values assigned to each data point of the wave, x2pnt searches the x-scaling of the wave set with SetScale, not the actual values in the wave.


[ last edited March 17, 2017 - 09:58 ]
rhjpires
Posts: 56
Joined: 2009-09-17
Location: Portugal

Ah OK, now I spot the mistake!
Many thanks to the input guys!!

Cheers,

R.


HJDrescher
Posts: 283
Joined: 2015-01-20
Location: Germany

You're welcome.
Could you share the basic concept of your solution to others with a similar issue?
HJ


rhjpires
Posts: 56
Joined: 2009-09-17
Location: Portugal

Essentially, I followed your input. I did not realize that x2pnt would work only on xwaves. The DisplayHelpTopic "x2pnt" treats it very trivially and the lack of an error message also did not help. My former use of the function was incidentally on waveforms, so I did not encounter this problem back then, and was now a bit confused. Many thanks again for the help.

Cheers,
R.


[ last edited March 18, 2017 - 05:53 ]
Posts: 1580
Joined: 2007-06-21
Location: United States

The documentation for x2pnt links to "The Waveform Model of Data". Read that section carefully about three times. It is important.

Also, the guided tour section "Waves - The Key Igor Concept" covers much of the same material. If you have not done the guided tour, choose Help->Getting Started. It is essential for understanding Igor.


Back to top