struct

Class: mappoint

Convert mappoint vector to scalar structure

Syntax

S = struct(p)

Description

S = struct(p) converts the mappoint vector, p, to a scalar structure, S.

Input Arguments

p

mappoint vector.

Output Arguments

S

Scalar structure of the mappoint vector p.

Examples

expand all

Converting a mappoint vector into struct

Create a mappoint vactor and convert it into a structure.

S = shaperead('worldcities');
p = mappoint(S)
S2 = struct(p)
class(S2)
p = 

 318x1 mappoint vector with properties:

 Collection properties:
    Geometry: 'point'
    Metadata: [1x1 struct]
 Feature properties:
           X: [1x318 double]
           Y: [1x318 double]
        Name: {1x318 cell}


S2 = 

    Geometry: 'point'
    Metadata: [1x1 struct]
           X: [1x318 double]
           Y: [1x318 double]
        Name: {1x318 cell}


ans =

struct
Was this topic helpful?