필터 지우기
필터 지우기

Question about impositionrect value updates

조회 수: 1 (최근 30일)
Raldi
Raldi 2012년 7월 14일
The code below prints each time the position of the rectangle, but how can i also store that position in a variable?
close all, plot(1:10)
h = impositionrect(gca, [4 4 2 2]);
api = iptgetapi(h);
api.addNewPositionCallback(@(p) disp(p));
Thanks
  댓글 수: 4
Image Analyst
Image Analyst 2012년 7월 15일
Why are you not going to reply?
Raldi
Raldi 2012년 7월 15일
No, i didn't mean it like that. I meant sorry for not replying till now.

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 7월 14일
% if you want the latest position u can try this, will save 50 postions for exemple
close all, plot(1:10)
h = impositionrect(gca, [4 4 2 2]);
api = iptgetapi(h)
for k=1:50
n=api.addNewPositionCallback(@(m) disp(m));
pause
position(k,:)= api.getPosition
end
% this don't allow to save all postion, but allows to save a postion after evry pause (you have to press any key).

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by