Write a MATLAB function named dist3 that accepts two lists o

Write a MATLAB function named dist3 that accepts two lists of numbers. Each list contains 3 real numbers that represents the x,y,z coordinates of a point. The function should return a single real number that represents the 3-D distance between the two points.

Solution

clc
clear all
p1 =input(\'coordinates of first point=\'); %[2; 4;6];
p2 = input(\'coordinates of 2nd point=\'); %[4; 6; 8];
d = norm(p1 - p2)

Write a MATLAB function named dist3 that accepts two lists of numbers. Each list contains 3 real numbers that represents the x,y,z coordinates of a point. The f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site