필터 지우기
필터 지우기

What's wrong with my 'NetCDF'?

조회 수: 1 (최근 30일)
CHANG XV
CHANG XV 2019년 11월 14일
댓글: CHANG XV 2019년 11월 17일
I need to change some '*.nc' files to '*.mat' files. I choose to change them to text files first (as the code showed below), but there seems something wrong with my 'ncread'. I've put the warning in this picture. I wonder know if my code have some problem? Can my code changes those '.nc' files to text files and then save the text files? AND If there have something wrong, please tell me what should I do to solve it? THANKS!!!!
clc;
clear;
datadir='D:\Sort out\Original\China_hourly_rainfall_FiT_data_output\hourly_FiT_2008_output\';
filelist=dir([datadir,'*.nc']);
k=length(filelist);
b=[];
for s=1:k
filename=[datadir,filelist(s).name];
data=ncread(filename,'value');
[r, c] = size(data);
f = fopen(filename, 'wt');
for i = 1 : r
for j = 1 : c
fprintf(f, '%5d', data(i, j));
end
fprintf(f, '\n');
end
fclose(f);
end
微信截图_20191114154802.png
  댓글 수: 2
CHANG XV
CHANG XV 2019년 11월 17일
I am sorry showing my appareciate to your help such late. It seems that my nc files are cruped, and I'm trying to find out the reason.

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

답변 (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