Write a function that computes the Euclidean distance between two N-dimensional vectors.
Given two input vectors x and z of equal length, compute their Euclidean distance.
Requirements
The two input vectors will always have the same length.
The final result must be rounded to 2 decimal places.
You are NOT allowed to use the following built-in functions:
norm
vecnorm
sqrt
dot
pdist
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers7
Suggested Problems
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
FYI - pdist() is not available on Cody as it is a toolbox function (part of the Stats and ML toolbox), so you need not check for it.
Also, banning sqrt() and allowing ^ sort of doesn't make sense.
It'd be more challenging without ^ and related functions.