Main Content

# pseudoranges

Pseudoranges between GNSS receiver and satellites

## Syntax

``p = pseudoranges(recPos,satPos)``
``[p, pdot] = pseudoranges(___,recVel, satVel)``
``[p, pdot] = pseudoranges(___Name,Value)``

## Description

````p = pseudoranges(recPos,satPos)` returns the pseudoranges between the receiver at position `recPos` and the satellites at positions `satPos`.```

example

````[p, pdot] = pseudoranges(___,recVel, satVel)` returns the pseudorange rates `pdot` between the receiver and satellites. Use this syntax with the input arguments in the previous syntax. ```
````[p, pdot] = pseudoranges(___Name,Value)` specifies the measurement noise for the ranges and range rates using name-value arguments. For example, `[p pdot] = pseudoranges(__,'RangeAccuracy',2)` sets the measurement noise in pseudoranges, specified as a scalar standard deviation in meters.```

## Examples

collapse all

Use the `pseudoranges` function to get the pseudorange and pseudorange rate for given satellite and receiver positions and velocities. Get the satellte positions and velcoties using the `gnssconstellation` function.

Specify a receiver position in geodetic coordinates (latitude, longitude, altitude) and receiver velocity in the local navigation frame.

```recPos = [42 -71 50]; recVel = [1 2 3];```

Get the satellite positions for the current time.

```t = datetime('now'); [gpsSatPos,gpsSatVel] = gnssconstellation(t);```

Get the the pseudoranges and pseudorange rates between the receiver and satellites.

`[p,pdot] = pseudoranges(recPos,gpsSatPos,recVel,gpsSatVel);`

## Input Arguments

collapse all

Receiver position in geodetic coordinates, specified as a three-element vector of the form [latitude longitude altitude]

Data Types: `single` | `double`

Satellite positions in the Earth-centered Earth-fixed (ECEF) coordinate system in meters, specified as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: `single` | `double`

Receiver velocity in the local navigation frame using north-east-down (NED) coordinates, specified as a three-element vector of the form [vx vy vz].

Data Types: `single` | `double`

Satellite velocities in the Earth-centered Earth-fixed (ECEF) coordinate system in meters per second, specified as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: `single` | `double`

### Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example: `'RangeAccuracy','0.5'` sets the measurement noise of the pseudoranges to 0.5 meters.

Measurement noise in pseudoranges, specified as a scalar standard deviation in meters.

Data Types: `single` | `double`

Measurement noise in pseudorange rates, specified as a scalar standard deviation in meters per second.

Data Types: `single` | `double`

## Output Arguments

collapse all

Pseudoranges between the satellites and receiver, returned as an n-element vector in meters.

Data Types: `single` | `double`

Pseudorange rates between the satellites and receiver, returned as an n-element vector in meters per second. If you do not provide velocity inputs, this output is zero.

Data Types: `single` | `double`

## Extended Capabilities

### C/C++ Code GenerationGenerate C and C++ code using MATLAB® Coder™.

Introduced in R2021a