cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

How to transpose 1D array

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 🙂

0 Kudos
Mensagem 1 de 21
46.102Exibições

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.

 

Mensagem 2 de 21
46.096Exibições

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 , that was fast. And code too!

0 Kudos
Mensagem 3 de 21
46.089Exibições

no that's not what I mean 🙂 

 

my 1D arrays are columns 🙂

0 Kudos
Mensagem 4 de 21
46.086Exibições

It doesn't matter which way you display the 1D array. It is still a 1D array. The approach we described will work.

 

Chris

0 Kudos
Mensagem 5 de 21
46.083Exibições

@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.

0 Kudos
Mensagem 6 de 21
46.080Exibições

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 ? 🙂 

0 Kudos
Mensagem 7 de 21
46.073Exibições

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".

Mensagem 8 de 21
46.069Exibições

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?

0 Kudos
Mensagem 9 de 21
38.567Exibições

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. 

0 Kudos
Mensagem 10 de 21
38.549Exibições