File Exchange

image thumbnail


version 1.1 (13.8 MB) by David Garrison
Estimate Sunrise and Sunset Times


Updated 07 May 2020

View Version History

View License

We can estimate the time of sunrise and sunset for any location on the earth if we know the latitude, and longitude for that location. To estimate sunrise and sunset for any day of the year we need to calculate two values for a given date and place -- the equation of time and the hour angle.

This live script illustrates the technique used to estimate sunrise and sunset times.

Cite As

David Garrison (2021). Sunrise/Sunset (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Petru Gurduza

Jeff Dozier

Assumes that refraction is insignificant. Is it?

David Garrison

Ashok, This is a live script. You will need to have R2016a to run it.

Ashok Kumar

Dont waste your time, looking support from this person providing fake script.

MATLAB Release Compatibility
Created with R2020a
Compatible with R2019a and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!