Filter löschen
Filter löschen

Select points in a plot

36 Ansichten (letzte 30 Tage)
Luca Tognetti
Luca Tognetti am 10 Jan. 2023
Bearbeitet: Mario Malic am 10 Jan. 2023
Hi, I'm using the app designer and i want to select some points from a plot.
in the UIAxesButtonDown function I'm using this notation to "capture" the mouse position:
C = get (app.UIAxes,'CurrentPoint');
app.UITable.Data = C(1,1:2);
the problem is that I don't know how to store the X and Y values of the point I just clicked, because if I click again on the plot it will overwrite the previous point.
Thanks

Akzeptierte Antwort

Mario Malic
Mario Malic am 10 Jan. 2023
Bearbeitet: Mario Malic am 10 Jan. 2023
Hello,
It would be the best if you put data tips on the points you want to select then you can get them with these lines
dataTips = findall(fig, 'type', 'datatip'); % where the fig is your figure handle
pointCoords = cell2mat([get(dataTips, 'X'), get(dataTips, 'Y'), get(dataTips, 'Z')]);

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by