isfield

Class: geopoint

Returns true if dynamic property exists

Syntax

TF = isfield(P,name)
TF = isfield(P,names)

Description

TF = isfield(P,name) returns true if the value specified by the string name is a dynamic property of the geopoint vector, P.

TF = isfield(P,names) return true for each element of the cell array, names, that is a dynamic property of P. TF is a logical array of the same size as names.

Input Arguments

P

geopoint vector

name

Name of the dynamic property

names

Cell array of names of dynamic properties

Output Arguments

TF

Boolean. 1 if P contains the specified fields or 0 otherwise.

Examples

expand all

Check for Field Name

Create a geopoint vector and check field names.

p = geopoint(-33.961, 18.484, 'Name', 'Cape Town');
isfield(p, 'Latitude')
isfield(p, 'Name')
ans =

     0


ans =

     1
Was this topic helpful?