How do I prompt user to draw a rectangle (region of interest) on a surf plot figure and display only the data points within that rectangle in a new surf plot?

8 views (last 30 days)
I am developing an app where the user can convert data from .txt files to an excel file then the application displays this data as a SURF or MESH plot. I would like to add the functionality where the user can draw a rectangle on the plot itself and then the application will display a new plot with just the values within the drawin rectangle. How would I go about adding the functionality of drawing the rectangle and getting the data just within that plot?

Accepted Answer

Sai Sri Pathuri
Sai Sri Pathuri on 6 Aug 2019
Hi,
You may use drawrectangle function to create rectangular ROI. To draw a new plot containing the values covered by ROI, you may create a custom function using source code of ImROI function.
The following links can be referred to get more information about above functions.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!