How do I extract daily data from a NC yearly (which contain 365days) file?

2 ビュー (過去 30 日間)
Habtamu Tsegaye
Habtamu Tsegaye 2021 年 8 月 27 日
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');

回答 (1 件)

Augusto Gabriel da Costa Pereira
Augusto Gabriel da Costa Pereira 2022 年 12 月 21 日
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

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by