From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hermitian of 1-D array

Solved!
Go to solution

@uni-pixel wrote:

what should i do at this point.


At this point you should stop spoonfeeding us tiny problem fragments and define exactly what you have, what you do with it, and what you want out of it.

 

If you get an error, at least tell us the error code.

Do the dimension sizes agree with what the multiplication expects? (the sizes cannot be random!)

A hermitian is a square matrix. Is yours?

 

Please attach a small VI containing your inputs as diagram constants and showing the operation you are trying to do. Tell us the expected result.

0 Kudos
Message 11 of 14
(878 Views)

Do you know how to multiply matrices?  A[i,j]*B[j,k]=C[i,k] where C[i,k] = sum-over-j([A[i,j]*B[j,k]).  As I noted in an earlier post, a 2D Array is not a Matrix.  Some versions of LabVIEW have (in the Array Palette) some Matrix functions -- I've never used them, so I won't advise you how to use them.  But you can easily write a "Matrix Multiply" VI that takes two 2D arrays and returns a single 2D arrays that is the result of the formula above.

Matrix Product Call.png

This returns the 2-D array [[30,10],[10,4]], which (doing the multiplication by hand) should be the correct answer.  The implementation of the Matrix Product sub-VI "is left as an exercise for the Reader".  [It's pretty simple -- just follow the definition, above, and remember how LabVIEW does array multiplication].

 

Bob Schor 

0 Kudos
Message 12 of 14
(867 Views)

Altenbach makes a very good point -- the definition of a Hermitian Matrix is "a square matrix that is equal to its own complex conjugate".  What you proposed to do with 1D arrays is certainly perfectly do-able, but unless the 1D array is a real matrix of length 1, you can hardly call it "Hermitian".  [Hermite would be rolling in his grave ...].  So at the very least, the Subject of this Forum Entry is misleading ...

 

BS

0 Kudos
Message 13 of 14
(863 Views)

@Bob_Schor wrote:

Some versions of LabVIEW have (in the Array Palette) some Matrix functions -- I've never used them, so I won't advise you how to use them. 


All LabVIEW versions (even "Base") have the matrix operations in the linear algebra palette (Result A). You can also convert your 2D array to a matrix datatype and the regular multiply operation will do a proper matrix multiplications (result B).

 

Of course the order of the inputs matter, so if you swap the inputs, the result will typically be different (result C).

 

Note that if you would do a plain multiply on a 2D array, you would get an element-by-element multiplication, which would be a very different result. If you use the linear algebra tools on 2D arrays, you get the correct matrix operation, of course.

 

 

Message 14 of 14
(853 Views)