Info
此问题已关闭。 请重新打开它进行编辑或回答。
Accessing graphical mouse input before the input is finalized
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!