MatLab Manual / Matlab distance between two points Program

Program Name

Write a Matlab Program for Matlab distance between two points Program.
Theory
Matlab distance between two points Program is calculated using the formula. sqrt(((x2-x1)^2+((y2-y1)^2))
where (x1,y1) and (x2,y2) are points.
Program Code


Input:
Enter x1 Number> 2
Enter x2 Number> 3
Enter y1 Number> 4
Enter y2 Number> 5
Output:
Distance between two points = 1.414214
Click for Matlab Online Compiler (Copy, Paste and Press Enter)


Home     Back