real-time ROI and scatter plot in app designer

2 visualizzazioni (ultimi 30 giorni)
John Allen
John Allen il 8 Giu 2024
Modificato: John Allen il 10 Giu 2024
So I am working on an app using app designer. The app has one UIAxes and is updated in real time with a scatter plot, based on a timer function. I also have a button that when clicked, enables me to place a rectangle ROI on the UIAxes. Those two things by themselves work nicely. However, the problem is when I create the ROI by clicking on the button and right after that enabling the real time scatter plot updates, it removes my ROI from the UIAxes. I need to have this ROI enabled on the same UIAxes as the real time scatter plot updates, for further processing. How can I fix this or do this, without app designer removing the ROI as soon as I start the scatter plot updates?
here is a video that shows the problem https://streamable.com/ry6gpv
so as you can see in the video, there are two scenarios that dont work, i would be happy if either worked, but both would be perfect scenario:
1) i start the real time scatter plot and then try to draw a roi on top, it doesnt let me or show it at all
2) i draw the roi first and then start the real time scatter plot, but it then removes my roi
so it seems no matter what the case, i cant have both at the same time. how to fix that?
I simplified the app to the bare bones, so it highlights the main problem that I need fixed, as described above. I attached the text version of the full app designer code as well as the app designer project file.
Thanks!
edit: I solved my problem from Discord server.

Risposte (1)

Image Analyst
Image Analyst il 9 Giu 2024
Once you have the ROI, you can get the x and y coordinates from the roi object. I didn't look at your code but when you then start drawing all those dots and moving them, you can call rectangle() to also draw the ROI.
  1 Commento
John Allen
John Allen il 10 Giu 2024
thanks, but I actually fixed my problem thanks to someone on Discord.

Accedi per commentare.

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by