06-21-2012 10:52 AM
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
Solved! Go to Solution.
06-21-2012 10:53 AM
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.
06-22-2012 04:49 AM
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.
06-22-2012 11:22 AM
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.
06-27-2013 03:14 PM
@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.
06-27-2013 07:54 PM
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.
06-28-2013 01:39 AM
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
06-28-2013 03:23 AM
@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.
06-28-2013 06:32 AM - edited 06-28-2013 06:33 AM
@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
06-28-2013 07:22 AM
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.