LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[ HELP ] FOR statement

Hello Guys

Can you please tell me whether this Matlab code whether correct or not??

this code use to calculate all distances from A to J points on the map ( has longitude and latitude ), the starting point coordinates ( Lat and Long ) is 3.682043 and 101.523710 and the destination is 2.227804 103.35091

for p1=3.682043:-0.5:2.227804
for p2=101.523710:0.5:103.735091


a5= 2.227804;
b5=103.35091;

[dDgree] = distance(p1,p2,a5,b5); %% this function used to find a distance between two coordinates

end
end

0 Kudos
Message 1 of 4
(2,712 Views)

Hi number,

 

did you notice you're asking a MATLAB question in a forum dedicated to LabVIEW?

 

These are two completely different programming environments and I'm sure there also exists a MATLAB forum to ask such questions...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,709 Views)

Of course if you are actually using the optional NI Mathscript RT module (which basically has the same syntax as matlab) from within LabVIEW, you could ask in the Mathscript forum.

 

Also, if you are looking for a pure g implementation using LabVIEW, here is the right place to ask. But please try for yourself first. 😉

 

The easiest way to find out if code is "correct" (whatever that means) is to test it using a collection of some well known non-degenerate inputs where the result can be independently verified. Have you tried?

0 Kudos
Message 3 of 4
(2,703 Views)
0 Kudos
Message 4 of 4
(2,690 Views)