09-01-2008 10:06 AM
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
09-01-2008 10:19 AM
Hi matomato
If I understand correctly you're looking for "A x B" on the Mathematics > Linear Algebra palette.
Hope this helps,
Daniel
09-01-2008 12:11 PM - edited 09-01-2008 12:12 PM
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:
09-01-2008 02:21 PM - edited 09-01-2008 02:22 PM
Here's a starting point, probably still needs a few tweaks. 🙂
09-02-2008 04:07 AM
HI dan_u
thanks for the news, I will see where these matrix bottom are,
matomato
09-02-2008 04:09 AM
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
09-02-2008 04:11 AM
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
09-02-2008 05:19 AM
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
09-02-2008 05:29 AM
Thanks dan_u
I found this button, I will try to do the same as Altenbach said
matomato
09-02-2008 11:12 AM
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. 😉