Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Accessing graphical mouse input before the input is finalized

조회 수: 1 (최근 30일)
Peter
Peter 2013년 4월 8일
마감: MATLAB Answer Bot 2021년 8월 20일
I would like to use imline to allow someone to do a regression visually. After plotting the data, I have a code that looks like the following:
p=imline;
fcn=makeConstrainToRectFcn('imline',get(gca,'XLim'),get(gca,'YLim'));
setPositionConstraintFcn(p,fcn);
Kids=get(p,'Children');
position = wait(p);
linepos=getPosition(p);
x=linepos(:,1);
y=linepos(:,2);
However, I can access x and y only after the user has confirmed his line by double-clicking on one end of the segment. I would like to be able to get x and y before the user finalizes his choice of points, so I can display a slope and intercept that vary as the user moves his end points.
Is there a way to do that?
Thanks in advance for your help!

답변 (0개)

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by