From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-23-2016 10:43 PM
Hi,
I have 2D data array (64×64) and trying to convert the data into x (-31 to 31),y (-31 to 31) ,z (0-255). I'm not sure how to do this. Please advice.
Thank you.
Solved! Go to Solution.
12-23-2016 11:03 PM
Hi Ledang,
Can you be more specific about your doubt?
12-24-2016 11:45 AM
He doesn't have a doubt. He has a question.
It would be helpful if some actual data was attached.
I'm going to assume that the indices of the 2-D array are what is to be translated into the X and Y values. Now you said you have a 64 x 64 array. But X and Y from -31 to 31 is only 63 elements in each.
What I would do is create a nested For Loop. Autoindex on the 2-D array at each boundary. Use the i value of the For Loops and subtract 32. In the inner For Loop you can bundle the inner loop's i value, the outer loop's i value, and the value of the array into a cluster of XYZ. Take that cluster and auto-index on the output tunnels and you'll have an array of XYZ clusters. (On the outer loop, you can make it a concatenating tunnel so it becomes a 1-D array of all the 1-D arrays coming from the inner loop.)
12-24-2016 03:41 PM - edited 12-24-2016 03:42 PM
Here's another simple solution. Modify as needed depending on how x and y are defined.
12-26-2016 08:16 AM
Hi,
Thanks for the reply. I tried and come out with this VI and it's works!.
Ledang
12-26-2016 08:23 AM
Hi,
Thanks, it really helps.
Ledang