LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array from 1D

Solved!
Go to solution
Hi there,
This is a very rookie question but I am having a bit trouble figuring it out.
I have a 1D array
E.g. 1 2 3 4
And I want to convert it into 2D array with known number of rows and columns.
E.g. 1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4

I am not sure if it has been answered before, I looked through a few related questions. I couldn't find anything.

Thank you.
0 Kudos
Message 1 of 4
(2,922 Views)
Solution
Accepted by topic author kumar1993

I would just use a FOR loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,874 Views)
Solution
Accepted by topic author kumar1993

It is unclear exactly what you want to do, but read up on the simple array functions, there is no special tricks involved.

 

Something like this perhaps, it will give the output you specified.

 

2-d array.png

Message 3 of 4
(2,864 Views)
Solution
Accepted by topic author kumar1993
I figured out. Thank you for the replies. I used "replace array"inside a "for loop" and then "tranpose array".
It worked.

Thank you again.
0 Kudos
Message 4 of 4
(2,854 Views)