LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two Nested For Loops

Hi everyone, I am working on performing the MUSIC algorithm for the angle of arrival in LabView. The following loops are for searching the azimuth and elevation angles. how can I do the two loops in LabView?

 

for azi = 1:361
aangle(azi)=azi;
for ele=1:181
eangle(ele)=1*ele;
a=threedv(aangle(azi),eangle(ele),0);
L=M;
En=EV(:,L+1:end);
SP(azi,ele)=1/(a'*En*En'*a);
end
end

0 Kudos
Message 1 of 5
(1,199 Views)

Place a for loop inside for loop, just like how you would place a function inside the for loop

 

santo_13_0-1649879238690.png

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 5
(1,195 Views)

Thank you dear Santhosh and sorry for the late reply. Actually, yeah I tried these two loops in LabView and placed a function inside the for loop. But the problem is that inside the two for loops, the data type of wire has changed from the (2D complex matrix) to (1D complex matrix) as shown in the attached picture and I wasn’t sure how to fix it. I searched for two angles so the data should be a 2D complex matrix.

0 Kudos
Message 3 of 5
(1,147 Views)
Right click the matrix tunnel and deselect auto indexing

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,144 Views)

yes, it works now, thank you

0 Kudos
Message 5 of 5
(1,134 Views)