From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

multiply vector

Solved!
Go to solution

I have a MATLAB code that I want to convert it to LabVIEW code, but I am stuck at the expression   

a22=a11.';

    pm(ii)=((a22')*a22)./((a22')*LL*a22);

how can I implement this code in labVIEW? 

Download All
0 Kudos
Message 1 of 9
(2,711 Views)

Hi, engomar,

 

I'm a little confused with the code.

It seemed that a11 is a scalar from the MatLab code.

Why do you use vector or matrix manipulation?

0 Kudos
Message 2 of 9
(2,680 Views)

Hi William,

 

 

no, a11 is a vector.

 

0 Kudos
Message 3 of 9
(2,672 Views)

Hi, engomar
,

 

Sorry to my mistake, I didn't notice that the m1 is a vector.

There are two comments from my point of view to your MUSIC.vi code.

1. It should be no minus 1 in the for loop of m1 generation, since the index of the for loop counts from 0.

2. The whole matrix manipulation(a11, a12, and pm) should be put into the for loop and leave the LL generation outside.

What do you think?

0 Kudos
Message 4 of 9
(2,658 Views)

Hi William,

 

Thank you for reminding me about the decrement,  I meant to increment.

 

And I put a11,a22, and pm inside the for loop, and I tried to manipulate in every possible way but it did not work (when I compare the matlab code with the labview code)?

 

Any suggestions please.

0 Kudos
Message 5 of 9
(2,647 Views)

Hi,

 

I think it should disable indexing while the LL entering the for loop, and the pm should be pulled out of the for loop with indexing. Hope it work!

 

BTW, I thought you don't need to place the increment inside the for loop, since the m1 ranged from 1 to 8, and they have to be minus one in the a11 formula, i.e. from 0 to 7 followed by the 2 *pi multiplier. You placed an increment to get the m1, but you have to place a decrement outside the for loop, that's what I mean you don't need to place anything inside the for loop, or just place the increment in front of the m1 indicator, bypass the multiply.

0 Kudos
Message 6 of 9
(2,635 Views)

Hi

 

I did as you told me but it didn't work, it even don't give me the pm vector. is there any other way?

 

You are right, I need to put an decrement at the m1 indicator or delete both the increment and the decrement.

 

Thanks for the help.

0 Kudos
Message 7 of 9
(2,625 Views)
Solution
Accepted by topic author engomar

Hi,

 

I try to make a simple code to do some matrix manipulation, could you see if it is similar to yours?

Message 8 of 9
(2,615 Views)

Hi,

 

I try to make a simple code to do some matrix manipulation, could you see if it is similar to yours?

Download All
0 Kudos
Message 9 of 9
(2,614 Views)