matrix=load('Data');x = matrix(:,1);y = matrix(:,2);distances = sqrt((x-0).^2 + (y-0).^2)sum(distances)./(size(matrix))
Hey, so I just wanted to make sure I'm doing this correctly. What I'm trying to do is find the average distance between points in a matrix and the origin. I got an answer I'm not quite sure about being correct, so I wanted to be safe.
Best Answer