Pass variables into set(frt,'WindowButtonDownFcn',@mousePos)
2 ビュー (過去 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!