file in matlab code
이전 댓글 표시
Hello, I have an issue in my code to read .netcdf files I try to read it with
temp=ncread('/home/yves/Documents/pre/argo09_14/aoml/1901006/1901006_prof.nc','TEMP');
It works But when I try to create the file first to make it easier to change the file, it doesn't work
rootdir='/home/yves/Documents/pre/argo09_14/aoml/1901006/'
list=dir(rootdir)
a=char(list.name);
filename=(a(5,:))
file = [rootdir, num2str(filename)];
The file created is
/home/yves/Documents/pre/argo09_14/aoml/1901006/1901006_prof.nc
but
temp=ncread(file,'TEMP');
Gets me an error message:
Error using internal.matlab.imagesci.nc/openToRead (line 1252)
Could not open /home/yves/Documents/pre/argo09_14/aoml/1901006/1901006_prof.nc for
reading.
Error in internal.matlab.imagesci.nc (line 122)
this.openToRead();
Error in ncread (line 54)
ncObj = internal.matlab.imagesci.nc(ncFile);
Does anybody know what is wrong with the code? Thank's a lot for the help! Yves
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!