LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transpose a 1-D array?

Solved!
Go to solution

rotate 1-D array.JPG

The picture is pretty self explanitory, the "build array" takes those 4 input arrays and puts them one after another horizontally.

My problem is that the 4 arrays going into the "build array" are single row, but i need them to be single column.  The "transpose 2-D array" function obviously only works for 2-D arrays, so it won't help me.  Is there a way to rotate those arrays 90 degrees so all the data is in a single column instead of a single row?

0 Kudos
Message 1 of 12
(3,683 Views)

 

What do you actually want? Please attach your VI instead of an image for better help.

 

Maybe you simply want to transpose the 2D array after the autoindexing output tunnel. Remember, "write to spreadsheet" file also has a "transpose?" input that you could use instead. 

0 Kudos
Message 2 of 12
(3,680 Views)

Just by looking at the picture it seems that you are connecting your 1D array to the 2D array input.

 

Ben64

0 Kudos
Message 3 of 12
(3,669 Views)

Let me try and give some more info

 

Yes Ben, that is the idea, it SHOULD be a 2D array (not because that is what the input on the write to measurement file is, but because that is what the program call for). 

 

Posting the vi itself is a little bit of trouble since there are multiple levels of sub.vis and the problem is not with the preformance, just on how the data is handled at the top level.  (And the auto indexing tunnel is not an auto indexing tunnel, it is just set to "use default if unwired" so i can't rotate it. Granted, this you would have been able to see if I posted the real .vi and not a pic).

 

All I need is to rotate/transpose the 4 arrays going into the "build array" so that I can have 4 columns to match the frequency, control, cable, and difference string headers, but instead of arranging them as 4 seperate columns of data, they start out as 4 seperate rows of data and are placed in sequence, so I end up with 1 gigantic row of un-sorted data.

 

 

0 Kudos
Message 4 of 12
(3,661 Views)
Solution
Accepted by topic author LarsUlrich

I have lost track of how many times I have had to tell people to go the opposite direction, this is the first time I have had to suggest this:  Right-Click the Build Array function and uncheck 'Concatenate Inputs'.  Then you can use the Transpose function of the write to spreadsheet file VI.

 

Edit:  Confused by your note where you say it should be a 2d array with 4 columns.

Message 5 of 12
(3,658 Views)

After that, as Altenbac said, set the transpose input of the Write To Spreadsheet File.vi to TRUE to have your 1D arrays inputed as columns.

 

Ben64

0 Kudos
Message 6 of 12
(3,653 Views)

Darin, confusion aside, that is exactly what I needed, thanks a bundle!

0 Kudos
Message 7 of 12
(3,648 Views)

Great, it just means that my inner Malcolm Gladwell worked.  I glanced at the code, assumed what I thought you wanted and replied.  Carefully reading the posts started to create confusion.  There is a moral to that story.

Message 8 of 12
(3,644 Views)

I still find it strange though that you cannot take a 1D row array and turn it into a 1-D column array...

0 Kudos
Message 9 of 12
(3,634 Views)

Well, a 1D array is 1D, when you talk about row and column you put it in a 2D context.

 

Ben64

Message 10 of 12
(3,629 Views)