# accessPercentage

Percentage of time when access exists between first and last node defining the access analysis

## Syntax

``acpercent = accessPercentage(ac)``

## Description

example

````acpercent = accessPercentage(ac)` returns the percentages of time from start time to stop time of the satellite scenario when access exists between the first and last node of each access object in the input vector.```

## Examples

collapse all

Create a satellite scenario object.

```startTime = datetime(2020,5,1,11,36,0); stopTime = startTime + days(1); sampleTime = 60; sc = satelliteScenario(startTime,stopTime,sampleTime);```

Add a ground station to the scenario.

`gs = groundStation(sc);`

```semiMajorAxis = [10000000 10000000]; % meters eccentricity = [0 0]; inclination = [0 30]; % degrees rightAscensionOfAscendingNode = [0 0]; % degrees argumentOfPeriapsis = [0 0]; % degrees trueAnomaly = [0 10]; % degrees sat = satellite(sc,semiMajorAxis,eccentricity, ... inclination,rightAscensionOfAscendingNode, ... argumentOfPeriapsis,trueAnomaly);```

Add access analysis between the ground station and each satellite.

```access(gs,sat(1)); access(gs,sat(2));```

Obtain the access percentage between the ground station and each satellite.

```ac = gs.Accesses; acPercent = accessPercentage(ac)```
```acPercent = 2×1 15.0000 14.9306 ```

## Input Arguments

collapse all

Access analysis, specified as a row vector of a `Access` objects.

## Outputs Arguments

collapse all

Access percentage, returned as a row vector of nonnegative numbers.

Note

When `AutoSimulate` of the satellite scenario is `true`, the percentage corresponds to the duration between `StartTime` and `StopTime`. When it is `false`, the percentage corresponds to the duration between `StartTime` and `SimulationTime`.

## Version History

Introduced in R2021a