MATLAB For Statement [ HELP ]

  • MATLAB
  • Thread starter hgphtgi
  • Start date
  • #1
12
0
Hello Guys

Can you please tell me whether this code is 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
 

Attachments

  • 2untitled.JPG
    2untitled.JPG
    21.6 KB · Views: 346

Answers and Replies

  • #2
1,233
18
I've never seen a "distance" function- did you write it yourself?
 

Related Threads on MATLAB For Statement [ HELP ]

Replies
2
Views
3K
Replies
3
Views
1K
  • Last Post
Replies
1
Views
3K
Replies
1
Views
4K
  • Last Post
Replies
1
Views
694
Replies
1
Views
5K
Replies
2
Views
6K
Replies
6
Views
3K
  • Last Post
Replies
3
Views
7K
  • Last Post
Replies
2
Views
2K
Top