09-01-2011 09:14 AM
Hey guys,
To start off, I am very new at Labview. I have posted about this project before but my professor has changed the assignment slightly.
- Generate a random set of N points (x,y) between 0 and 100
- Find the closest point to each point
- Calculate the number of points with a closest point of less than D
- Graph the points with the points with a closest point of less than D clearly marked
So far I have manged to get everything done except for the last part, at least completley. My approach was to create a case structure with < D as the requirement, if true build array if false I wanted it to do nothing, but I can't seem to do that. I tried using a number ourside of the array size but that doesn't seem to work either. Then I tried using a a shift register to do the same thing but had the same problem. I could use some help if at all possible. I have posted both codes below. 1_9 is the case structure alone and 1_10 is the shift register approach.
09-01-2011 10:09 AM - edited 09-01-2011 10:13 AM
Not bad- monor tweaks set off with some color attached.
NOTE use BD comments. Watch your data types (point closest should be an Integer type not a double) use increment rather than adding 1. kill the iteration indicators you are outo indexing off of an array generated with the Number of Points(N) control- there is no need to write N number of times to each indicator. why you CHOSE to cross the wires into and out of the fourth loop baffles the mind
EDIT: the SR should be initialized with an EMPTY array I just noticed that it has 1 element. that is a bug
09-01-2011 11:07 AM
Thanks for all the help, I got it working