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