9951 explained code solutions for 126 technologies


matlabCalculate Manhattan distance in matlab


function distance = manhattanDistance(x1, y1, x2, y2)
    distance = abs((x1 - y1)) + abs((x2 - y2));
endctrl + c
manhattanDistance

function name to use later

abs

return absolute of a given value