Read data from two-line element (TLE) file

Since R2023b

## Syntax

``tleStruct = tleread(tleFile)``

## Description

example

````tleStruct = tleread(tleFile)` reads the data from a two-line element (TLE) file, `tleFile`. The function outputs a vector of structures containing data from the input TLE file in `tleStruct`. You can then use the `propagateOrbit` function to calculate the position and velocity using `tleStruct`.If the TLE file contains multiple entries for the same catalog number, the function outputs only the data corresponding to the latest epoch (defined for each TLE set).```

## Examples

collapse all

Read data from the TLE file, `'leoSatelliteConstellation.tle'`, and calculate the position and velocity from the TLE structure file, `tleStruct`.

Read the data from the TLE file `'leoSatelliteConstellation.tle'`, which is on the MATLAB® path and provided with Aerospace Toolbox.

`tleStruct = tleread('leoSatelliteConstellation.tle')`
```tleStruct = 40×1 struct array with fields: Name SatelliteCatalogNumber Epoch BStar RightAscensionOfAscendingNode Eccentricity Inclination ArgumentOfPeriapsis MeanAnomaly MeanMotion```

Calculate the position and velocity corresponding to the input time using the TLE data defined in `tleStruct`.

`[r,v] = propagateOrbit(datetime(2022, 1, 3, 12, 0, 0),tleStruct)`
```r(:,:,1) = 1.0e+06 * -4.3726 1.2106 -5.6292 r(:,:,2) = 1.0e+06 * 2.8278 3.3101 5.7417 r(:,:,3) = 1.0e+06 * -1.6252 6.4804 2.7661 r(:,:,4) = 1.0e+06 * -6.4733 3.1872 -0.4959 r(:,:,5) = 1.0e+06 * -6.5300 -1.8740 -2.5197 r(:,:,6) = 1.0e+06 * 4.2696 -2.9549 5.0050 r(:,:,7) = 1.0e+06 * -4.3207 -0.2621 -5.8029 r(:,:,8) = 1.0e+06 * -0.4354 6.3188 3.5007 r(:,:,9) = 1.0e+06 * 3.1625 -4.6176 -4.5565 r(:,:,10) = 1.0e+06 * -6.4680 -0.5957 -3.1486 r(:,:,11) = 1.0e+06 * -5.0509 -4.3876 -2.7586 r(:,:,12) = 1.0e+06 * -4.5717 4.3305 3.5445 r(:,:,13) = 1.0e+06 * -4.8265 0.2134 5.3573 r(:,:,14) = 1.0e+06 * 3.3022 -3.9510 -5.0798 r(:,:,15) = 1.0e+06 * -6.4064 -2.3789 -2.3156 r(:,:,16) = 1.0e+06 * 4.9215 -1.5755 -5.0658 r(:,:,17) = 1.0e+06 * -4.2865 0.5024 5.7884 r(:,:,18) = 1.0e+06 * -4.1508 -5.3584 -2.5396 r(:,:,19) = 1.0e+06 * 0.8586 -4.2505 -5.8000 r(:,:,20) = 1.0e+06 * 1.6331 -3.9315 -5.8582 r(:,:,21) = 1.0e+06 * -3.4834 -2.7205 5.7141 r(:,:,22) = 1.0e+06 * -0.3378 -5.8660 4.1801 r(:,:,23) = 1.0e+06 * -2.3699 -5.9500 -3.3499 r(:,:,24) = 1.0e+06 * -3.5223 -3.3199 5.3567 r(:,:,25) = 1.0e+06 * 5.8316 -2.5668 -3.4419 r(:,:,26) = 1.0e+06 * 0.5307 -4.0214 5.9809 r(:,:,27) = 1.0e+06 * -2.5070 -3.5297 5.7770 r(:,:,28) = 1.0e+06 * 5.2806 -1.5994 -4.6575 r(:,:,29) = 1.0e+06 * -6.7516 -2.5075 0.5515 r(:,:,30) = 1.0e+06 * -4.7709 2.9142 -4.5849 r(:,:,31) = 1.0e+06 * -3.5965 2.7142 -5.6577 r(:,:,32) = 1.0e+06 * -3.5367 -2.2889 5.8683 r(:,:,33) = 1.0e+06 * -7.2201 0.2849 0.1373 r(:,:,34) = 1.0e+06 * -4.9627 -1.2222 -5.1376 r(:,:,35) = 1.0e+06 * 0.6899 -4.5016 5.5907 r(:,:,36) = 1.0e+06 * 4.0468 2.2131 -5.5739 r(:,:,37) = 1.0e+06 * -5.3549 -4.8576 -0.1584 r(:,:,38) = 1.0e+06 * 6.0404 -1.8887 3.4976 r(:,:,39) = 1.0e+06 * 5.4127 1.6086 4.5006 r(:,:,40) = 1.0e+06 * -6.4090 1.6928 -2.9143 v(:,:,1) = 1.0e+03 * 0.4943 -7.1498 -1.9149 v(:,:,2) = 1.0e+03 * -4.0192 6.0766 -1.5144 v(:,:,3) = 1.0e+03 * -4.9766 1.0605 -5.4091 v(:,:,4) = 1.0e+03 * -1.4616 -3.9252 -6.1322 v(:,:,5) = 1.0e+03 * 3.2088 -3.7044 -5.5631 v(:,:,6) = 1.0e+03 * 0.9341 6.6797 3.1401 v(:,:,7) = 1.0e+03 * 1.8369 -7.1027 -1.0508 v(:,:,8) = 1.0e+03 * -5.0858 2.3556 -4.8638 v(:,:,9) = 1.0e+03 * 6.3179 0.5077 3.8802 v(:,:,10) = 1.0e+03 * 2.9293 -4.4690 -5.1661 v(:,:,11) = 1.0e+03 * 4.6556 -1.9379 -5.4413 v(:,:,12) = 1.0e+03 * -5.3740 -1.6816 -4.8478 v(:,:,13) = 1.0e+03 * -3.2646 -6.1068 -2.7019 v(:,:,14) = 1.0e+03 * 6.5709 1.5692 3.0633 v(:,:,15) = 1.0e+03 * 3.3442 -3.5794 -5.5948 v(:,:,16) = 1.0e+03 * 4.7665 4.7091 3.1755 v(:,:,17) = 1.0e+03 * -2.5062 -6.8824 -1.2637 v(:,:,18) = 1.0e+03 * 4.8713 -1.1945 -5.4657 v(:,:,19) = 1.0e+03 * 6.7905 2.7845 -1.0447 v(:,:,20) = 1.0e+03 * 6.4822 3.5498 -0.5660 v(:,:,21) = 1.0e+03 * 2.5726 -6.7711 -1.6434 v(:,:,22) = 1.0e+03 * 4.9552 -3.4072 -4.3792 v(:,:,23) = 1.0e+03 * 5.5151 0.5805 -4.9428 v(:,:,24) = 1.0e+03 * 2.2327 -6.5935 -2.6017 v(:,:,25) = 1.0e+03 * -0.5055 5.4920 -4.9559 v(:,:,26) = 1.0e+03 * 7.3355 1.1602 0.1376 v(:,:,27) = 1.0e+03 * 6.8592 -2.4664 1.4629 v(:,:,28) = 1.0e+03 * -1.4396 6.2341 -3.7779 v(:,:,29) = 1.0e+03 * 1.8985 -3.7666 6.1154 v(:,:,30) = 1.0e+03 * -5.5694 -3.0137 3.8774 v(:,:,31) = 1.0e+03 * -6.0027 -3.8907 1.9583 v(:,:,32) = 1.0e+03 * 4.3350 -6.0269 0.2515 v(:,:,33) = 1.0e+03 * -0.0514 -4.3235 6.0454 v(:,:,34) = 1.0e+03 * -1.5791 -6.5457 3.0929 v(:,:,35) = 1.0e+03 * 7.1302 -1.1357 -1.7937 v(:,:,36) = 1.0e+03 * -5.2628 4.8689 -1.8870 v(:,:,37) = 1.0e+03 * 2.8075 -3.2824 6.0458 v(:,:,38) = 1.0e+03 * 4.0290 3.9657 -4.8152 v(:,:,39) = 1.0e+03 * 1.4390 6.1548 -3.9152 v(:,:,40) = 1.0e+03 * -3.4278 -4.0127 5.2093```

## Input Arguments

collapse all

TLE file, specified as a character vector or a string scalar. The file must exist in the current folder or in a folder on the MATLAB path, or the argument must include a full or relative path to a file. For more information on TLE files, see Two Line Element (TLE) Files.

Example: `'leoSatelliteConstellation.tle'`

Data Types: `char` | `string`

## Output Arguments

collapse all

TLE structures extracted from `tleFile`, returned as a vector of structs. To calculate the position and velocity using two-line-element (TLE) data, use this file as input to the `propagateOrbit` function. For more information on TLE-file structures, see Two Line Element (TLE) Files.

## Version History

Introduced in R2023b