Hi quys, please do you have any idea, how two measure distance between two points? I have my script (below) and a need measure distance between two points. Its mean – when I click (use ginput) six-times – i have six points and I need measure distance between – first+second , third+fourth and fifth+sixth. Its mean I have six points and 3 distances. I need keep my script, I just wanna edit it. Do you have please any idea how to edit it?? Thanks everybody for help!!!
MY SCRIPT:
close allaxis ([0 100 0 100]);hold onxy = []; n = 0; distance = [];disp('SELECT POINTS LEFT BUTTON')disp('RIGHT-CLICK SELECTED LAST POINT')but = 1;while but == 1 [xi,yi,but] = ginput(1); plot(xi,yi,'ro') n = n+1; xy(:,n) = [xi;yi];end
Best Answer