The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Finding average distance between the datapoints

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
newmanderland 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!
4   L A T E S T    R E P L I E S    (Newest First)
pazliberty 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?
couturier 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])
newmanderland 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 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000