フィルターのクリア

'ButtonDownFcn' - Passed parameters need to be updated

4 ビュー (過去 30 日間)
BF83
BF83 2011 年 8 月 18 日
Hi,
let's say I've got something like this:
pX = 10;
pY = 15;
pHandle = plot(pX, pY, 'bx','ButtonDownFcn', {@startProcess, pX, pY});
In startProcess the data pX and pY gets altered by user interaction and I make the command :
pX = newXValues;
pY = newYValues;
set(pHandle, 'XData', newXValues, 'YData', newYValues);
to save and update the new values.
The next time a call is made to @startProcess I would assume that it now uses the altered values, but instead pX and pY remain the original values being 10 and 15.
How can I force the @startProcess function to use the updated values for pX and pY?
Thank you!

採用された回答

Friedrich
Friedrich 2011 年 8 月 18 日
Hi,
once this function handle is created the passed values are fix. You have to renew the function handle with the updated values. So do a
set(pHandle,'ButtonDownFcn', {@startProcess, new_pX, new_pY})
  1 件のコメント
BF83
BF83 2011 年 8 月 18 日
That was fast!
Great it's working. It's all about handling the handles. ;)
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by