Author |
Topic |
|
newmanderland
8 Posts |
Posted - 12/28/2011 : 4:16:19 PM
|
Origin Ver 8.6. Operating System: Windows 7.
Hello, I am trying the new Origin version (for the first time) for the following task: I need to write a script to calculate the histogram of the frequencies of distances between the data points in my column. Say, I have in my column the values 3,5,7,9 and I need a histogram of distances from each X point to each of the neighboring points, which in this case will be as follows: X=0, Y=0; X=1, Y=0; X=2, Y=3; X=4, Y=2; X=6, Y=1; (The histogram shows the frequency, or the number of occurencies for each distance). I am thinking, whether such a standard task is already realized as a function in Origin? Thanks!
|
|
couturier
France
291 Posts |
Posted - 12/29/2011 : 07:41:09 AM
|
Don't know if I understand well what you need to do, but there's a distance function that returns the distance bewtween 2 points.
If you want to get the distance between the neighboring points, you can add a third column and set column value like this:
distance(Col(A)[i],Col(B)[i],Col(A)[i+1],Col(B)[i+1])
Hope it helps |
|
|
newmanderland
8 Posts |
Posted - 12/29/2011 : 09:48:03 AM
|
couturier,
That's great, I was looking for such a distance function. But I still need to get the distance from a given point to all the other points, not just to the neighboring point. Is there an easy way to do this?
I actually need to plot the histogram of all distances. |
|
|
couturier
France
291 Posts |
Posted - 12/30/2011 : 11:23:48 AM
|
the syntax for the distance function is distance(x1,y1,x2,y2)
If you want the distance from a given point (say 3rd point) to the others, you can make the additionnal column value like this:
distance(Col(A)[3],Col(B)[3],Col(A)[i],Col(B)[i]) |
|
|
pazliberty
USA
4 Posts |
Posted - 01/09/2012 : 5:47:12 PM
|
This is a known bug in Origin 8.0 SR6, which we aren't going to fix. Sorry for that.
In your case, if you only want show a specified range of the curve and know the X/Y range exactly, how about fixing the X/Y range in Axis dialog?
|
|
|
|
Topic |
|
|
|