select points in a plot with the mouse

14 ビュー (過去 30 日間)
Luca Tognetti
Luca Tognetti 2023 年 1 月 9 日
コメント済み: Luca Tognetti 2023 年 1 月 9 日
Hi! this is my app in app designer. I'm new in matlab and app designer.
the main features that my app does is to load an image file (a plot) by clicking on "Load IMAGE". the selected plot will appear in the plot area in the middle of the UI. Then, after clicking on "Axes Calibration" I would like to select some points in the plot with the mouse and store the [x,y] value of the selected points.
How can I write the function that stores the value of the clicked points??
thank you in advance

回答 (1 件)

Cameron
Cameron 2023 年 1 月 9 日
編集済み: Cameron 2023 年 1 月 9 日
Are you using a UIAxes to show your image? If so, you can do something like this:
function UIAxesButtonDown(app, event)
C = get (app.UIAxes,'CurrentPoint');
XValue = C(1,1);
YValue = C(1,2);
end
And from there you should be able tovcalibrate the points from your graph and the image.
  1 件のコメント
Luca Tognetti
Luca Tognetti 2023 年 1 月 9 日
thanks for the reply, yes I'm using UIAxes.
Anyway this function doesn't work. When I try to print the x and y value nothing come out

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

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by