read date in NCD file
7 ビュー (過去 30 日間)
古いコメントを表示
sherien al-azerji
2015 年 10 月 19 日
コメント済み: Walter Roberson
2015 年 10 月 19 日
Dear all, I'm trying to extract the dates from NCD file where the date should start from 1st_january 1962 untill 31st_December 1962. However When I extract the date from the NCD file, I get these numbers (for example the first five days) 59169 59170 59171 59172 59173 and when tried to convert these numbers to a calender date I get these dates. 0161 12 30 0161 12 31 0162 01 01 0162 01 02 0162 01 03 I also checked the NCD file using the NCD viewer and I found that the dates are from 1st_January 1962, so there is nothing wrong with the NCD file, I just need to know how to convert these numbers to the exact date. Can anyone help me to convert these numbers to calendar dates starting from 1st_january 1962 please?
Thanks in advance
0 件のコメント
採用された回答
Walter Roberson
2015 年 10 月 19 日
Add datenum('1800-1-1') to those 59169 59170 59171 59172 59173 to get the datenum representation in MATLAB. You can then datestr() them and so on.
2 件のコメント
Walter Roberson
2015 年 10 月 19 日
Instead of converting them to strings, use datevec() and extract the first three columns.
その他の回答 (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!