LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert 2D arrays to 1D array

Hi 

its a example for split a 2D array to two seprate 1D array 

01.PNG

 

 

0 Kudos
Message 11 of 16
(4,278 Views)

@NAS2000CO wrote:

its a example for split a 2D array to two seprate 1D array 


This is overly compicated pure Rube Goldberg code.

 

See also my reply to your other post.

0 Kudos
Message 12 of 16
(4,265 Views)

Hi, Altenbach

 

Can you help me? Sorry for post in here, but I'am a new user and I couldn't find the right place to post.

 

I have a 2d array that I convert to a 2d Matrix, but I need to convert this matrix (in fact, this matrix is a image, where each pixel is one element of the matrix) to a 1d array (or 1d matrix, I don't if this is possible). But I need that every single element being present in this new 1d array, I can't lost none of this elements.

In essence, I need an algorithm that put "each column below the other".

This is how my code is until now.

 

Thanks

 

 

0 Kudos
Message 13 of 16
(4,212 Views)

Why do you need a matrix?  Just work with arrays.

 

You can use reshape array.  You justy need to transpose the array first.

 

This is Altenbach's message 9.  Just with the transpose array added.

 

0 Kudos
Message 14 of 16
(4,202 Views)

Hi jvc,

 

you can create new threads by posting a question. Did you notice the "How to…" links in the upper right of the main forum page?

 

On your question: one TransposeArray does the trick:

check.png

Edit: RavensFan was faster - with the very same solution… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 16
(4,200 Views)

Thank you so much for your help and the next I will post in the right place! Smiley Very Happy

0 Kudos
Message 16 of 16
(4,187 Views)