isprop

Class: geoshape

True if property exists

Syntax

tf = isprop(s,name)
tf = isprop(s,names)

Description

tf = isprop(s,name) returns true if the value specified by the string, name is a property of the geoshape vector, s.

tf = isprop(s,names) returns true for each element of the cell array of strings, names, that is a property of s. tf is a logical array the same size as names.

Input Arguments

s

geoshape vector.

name

String specifying the property of the geoshape vector, s.

names

Cell array of strings specifying the property of the geoshape vector, s.

Output Arguments

tf

Boolean. 1 if the property exists with s ,0 otherwise.

Examples

expand all

Check if property exists

Create a geoshape vector and check if properties exist.

s = geoshape(-33.961, 18.484, 'Name', 'Cape Town');
isprop(s, 'Latitude')
isprop(s, 'Name')
ans =

     1


ans =

     1
Was this topic helpful?