Draw points on UIAxes until you press a button in APP DESIGNER
Show older comments
Hi, I have a problem, I'm developing an application using the app designer but there comes a moment when I have to be able to select points from an image I show in a UIAxes using the drawcircle function.
What I need is to be able to enter points (without having defined how many in advance) until I press on a status button, but I also need to save the position of the points, what I came up with was this but it doesn't work well
i = 1;
ROI = zeros(8,2);
while app.AplicarInterpolacinButton.Value == 0
a = drawpoint(app.UIAxes);
ROI(i,:) = a.Position;
i = i + 1;
end
Thank you.
5 Comments
Adam Danz
on 9 Jun 2020
What's the question/problem?
Alejandro Fernández
on 9 Jun 2020
Adam Danz
on 9 Jun 2020
Your code should already be doing that. When you call drawpoint(app.UIAxes), it starts an interactive draggable point within your axes and it waits for the user to interact with it. It may require r2020a. To get the (x,y) coordinate of the point, a.Position.
Alejandro Fernández
on 9 Jun 2020
Adam Danz
on 9 Jun 2020
Now the problem is clear. I'll write an answer below.
Accepted Answer
More Answers (0)
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!