find distance between 2 points

1 view (last 30 days)
I need to find the distance between 2 points. what is wrong with the script?
function d = finddist(A,B)
s = B-A
d = findmod(s)
this is what is coming when i am running it. Error using finddistance (line 2) Not enough input arguments. please help me out with the corrections to be done.
  2 Comments
Jan
Jan on 16 Nov 2014
The error message contains "finddistance", but you post the code of "finddist". Which is "line 2"?
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH on 29 Dec 2014
thankyou for the help, appreciated it.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 15 Nov 2014
Not to rain on your parade, but I would just use the hypot function.
  7 Comments
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH on 29 Dec 2014
thank you for all the help

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!