ismultipoint
Syntax
Description
Examples
Determine Which Array Elements Are Multipoint Shapes
Create an array of point shapes.
shape = geopointshape({39,[38 -30 29]},{-113,[-66 -31 42]});
Determine which elements of the array are multipoint shapes. The result indicates that the second element is a multipoint shape.
tf = ismultipoint(shape)
tf = 1x2 logical array
0 1
Determine If Array Contains Multipoint Shapes
Accessing the coordinate properties of a point shape array is not supported when the array contains multipoint shapes. You can determine whether an array contains multipoints by using the ismultipoint
and any
functions.
Create an array of geopointshape
objects that represent locations in Boston, and determine which are multipoint shapes.
GT = readgeotable("boston_placenames.gpx");
shape = GT.Shape;
tf1 = ismultipoint(shape);
Use the any
function to check whether the ismultipoint
function detected any multipoint shapes in the array. A value of 0
indicates that the array does not contain multipoint shapes.
any(tf1,"all")
ans = logical
0
Create a multipoint shape that represents three locations. Add the multipoint shape to the end of the array.
mp = geopointshape({[42.3625 42.3693 42.3477]},{[-71.0904 -71.0733 -71.0787]}); shape(end+1) = mp;
Verify that the array contains a multipoint shape.
tf2 = ismultipoint(shape);
any(tf2,"all")
ans = logical
1
Input Arguments
shape
— Shape objects
array of geopointshape
, geolineshape
, and
geopolyshape
objects | array of mappointshape
, maplineshape
, and
mappolyshape
objects
Shape objects, specified as one of these options:
An array in which each element is a
geopointshape
,geolineshape
, orgeopolyshape
object.An array in which each element is a
mappointshape
,maplineshape
, ormappolyshape
object.
Output Arguments
tf
— Indicator for multipoint shape
logical array
Indicator for multipoint shape, returned as a logical array. The size of
tf
matches the size of shape
.
A logical
1
(true
) indicates that the corresponding shape object is a multipoint shape.A logical
0
(false
) indicates that the corresponding shape object is not a multipoint shape.
You can identify points of interest by using tf
to index into
shape
.
Points of Interest | Example Code |
---|---|
Query multipoint shapes | shape(tf) |
Query shapes that are not multipoint shapes | shape(~tf) |
Version History
Introduced in R2022b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
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.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)