From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D data into x,y.z points

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 6
(3,038 Views)

Hi Ledang,

 

Can you be more specific about your doubt?

 

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 2 of 6
(3,023 Views)

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.)

Message 3 of 6
(2,966 Views)
Solution
Accepted by topic author Ledang

Here's another simple solution. Modify as needed depending on how x and y are defined.

 

 

 

Download All
0 Kudos
Message 4 of 6
(2,955 Views)

Hi,

 

Thanks for the reply. I tried and come out with this VI and it's works!.

 

Ledang

0 Kudos
Message 5 of 6
(2,894 Views)

Hi,

Thanks, it really helps.

 

Ledang

0 Kudos
Message 6 of 6
(2,891 Views)