Compute GPS Week

MATLAB function to obtain the GPS week, and also the number of seconds that have elapsed from the start of the GPS week.
53 download
Aggiornato 16 dic 2023

Visualizza la licenza

This is a MATLAB function to obtain the GPS week, as well as the number of seconds that have elapsed from the start of the GPS week for any given sets of date/time.
The function returns the GPS week numbers (weeks) and the numbers of seconds that has elapsed since the start of the GPS week (secs) for a given set of date vectors (dv)
dv can be a vector or matrix in which the columns correspond to the form [year month day_of_month] or [year month day_of_month hour minute sec] in universal time UT. Example: for 31 March 2023, dv is [2023 3 31] at the UT start of the day, and [2023 3 31 15 36 0] at 15:36:00 UT of the same day.
The syntax is:
[weeks, secs] = gpsweek(dv)
For example, to get the GPS week for 31 March 2023: [weeks, secs] = gpsweek([2023 3 31]) which gives: weeks = 2255 as the GPS week, and secs = 432000 as the number of seconds that has elapsed since the start of the gps week
[week, secs] = gpsweek([2023 3 31 15 36 0]) gives:
week = 2255 as the GPS week, and secs = 488160 as the number of seconds that has elapsed since the start of the gps week
NOTE: THIS FUNCTION CAN BE USED WITH MULTIPLE DATE VECTORS SUPPLIED AT ONCE, AS A MATRIX RETAINING THE SAME NUMBER OF INPUT COLUMNS

Cita come

Daniel Okoh (2025). Compute GPS Week (https://it.mathworks.com/matlabcentral/fileexchange/156487-compute-gps-week), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2023b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0