05-17-2013 04:26 AM
Hi,
I want to round up the previous phase values in my VI which is in a 2D array to the nearest 5 decimal point. After rounding up, i want to compare the rounded up values against the phase column so that I can get the value which is equal to or nearest to the values in the phase column to get my grey level value and show the grey level in a 2d array (50x50).
How do I go about doing it?
05-17-2013 04:56 AM - edited 05-17-2013 04:58 AM
05-17-2013 05:35 AM - edited 05-17-2013 05:36 AM
Hi,
I'm not sure, but tried some code around your requirement, please find it in the attachment.
Attached code is saved in version 2009.
05-17-2013 05:38 AM - edited 05-17-2013 05:44 AM
you can also round to a defined number of decimal digits like this:
05-17-2013 05:42 AM
05-17-2013 05:45 AM
oops... GerdW... sorry.. was trying something else also...
05-17-2013 05:52 AM
Hi Nightcrwlr,
i've seen a similar VI like yours in the community page before but i don't understand exactly how it works and what is the function connected to the indicator for?
Could you explain it to me in depth?
05-17-2013 05:53 AM - edited 05-17-2013 05:55 AM
Hi LHX,
the icon of that function clearly says "10^x" - you should search the Math palette for it...
function connected to the indicator for
That's a Divide function. Pretty basic...
Can't you open the snippets on your computer?
05-17-2013 07:42 AM
Nghtcrwlr's solution will give you your number decimals.
Run the output of that with your greyscale array into Threshold 1D array.vi in double for loops and then round to nearest and you should be home.
05-17-2013 08:08 AM - edited 05-17-2013 08:08 AM