is ncinfo a native function of matlab?

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
didier
Posts: 5
Joined: Sun Sep 08, 2013 4:22 pm
Location: Universidad del Mar

is ncinfo a native function of matlab?

#1 Unread post by didier »

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.

wangzc
Posts: 28
Joined: Fri Dec 28, 2012 5:44 am
Location: National Marine Environmental Forecasting Center

Re: is ncinfo a native function of matlab?

#2 Unread post by wangzc »

hi,
i come up with the same problem. Do U settle it and how?
--zongchen

User avatar
arango
Site Admin
Posts: 1351
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: is ncinfo a native function of matlab?

#3 Unread post by arango »

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:

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

didier
Posts: 5
Joined: Sun Sep 08, 2013 4:22 pm
Location: Universidad del Mar

Re: is ncinfo a native function of matlab?

#4 Unread post by didier »

thanks a lot for your help

wangzc
Posts: 28
Joined: Fri Dec 28, 2012 5:44 am
Location: National Marine Environmental Forecasting Center

Re: is ncinfo a native function of matlab?

#5 Unread post by wangzc »

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

User avatar
arango
Site Admin
Posts: 1351
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: is ncinfo a native function of matlab?

#6 Unread post by arango »

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...

Post Reply