ncreadtime
Syntax:
The very first argument should be the variable values and can be extracted as ncread(filename,'time')
Second argument is the time units, which can be extracted as ncreadatt(filename,'time','units')
Third argument is the format, in which user needs the output
Following are some of the examples:
Example 1: If the user needs to have time in 'dd/mm/yyyy_hh' format
ncreadtime(nctimevar,'hours since 12-01-2015 12:00:00','dd/mm/yyyy_hh')
Example 2: If the user is not providing the choice of output
time format, program will print in 'dd/mm/yyyy_HH' by default
ncreadtime(nctimevar,'hours since 12-01-2015 12:00:00')
Example 3: If you do not wish to write manually the time units
everytime, user can prefer to use the following command, but
make sure input file should have units in the time variable
ncreadtime(ncread(file,'time'),ncreadatt(filename,'time','units'),'yyyymmdd');
Citation pour cette source
ANKUR KUMAR (2026). ncreadtime (https://fr.mathworks.com/matlabcentral/fileexchange/87894-ncreadtime), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxTags
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.1 | Removed bugs. |
||
| 1.0.0 |
