day and night from lat, long, time?
8 ビュー (過去 30 日間)
古いコメントを表示
I have a vector of latitude, and vector of longitude, and a vector of UTC time.
Is there a simple way to determine whether or not it is day or night at each point? Just a simple 0,1 kind of answer?
1 件のコメント
James Tursa
2020 年 4 月 5 日
Convert it to a pointing vector and then find the angle between that and the Sun pointing vector. Do you have a Sun position function?
採用された回答
その他の回答 (2 件)
Ameer Hamza
2020 年 4 月 5 日
If you have the Mapping toolbox, you can use timezone(): https://www.mathworks.com/help/map/ref/timezone.html to find the hour offset from the UTC given the longitude value.
From the offset value, you can convert the UTC to the local time and based on your threshold, whether it is day or night. Or you can also use datetime() function to convert the UTC to the local time.
0 件のコメント
Meysam Mahooti
2021 年 5 月 26 日
https://www.mathworks.com/matlabcentral/fileexchange/60157-sunrise-sunset?s_tid=srchtitle
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!