01-14-2014 12:32 AM
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?
Solved! Go to Solution.
01-14-2014 03:16 AM
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?
01-14-2014 04:08 AM - edited 01-14-2014 04:08 AM
Hi William,
no, a11 is a vector.
01-14-2014 04:57 AM - edited 01-14-2014 04:58 AM
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?
01-14-2014 05:37 AM
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.
01-14-2014 06:22 AM - edited 01-14-2014 06:31 AM
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.
01-14-2014 06:49 AM - edited 01-14-2014 06:50 AM
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.
01-14-2014 07:31 AM
Hi,
I try to make a simple code to do some matrix manipulation, could you see if it is similar to yours?
01-14-2014 07:31 AM
Hi,
I try to make a simple code to do some matrix manipulation, could you see if it is similar to yours?