TF = contains(R,xWorld,yWorld)
returns a logical array TF. Each element
TF(k) is true if and only if the
corresponding point
(xWorld(k),yWorld(k))
falls within the bounds of an image associated with 2-D spatial referencing
object R.
TF = contains(R,xWorld,yWorld,zWorld)
indicates whether each point falls within the bounds of an image associated with
3-D spatial referencing object R.
Check if certain world coordinates are in the image.
res = contains(R,[5 8 8],[5 10 257])
res = 1×3 logical array
1 1 0
This result indicates that the points (5,5) and (8,10) are within the image bounds, and that the point (8, 257) is outside the image bounds. This conclusion is consistent with the XWorldLimits and YWorldLimits properties of the spatial referencing object R.
This result indicates that the points (5,5,1) and (6,10,27.5) are within the image bounds. The points (6,10,28) and (8,257,1) are outside the image bounds. This conclusion is consistent with the XWorldLimits, YWorldLimits, and ZWorldLimits properties of the spatial referencing object R.
Coordinates along the z-dimension in the world
coordinate system, specified as a numeric scalar or vector.
zWorld is the same length as
xWorld and yWorld.
Flag indicating whether coordinates exist within the bounds of the image,
returned as a logical scalar or vector. TF is the same
length as the input coordinate vectors xWorld,
yWorld, and (when relevant)
zWorld.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.