real-time ROI and scatter plot in app designer

조회 수: 1 (최근 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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by