How do I extract daily data from a NC yearly (which contain 365days) file?
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Augusto Gabriel da Costa Pereira
on 21 Dec 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 Comments
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!