Hello… I want to illustrate my question by a picture like this http://www.flickr.com/photos/rye_ni/7095315251/. I make the line using "ginput", and i get length of the line by this code..
% Initially, the list of points is empty.
xy = [];n = 0;% disp('Left mouse button picks points.')
% disp('Right mouse button picks last point.')
but = 1;while but == 1 [xi,yi,but] = ginput(1); plot(xi,yi,'rx','LineWidth',2) n = n+1; xy(:,n) = [xi;yi];end% Plot the interpolated curve.
plot(xy(1,:),xy(2,:),'m-','LineWidth',2);% ---------------------------
pjgAsli = sum(sqrt(diff(xy(1,:)).^2 + diff(xy(2,:)).^2));
the length of the line is "pjgAsli".. How i can put this value above the line..?? Thank you.. ^^
Best Answer