08-03-2011 08:14 AM
Dear all 🙂
I wanna transpose a 1D array
in other words
i wanna append these 3 1D arrays
|1| |2| |3|
|4| |5| |6|
|7| |8| |9|
to this 2D one
|1 4 7|
|2 5 8|
|3 6 9|
thanks for ur help in advace 🙂
08-03-2011 08:19 AM - edited 08-03-2011 08:20 AM
Transposing a 1D array is meaningless, since transpose works on 2D arrays. What have you tried? It's not clear from your picture whether your 1D arrays are the "rows" or the "columns" of what you show. Either way:
This is a pretty basic question. Have you done any of the LabVIEW tutorials? To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.
08-03-2011 08:21 AM - edited 08-03-2011 08:23 AM
You can't transpose a 1D array (it only has one dimension!), but you can do what you want. You can use build array to combine the 3 vectors into 1 2D array, and then use Transpose Array on the 2D array.
Chris
Edit:
Damn smercurio_fc, that was fast. And code too!
08-03-2011 08:22 AM
no that's not what I mean 🙂
my 1D arrays are columns 🙂
08-03-2011 08:24 AM
It doesn't matter which way you display the 1D array. It is still a 1D array. The approach we described will work.
Chris
08-03-2011 08:24 AM - edited 08-03-2011 08:25 AM
@abdo712 wrote:
no that's not what I mean 🙂
my 1D arrays are columns 🙂
"Rows" and "columns" are meaningless terms when it comes to 1D arrays. It's just an array. It has no direction. It becomes a "row" or "column" when it's placed into a 2D array.
08-03-2011 08:29 AM
look
i m getting my 1D arrays as a o/p from previous step (as columns 1D array) and the I have to add them to aother 2D array but each 1D array as a row in this 2D 🙂
that's what i actually want 🙂 did u got me ? 🙂
08-03-2011 08:35 AM - edited 08-03-2011 08:37 AM
Build Array adds rows to a 2D array (read the Help). If you have a 2D array to begin with, and increase its size by adding another row, just wire your 1D array (I don't particularly care whether you want to call it a "row" or a "column" as far as the 1D array is concerned) to the second input of Build Array to add another row to the 2D array.
Why don't you just try the operations yourself?
Also, please do not use text-speak abbreviations like "u".
06-25-2015 05:26 PM
But if you're multiplying matrices with vectors, it does make sense to transpose a 1-D array (or vector), so that the dimensions of your multiplication operation will match. How can I transpose a vector (1D array) so that I can multiply it correctly with a matrix?
06-25-2015 07:23 PM
If you're going to bump a 4yr old thread, at least show us what you've tried and didn't work.
What have you tried? Have you looked at the matrix calculations as you want to do matrix specific things? If the math isn't working as you want, have you considered transposing your 2D array to change the way your 1D array would work with it?
Or, have you tried anything? The 1D array doesn't have multiple dimensions to transpose.