필터 지우기
필터 지우기

Merge netCDF files to have sequence of daily precipitation of several weather stations

조회 수: 1 (최근 30일)
Please, I posted this question long time ago and I didn't get any help. Please, I appreciate any help and suggestions! The question posted here: https://www.mathworks.com/matlabcentral/answers/343582-merge-netcdf-files-to-have-sequence-of-daily-precipitation-of-several-weather-stations
Thanks, Majid
  댓글 수: 6
KSSV
KSSV 2017년 7월 12일
Dear friend....you need to have a look into nc files....that code is trying to read date, time, precipitation from the nc file. Your nc files doesn't have that information....
Majid Mohamod
Majid Mohamod 2017년 7월 12일
편집: Majid Mohamod 2017년 7월 12일
I tried to enlarge the study area and now I am getting results " the script works".
You had helped me someday to export the array as excel worksheets as shown below:
files = dir('*.nc') ;
nfiles = length(files) ;
P = cell(nfiles,1) ; % precipitation of all files
date = cell(nfiles,2) ;
time = cell(nfiles,2) ;
for i = 1:nfiles
%%Read dat
date{i,1} = ncreadatt(files(i).name,'/','HDF5_GLOBAL.BeginDate') ;
date{i,2} = ncreadatt(files(i).name,'/','HDF5_GLOBAL.EndDate') ;
%%Read time
time{i,1} = ncreadatt(files(i).name,'/','HDF5_GLOBAL.BeginTime') ;
time{i,2} = ncreadatt(files(i).name,'/','HDF5_GLOBAL.EndTime') ;
%%REad precipitation
P{i} = ncread(files(i).name,'precipitation') ;
end
myfile = 'myfile.xlsx' ;
for i = 1:nfiles
xlswrite(myfile,P{i},i)
end
Could you change the part of exporting from worksheet to excel file individually. Which mean each nc file will be excel file instead excel sheet?
I appreciate it man!
Majid

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by