# states

Position and velocity of satellite

## Syntax

``pos = states(sat)``
``[pos,velocity] = states(sat)``
``[___] = states(sat,timeIn)``
``[___] = states(___,'CoordinateFrame',C)``
``[pos,velocity,timeOut] = states(___)``

## Description

````pos = states(sat)` returns a 3-by-n matrix with the position history of the satellite `sat` in the Geocentric Celestial Reference Frame (GCRF), where n is the number of time samples in the satellite scenario simulation.```

example

````[pos,velocity] = states(sat)` returns a 3-by-n matrix with the position and velocity history of satellite in GCRF.```
````[___] = states(sat,timeIn)` also returns the outputs at the times specified by `timeIn`. Specify any output argument combinations from previous syntaxes.```
````[___] = states(___,'CoordinateFrame',C)` returns the outputs in the coordinates specified by `C`.```
````[pos,velocity,timeOut] = states(___)` returns the position and velocity history of the satellite and the corresponding time in Universal Time Coordinated (UTC).```

## Examples

collapse all

Create a satellite scenario object.

`sc = satelliteScenario;`

Add a satellite to the scenario.

```tleFile = "eccentricOrbitSatellite.tle"; sat = satellite(sc,tleFile);```

Obtain the position and velocity of the satellite in the Earth-centered Earth-fixed (ECEF) frame corresponding to May 25, 2021, 10:30 PM UTC.

```time = datetime(2021,5,25,22,30,0); [position,velocity] = states(sat(1),time,"CoordinateFrame","ecef")```
```position = 3×1 107 × -0.9431 -3.0675 2.7404 ```
```velocity = 3×1 103 × -1.2166 0.4198 -1.6730 ```

## Input Arguments

collapse all

Satellite, specified as a row vector of `Satellite` objects.

Time at which the output is calculated, specified as a scalar. If you do not specify a time zone, then the time zone is assumed to be UTC.

Coordinate frame in which the outputs are returned, specified as `'ecef'`, `'inertial'`, or `'geographical'`.

• The `'ecef'` option returns the coordinates in the Earth Centered Earth Fixed (ECEF) frame. For more information on ECEF frames, see Earth-Centered Earth-Fixed Coordinates.

• The `'inertial'` option returns the coordinates in the GCRF frame.

• The `'geographic'` option returns the position as [lat; lon; altitude], where lat and lon are latitude and longitude in degrees, and altitude is the height above the wgs84 ellipsoid in meters. The velocity returned is ECEF, defined in the local North-East-Down (NED) frame.

## Output Arguments

collapse all

Position history of the satellite, returned as a scalar, vector, matrix, or N-D array in the GCRF frame. Units are in meters.

Velocity history of the satellite, returned as a scalar, vector, matrix, or N-D array in the GCRF frame. Units are in meters/second.

Time samples of the position and velocity of the satellite, returned as a scalar or vector. If time histories of the position and velocity of the satellite are returned, `timeOut` is a row vector.

### Topics

Introduced in R2021a

## Support 평가판 신청