How do I extract daily data from a NC yearly (which contain 365days) file?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Habtamu Tsegaye
le 27 Août 2021
Réponse apportée : Augusto Gabriel da Costa Pereira
le 21 Déc 2022
I need to extract the daily data from netCDF yearly data which contains 365 days. in the code, the asign prep could not read the variable precipitation from the file
clc
close all
clear all
filename = ('D:\Rainfall_Data_from_Satelite\CHIRPS\chirps-v2.0.2002.days_p05.nc');
info = ncinfo(filename);
% Variable 1
lat = double(ncread(filename,'latitude'));
% Variable 2
lon = double(ncread(filename,'longitude'));
% Variable 3
% data are for each day of the year (2019)
time = ncread(filename,'time');
unitsTime = info.Variables(4).Attributes(1).Value;
fprintf(1,'Time Units: %s\n',unitsTime);
tDatenum = datenum(1980,1,1,time,0,0); %1980-1-1 0:0:0
% Variable 4
prep = ncread(filename,'precip');
0 commentaires
Réponses (1)
Augusto Gabriel da Costa Pereira
le 21 Déc 2022
See, this link below has the answer you want. if you don't get your goal comment here
https://la.mathworks.com/matlabcentral/answers/1882277-error-sending-data-to-xlsx-netcdf?s_tid=mlc_ans_email_view#answer_1133137
0 commentaires
Voir également
Catégories
En savoir plus sur NetCDF dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!