Pass variables into set(frt,'WindowButtonDownFcn',@mousePos)
조회 수: 15 (최근 30일)
이전 댓글 표시
Quick question, how can i pass some other variables that i want in mousePos
function mousePos(hObject,~)
mPos=get(hObject,'CurrentPoint');
finalPos(mPos,data)
The data variable is defined in the main function but i want to use it here too.
댓글 수: 0
채택된 답변
Walter Roberson
2012년 7월 15일
편집: Walter Roberson
2012년 7월 15일
set(frt, 'WindowButtonDownFcn', {@mousePos, data} )
and
function mousePos(hObject, ~, data)
Note: this will use the value of "data" as of the time the callback is created, and will not reflect any updates to "data" that are made after that.
댓글 수: 3
추가 답변 (1개)
Xiangqi
2013년 8월 27일
To Raldi,
Hi~ Have you found the way to update the value of "data" ?
I encountered the same problem and don't know how to update it.
Thanks for your help in advance.
Huang
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Other Formats에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!