Contenuto principale

localframe

R2026b

Create local Cartesian reference frame

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    refframe = localframe(lat,lon) creates a reference frame for a local Cartesian coordinate system. Specify the coordinates of the origin using lat and lon. The height of the origin is 0 meters. The object uses no terrain and the east-north-up (ENU) axes convention.

    refframe = localframe(lat,lon,ht) specifies the coordinates of the origin using lat, lon, and ht.

    refframe = localframe(___,Name=Value) creates the reference frame using options specified by one or more name-value arguments.

    Input Arguments

    collapse all

    Latitude of the origin, in degrees, specified as a scalar.

    Longitude of the origin, in degrees, specified as a scalar.

    Height of the origin, in meters, specified as a scalar. The height is referenced to the value specified by the Terrain argument. When you do not specify the Terrain argument, the function assumes no terrain and references the height to the WGS84 ellipsoid.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: localframe(lat,lon,ht,Terrain="gmted2010") creates a local reference frame with height values referenced to GMTED2010.

    Terrain name, represented as one of these values:

    • "none" — No terrain. Heights are referenced to the WGS84 ellipsoid.

    • "gmted2010" — Tiled global terrain derived from the GMTED2010 model by the U.S. Geological Survey (USGS) and National Geospatial-Intelligence Agency (NGA) and hosted by MathWorks®. Internet access is required to use "gmted2010".

    • String scalar or character vector — Name of custom terrain added using the addCustomTerrain function.

    This value sets the Terrain field of the structure array that is stored in the Datum property of the reference object.

    Data Types: char | string

    Descriptive name, specified as a string scalar or character vector.

    This argument sets the Name property of the reference frame object.

    Data Types: char | string

    Axes convention, specified as one of these values:

    • "enu" — East-north-up (ENU)

    • "ned" — North-east-down (NED)

    This argument defines the order of the position, orientation, and motion vectors. For more information about axes conventions, see Specify Coordinate Conventions for 3D Scenarios.

    This argument sets the AxesConvention property of the reference frame object.

    Output Arguments

    collapse all

    Local Cartesian reference frame, returned as a ReferenceFrame object.

    For a local reference frame, the position, orientation, and motion vectors are referenced to Cartesian axes, where the origin is at the specified geographic coordinates.

    This table describes the property values of the reference frame created by this function.

    PropertyValue
    Name"Local Frame"
    ReferenceBody"Earth"
    Datum

    A structure array with these fields and values:

    • Origin — Origin, returned [lat lon ht]. These values correspond to the lat, lon, and ht input arguments.

    • Spheroid — WGS84 ellipsoid, returned as a referenceEllipsoid object.

    • Terrain — Name of terrain, returned as "none".

    CoordinateSystem"cartesian"
    AxesConvention"enu"

    Version History

    Introduced in R2026b