LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you change a 1-d array to a 2-d array

Could someone please tell me how to change a 1-d array (say that I have a 1-d array of 16-numbers) to a square 2-d array?

I know this is an easy question, but I have never used labview before and I am wondering how I pass a 1-d array into a double-for-loop to change it into a 2-d array (this is the way I envision doing it...)

thanks,

ILJS
0 Kudos
Message 1 of 4
(3,078 Views)


@ILJS wrote:
Could someone please tell me how to change a 1-d array (say that I have a 1-d array of 16-numbers) to a square 2-d array?
...


There is a Reshape Array function.  See  http://zone.ni.com/reference/en-XX/help/371361A-01/glang/reshape_array/.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 2 of 4
(3,067 Views)
Thanks Donald,

That is a lot quicker than what I was thinking of doing...But looks *very* easy.

thanks again,

ILJS
0 Kudos
Message 3 of 4
(3,063 Views)
ILJS,

The Reshape Array will do as Donald mentioned. Look at the help file for details on how it will behave if the original array does not have the correct number of elements to fill the new array.

Lynn
Message 4 of 4
(3,052 Views)