LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matrix product

Hello everybody,

 

I want to moltiply two matrices AxB where the matrix A is a 3x3 matrix  where each terms are constatn  while the matrix B is also a 3x3 matrix defined as: 

1           0                0

0    cos(alfa)   -sin(alfa)

0    sin(alfa)     cos(alfa) 

 

where (alfa) is a rotation angle that varies from 0 to 2pi and changes its value at any sampling time.

How it is possible to do it?

Thanks

matomato 

 

0 Kudos
Message 1 of 10
(4,195 Views)

Hi matomato

 

If I understand correctly you're looking for "A x B" on the Mathematics > Linear Algebra palette.

 

Hope this helps,

Daniel

 

0 Kudos
Message 2 of 10
(4,191 Views)

You seem to be asking 2 different questions here: (1) How to create matrix B; (2) How to multiply AxB. I'm not sure which question you're asking, or whether you're asking both. Daniel's answer relates to the second question.  As for the first question, you can just create a 2D array and wire it to a matrix through the Array to Matrix function like this:

 

 

Message Edited by smercurio_fc on 09-01-2008 12:12 PM
0 Kudos
Message 3 of 10
(4,174 Views)

Here's a starting point, probably still needs a few tweaks. 🙂

 

Message Edited by altenbach on 09-01-2008 12:22 PM
Download All
Message 4 of 10
(4,160 Views)

HI dan_u

thanks for the news, I will see where these matrix bottom are,

matomato 

0 Kudos
Message 5 of 10
(4,127 Views)

Hi smercurio,

thanks for the help.

I am using labview 7.2, and I don't find the bottom to pass from the 2D array to a matrix....

Any help?

matomato 

0 Kudos
Message 6 of 10
(4,124 Views)

Hi Altenbach,

thanks for the help, it looks complicate but ok for me. I am not able to open the VI because I am using Labview 7.2.

Anyway, the matrix B, the rotation matrix, changes the value of alfa with the time, maybe I need to put it into a for loop, in order to change the alfa value at any step?

matomato 

0 Kudos
Message 7 of 10
(4,123 Views)

I don't remember when Matrices were introduced, but you can as well work with 2D arrays. If you use "A x B" (which should be present in LabVIEW 7.x) it will do the correct matrix multiplication.

As altenbach said, you can put the code in the sequence in a subVI. I don't know what you mean with "changes the value of alfa with the time", but you will have to call the code altenbach posted for each new value of alpha. This can be for instance in a for loop or a while loop (probably with an event structure).

 

Daniel

 

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

Thanks dan_u

I found this button, I will try to do the same as Altenbach said

Smiley Happy 

matomato 

0 Kudos
Message 9 of 10
(4,110 Views)

I dont think LabVIEW 7.2 exists. Could it be that you have 7.1 or 7.1.1?

 

Yes, you probably don't have the matrix datatype, so just use a 3x3 2D array, the rest stays the same. 😉

0 Kudos
Message 10 of 10
(4,088 Views)