05-17-2013 08:35 AM
Ah, unsorted... sorry, my mistake.
05-19-2013 11:31 PM
Hi moderator1983,
could you explain what's the purpose of the 3 for loop, why did you choose 999 as input for the shift register, why did you calculate the difference, what's the purpose of the absolute value and why 0 for the input of the 1st shift register?
Sorry, I'm a slow learner and I need more explanation to understand.
05-20-2013 12:04 AM
@LHX wrote:
what's the purpose of the 3 for loop
Two outer 'For Loops' (with unwired 'N' terminal) helps extracting one point at a time from the 2D-Array (Previous Phase). This concept is known as 'Auto-indexing'.
The third, inner-most loop is used to extract individual points from 1D-Array (Phase) and then each element of 'Phase' array can be compared to individual element of 'Previous Phase' array
@LHX wrote:
why did you choose 999 as input for the shift register
The difference between individual points from 1D-Array (Phase) and individual element(s) of 'Previous Phase' array is always gonna be less than 999, I choose 999, to make sure that the output of 'Is less than' operator is always gonna be 'False' for the very first iteration. You can choose any other value, just make sure that the chosen value must be greater than the difference.
@LHX wrote:
why did you calculate the difference, what's the purpose of the absolute value
The purpose of calculating difference is to determine the separation between two points and considering separation as a scalar quantity, I'm taking the 'Absolute'. This part of code actually determines the closeness of two points.
@LHX wrote:
why 0 for the input of the 1st shift register?
I'm initializing the shift register (closest match index) with 0, because before you actually start determining the closet point (element of 'Phase' array), by entering into the inner most for loop, you may assume that its the first element (0 indexed element) is the closest match.
@LHX wrote:
Sorry, I'm a slow learner.
Don't be, even I'm a slow learner for new things.
05-20-2013 01:38 AM
Shouldn't this do the same as the loops?
/Y
05-20-2013 04:39 AM
Yamaeda, the inner for loop could be replace by your solution if you change the Array input to the subtract function for the autoindexed DBL value from the outer loop.
05-20-2013 08:30 PM
Hi modertor1983,
I just want to ask if there's a simpliest way on rounding up bacause I tried the codes that you gave LHX, from there my output grey scale of my pixel lens is just plain grey although its showing some white color but not fully and it doesnt really shows the black pixels? ><
Thanks!
05-20-2013 09:50 PM
Hi,
This is my attached vi.
05-21-2013 07:49 AM - edited 05-21-2013 07:50 AM
@Enriquez wrote:
Hi,
This is my attached vi.
subVIs are missing...
Please put all of the code into a zip file.
05-21-2013 08:28 AM - edited 05-21-2013 08:33 AM
Hi!
Here it is:) Im actually using the version 2009 ><