(Not recommended) Block MATLAB command line until ROI creation is finished
wait is not recommended. For more information, see Compatibility Considerations.
pos = wait(h)
v = wait(he)
Interactively place a rectangle by clicking and dragging. Use
wait to block the MATLAB command line. Double-click on the rectangle to resume execution of the
MATLAB command line.
imshow('pout.tif') h = imrect; position = wait(h)
Interactively place an ellipse by clicking and dragging. Use
wait to block the MATLAB command line. Double-click on the ellipse to resume execution of the
MATLAB command line.
imshow('coins.png') h = imellipse; position = wait(h)
pos— Position of ROI object
Position of the ROI object, returned as a numeric array. The shape of the
array depends on the type of ROI object, and is consistent with the output
|ROI Object||Returned position|
|n-by-2 matrix. The two columns define the x- and y-coordinates, respectively, of the n points along the boundary of the freehand region.|
|2-by-2 matrix of the form |
|1-by-2 vector of the form |
|n-by-2 matrix. The two columns define the x- and y-coordinates, respectively, of each of the n vertices.|
|4-element vector of the form |
v— Vertices of ellipse ROI object
Vertices of ellipse ROI object, returned as an n-by-2
matrix. The two columns define the x- and
y-coordinates, respectively, of each of the
n vertices. The form of the matrix is consistent with
the output of
Not recommended starting in R2018b
Starting in R2018b, new ROI functions and classes replaced the existing ROI functions and objects, as described in the table. The new classes provide more functional capabilities, such as face color transparency. The new classes also support events that you can use to respond to changes in your ROI such as moving or being clicked. Switch to the new ROIs to take advantage of the additional capabilities and flexibility. For more information on creating ROIs using the new ROI functions, see ROI Creation Overview.
wait function operates on the old ROI objects and is no
longer recommended. For the new ROI objects, you can define a custom wait function
that blocks the MATLAB command line until you have finished positioning the ROI. The new ROI
objects enable you to resume execution of the command line after several types of
actions, such as clicking the ROI while pressing the Shift key or clicking a
specific part of the ROI such as the label. For an example, see Use Wait Function After Drawing ROI.
There are no plans to remove the old ROI objects or the
function at this time.