LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transpose 1D array for

Solved!
Go to solution

Hello,

 

This is a very simple question: I have a 1D array presented as a column; I want it to be a row for "cosmetic" reason.

How to do that? (I searched and I found no simple answer that fitted my simple problem)

Elliot 

0 Kudos
Message 1 of 10
(8,114 Views)
Solution
Accepted by topic author 1176789890856754634563452134512356423454

You don't transpose a 1D array. You can expand a 1D array control or constant either vertically or horizontally. Resize it to one element then resize it horizontally.

=====================
LabVIEW 2012


Message 2 of 10
(8,110 Views)

That's it! Thanks. All of this 1D array transposition is something quite confusing with Labview. I don't understand why they allowed to transpose only 2D array... In other language like Matlab, it is very useful to transpose a 1D matrix and even in Labview, some application (like concatenate 1D array) might be a lot more intuitive and easy if only they allowed that simple transpose operation.

0 Kudos
Message 3 of 10
(8,082 Views)

You could propose it on the Idea Exchange.

 

But what would it really do? If I have a 1D array of [1,2,3,4] and transpose it, what is the result? And if you want to concatenate that array with another array of [5,6,7,8], what would transposing a 1D array do that would help? I am only asking because a really good answer should go in your proposal on the idea exchange if you decide to submit it.

 

Labview does support matries as you probably already know. I have never used those but maybe the idea is to have the ability to support row and column vectors in the matrix pallette.

=====================
LabVIEW 2012


0 Kudos
Message 4 of 10
(8,050 Views)

 


@SteveChandler wrote:

You could propose it on the Idea Exchange.

 

But what would it really do? If I have a 1D array of [1,2,3,4] and transpose it, what is the result? And if you want to concatenate that array with another array of [5,6,7,8], what would transposing a 1D array do that would help? I am only asking because a really good answer should go in your proposal on the idea exchange if you decide to submit it.

 

Labview does support matries as you probably already know. I have never used those but maybe the idea is to have the ability to support row and column vectors in the matrix pallette.


[I know this thread is over a year old, but I ran into the same problem.]

If you write a 1D array to a text file, it puts your data into columns. Whereas I would like to transpose it in order to write as one row.

 

That's at least one practical application.

0 Kudos
Message 5 of 10
(7,609 Views)

If you write a 1D array to a text file, it puts your data into columns. Whereas I would like to transpose it in order to write as one row.


That depends how you write it. "Write to spreadsheet file' writes as one row by default, but there is a "transpose?" Input if you want one column instead.

Message 6 of 10
(7,599 Views)

Which direction has a 1-dimensional object? As you mention it's a visual representation in a 2d-space (screen). If you want it transposable you'll have to use a 2D array of 1 column or row. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 10
(7,586 Views)

@Yamaeda wrote:

Which direction has a 1-dimensional object? As you mention it's a visual representation in a 2d-space (screen). If you want it transposable you'll have to use a 2D array of 1 column or row. 🙂


Well, matlab for example has a distinction between row vectors and column vectors. For certain linenar algebra operations it does matter. However LabVIEW can figure it out just fine without it. If it matters, you can always use a 1xN or Nx1 2D array as appropriate.

0 Kudos
Message 8 of 10
(7,576 Views)

@altenbach wrote:

@Yamaeda wrote:

Which direction has a 1-dimensional object? As you mention it's a visual representation in a 2d-space (screen). If you want it transposable you'll have to use a 2D array of 1 column or row. 🙂


Well, matlab for example has a distinction between row vectors and column vectors. For certain linenar algebra operations it does matter. However LabVIEW can figure it out just fine without it. If it matters, you can always use a 1xN or Nx1 2D array as appropriate.


Wouldn't that imply that Matlab always uses a 2D-array in the Nx1- or 1xN-form?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 10
(7,559 Views)

Yamaeda ha scritto:

@altenbach wrote:

@Yamaeda wrote:

Which direction has a 1-dimensional object? As you mention it's a visual representation in a 2d-space (screen). If you want it transposable you'll have to use a 2D array of 1 column or row. 🙂


Well, matlab for example has a distinction between row vectors and column vectors. For certain linenar algebra operations it does matter. However LabVIEW can figure it out just fine without it. If it matters, you can always use a 1xN or Nx1 2D array as appropriate.


Wouldn't that imply that Matlab always uses a 2D-array in the Nx1- or 1xN-form?

/Y


I don't know Matlab enough to answer your question, however from a mathematical standpoint a vector is a point in a multidimensional space, while a matrix is a linear operator defined on that space, so a vector can't definitely be a matrix. Smiley Happy

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 10 of 10
(7,551 Views)