Borrar filtros
Borrar filtros

ncdataset error: Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported special characters. > In ncdataset (line 89)

8 visualizaciones (últimos 30 días)
Hi All,
Trying to use NCTOOLBOX and after downloading a file I try to open it with ncdataset in the following code:
tmpdata = ncdataset('C:\User\MATLAB\Temporary\tmpfile');
The error I get seems to to be related to sprintf that shows up (below). I am using Windows 10 and Java 1.8. I've seen other people have sprintf issues in Windows 10 as well but not the errors like this within ncdataset. Any ideas??
Any thoughts on how to resolve would be greatly appreciated.
Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported special
characters.
> In ncdataset (line 89)
In GDAS_grab (line 117)
Error using ncdataset (line 91)
Failed to open C:
Error in GDAS_grab (line 117)
tmpdata = ncdataset(outfilename);
Caused by:
Error using ncdataset (line 75)
Java exception occurred:
java.io.IOException: java.lang.RuntimeException: java.lang.NoClassDefFoundError:
ucar/nc2/util/CloseableIterator
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:425)
at ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:699)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:421)

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Mayo de 2018
You need to pass a URL to ncdataset(). That includes <file://> prefix for local files, and requires that you use / as the directory separator.
The code probably has a small error in how it uses what is passed to it, but you are passing the wrong thing to it.
  1 comentario
Ryan Oates
Ryan Oates el 27 de Mayo de 2018
Thanks Walter. I guess what is confusing is this exact code on an older machine and MATLAB license (2014) works perfectly well. Hmmm..

Iniciar sesión para comentar.

Categorías

Más información sobre Call Web Services from MATLAB Using HTTP en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by