취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Transpose 1D array for

해결 완료!
솔루션으로 이동

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 포인트
1/10 메시지
10,524 조회수

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


2/10 메시지
10,520 조회수

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 포인트
3/10 메시지
10,492 조회수

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 포인트
4/10 메시지
10,460 조회수

 


@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 포인트
5/10 메시지
10,019 조회수

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.

6/10 메시지
10,009 조회수

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 포인트
7/10 메시지
9,996 조회수

@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 포인트
8/10 메시지
9,986 조회수

@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 포인트
9/10 메시지
9,969 조회수

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. 기쁨 이모티콘

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
10/10 메시지
9,961 조회수