フィルターのクリア

real-time ROI and scatter plot in app designer

8 ビュー (過去 30 日間)
John Allen
John Allen 2024 年 6 月 8 日
編集済み: John Allen 2024 年 6 月 10 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2024 年 6 月 9 日
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 件のコメント
John Allen
John Allen 2024 年 6 月 10 日
thanks, but I actually fixed my problem thanks to someone on Discord.

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

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by