9951 explained code solutions for 126 technologies


matlabCalculate Euclidean distance


function distance = euclideanDistance(x1, y1, x2, y2)
    distance = sqrt( ((x1 - y1) ^ 2) + ((x2 - y2) ^ 2) );
endctrl + c
euclideanDistance

name of the function that will be used later

sqrt

square root