ncread error could not open to read

조회 수: 29 (최근 30일)
Chris
Chris 2017년 4월 12일
답변: Nirav Sharda 2017년 4월 17일
I get the following error while trying to access the nc file. If i get into the folder and try it directly ncread works, but I need to use it in a for loop for a number of similar folders. Any ideas why I get this error?
Error using internal.matlab.imagesci.nc/openToRead (line 1259)
Could not open /sw-test-1-1-141-r28/cpd.nc for reading.
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncread (line 53)
ncObj = internal.matlab.imagesci.nc(ncFile);

답변 (1개)

Nirav Sharda
Nirav Sharda 2017년 4월 17일
I was able to get the same error message. Try to remove the first '/' from the filename passed as input argument to the 'ncread' function. If I have a demo.nc file in a folder called 'ncfile', my command would look like 'ncread('ncfile/demo.nc',varname)'. I hope this helps.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by