Hello,
I have few question about ncinfo function:
Some matlab scripts from the repository use the ncinfo function, but is it a native function from matlab?
Because when I try to run some of these scripts, the error report says that ncinfo is undefined!
What can I do? get a new version of matlab? use another similar function ?
thanks for your help.
is ncinfo a native function of matlab?
-
- Posts: 28
- Joined: Fri Dec 28, 2012 5:44 am
- Location: National Marine Environmental Forecasting Center
Re: is ncinfo a native function of matlab?
hi,
i come up with the same problem. Do U settle it and how?
--zongchen
i come up with the same problem. Do U settle it and how?
--zongchen
- arango
- Site Admin
- Posts: 1368
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: is ncinfo a native function of matlab?
Yes, ncinfo is native to Matlab. The native interface was introduced in Matlab version 2008b for NetCDF-3 type files. The NetCDF-4 support was introduced in version 2010b. The support for HDF5 files was completed in version 2011a. The OpenDAP support started in version 2012a.
Mostly all of the scripts distributed in the matlab repository have an umbrella interface to NetCDF (see matlab/netcdf). The script nc_interface.m will decide which NetCDF interface to use. By default it will the native interface, if available. Otherwise, it will use the MEXNC interface or the SNCTOOLS interface. The SNCTOOLS will be used if reading OpenDAP files.
For example, in nc_vinfo.m we have:
Mostly all of the scripts distributed in the matlab repository have an umbrella interface to NetCDF (see matlab/netcdf). The script nc_interface.m will decide which NetCDF interface to use. By default it will the native interface, if available. Otherwise, it will use the MEXNC interface or the SNCTOOLS interface. The SNCTOOLS will be used if reading OpenDAP files.
For example, in nc_vinfo.m we have:
Code: Select all
% Choose NetCDF file interface.
[method,~,~] = nc_interface(ncfile);
switch(method),
case {'native'}
V = nc_vinfo_matlab(ncfile,Vname); % Matlab native interface
case {'java'}
V = nc_vinfo_java (ncfile,Vname); % SNCTOOLS JAVA interface
case {'mexnc'}
V = nc_vinfo_mexnc (ncfile,Vname); % MEXNC inteface
otherwise
error('NC_VINFO: unable to determine NetCDF processing interface');
end
Re: is ncinfo a native function of matlab?
thanks a lot for your help
-
- Posts: 28
- Joined: Fri Dec 28, 2012 5:44 am
- Location: National Marine Environmental Forecasting Center
Re: is ncinfo a native function of matlab?
Do u mean if Netcdf-3 is used, only Matlab version ‘2008b’ can handle it? My Matlab version is '2009a' and Netcdf-3 is used. Does it mean i have to uninstall my version and install version '2008b'?
--zongchen
--zongchen
- arango
- Site Admin
- Posts: 1368
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: is ncinfo a native function of matlab?
Of course not. The text above implies that you can read NetCDF-4 files with versions 2010b or higher. Similarly, you can read OpenDAP NetCDF files with native Matlab version 2012a or higher. You can read NetCDF-3 files with version 2008b or higher. This is information is available everywhere. You just need to search for it...