File Exchange

image thumbnail

GPS Visibility Predictor

version (2.63 MB) by Eric Ogier
Real time simulator for visibility prediction of GPS satellites


Updated 15 Mar 2019

View Version History

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

This application consists of a real time simulator of GPS constellation, including a suite of visualizations:
- World map with satellite geodetic positions, ground tracks and numeric GPS data,
- Sky map with satellite polar coordinates with regard to the local tangent plane,
- Visibility indicators, with satellites rise and set instants, and the number of visible and healthy satellites,
- Orbital planes and GPS constellation status.

The computation of GPS data is based on:
- Yuma or SEM format almanac (available online),
- UTC time from computer or user defined GPS time,
- User defined reference position,
- GPS operational advisory or constellation status (available online).

User manual:

Video demonstrations:

Cite As

Eric Ogier (2021). GPS Visibility Predictor (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (14)


Eric Ogier

@Jianming She
There is a possibility that the almanac you use is old compared to the date you set.
The groundtracks are computed by updating the groundtracks obtained at the reference time of almanac with the longitude shift due to the fact that twice the revolution periods are not exactly equal to one sidereal day (difference of 1 or 2s) while the current satellite positions are totally recomputed (not updated from reference positions).
This compensation could not be accurate enough at the date you set.

Jianming She

I have a problem to the plot: some satellite positions are way off the ground track lines. I tried to run it on both R2019a and 2020b, they show the same issue. Any suggestion? Thanks!


Eric Ogier

I think your problem comes from the file separator used in the initialization file "INI\default.ini".
The section titled [MAP] defines the default map file "File = 'MAP\CoastLines.mat'", including Windows separator.
If you substitute "/" (MAC) to "\" (Windows) in INI-files, you should solve the problem.
You could also improve the robustness at line 1398 by changing "Borders = open(MapFile);" for "Borders = open(strrep(MapFile,'\',filesep));" (filesep: MATLAB instruction to get the separator of your OS).

Scott Roberts

On R2020a (Mac), I'm seeing the following errors:

Warning: JAVACOMPONENT will be removed in a future release. For more information see UI Alternatives for MATLAB Apps on
> In javacomponent (line 85)
In GPS/CreationAxes (line 477)
In GPS (line 87)
Error using open (line 86)
File 'MAP\CoastLines.mat' not found.

Error in GPS/UpdateMap (line 1398)
Borders = open(MapFile);

Error in GPS (line 116)

Eric Ogier

"wgs84ellipsoid" is a function from "Mapping Toolbox", used to define the reference ellipsoid for the following coordinates conversion functions:
- "geodetic2ecef"
- "ecef2geodetic"
- "geodetic2aer"
- "enu2geodetic"
(see argument Object.Ellipsoid)
If such an error message happens, you should encounter access problems with this toolbox (no license or too old version of MATLAB).

You can substitute your own conversion functions to these 4 embedded functions not to use "wgs84ellipsoid" or use an alternative toolbox.

Marta Stanska

Error using GPS (line 44)
Invalid default value for property 'Ellipsoid' in class 'Constellation':
Undefined function 'wgs84Ellipsoid' for input arguments of type 'char'.

How to fix it? It doesnt work

Dave Silsbee

Tested under R2018a, R2018b, and R2019a - no issues with the GUIs. However, the Current Folder must be ..\GPS\GPS for all file I/O related functions (ALM, INI, ...) to work. Adding with Subfolders to the MATLAB Path runs the GUIs correctly, but the aforementioned file I/O's crash. Perhaps this should be pointed out in the User's Manual. If its already there and i missed it, my apologies.

An excellent application.

Brandon Polcawich

Will Campbell

Kverner Studio

Eric Ogier

I didn't have the possibility to check the behavior of the GUIs with MATLAB R2018b. Could you indicate the line at which the application fails ? Are you sure the configuration file (see directories) was available when you started the program ?

Stephen Forczyk

I tried to get this to run under R2018b all the GUI's fail-says index exceed matrix dimensions

MATLAB Release Compatibility
Created with R2018a
Compatible with R2016b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!