read date in NCD file
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sherien al-azerji
el 19 de Oct. de 2015
Comentada: Walter Roberson
el 19 de Oct. de 2015
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 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Oct. de 2015
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 comentarios
Walter Roberson
el 19 de Oct. de 2015
Instead of converting them to strings, use datevec() and extract the first three columns.
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!