read_netcdf
by Samuel Lazerson
25 Aug 2010
(Updated 05 Jul 2011)
Reads a netCDF file and returns the contents as elements of a structure.
|
Watch this File
|
| File Information |
| Description |
This function uses the MATLAB netCDF routines to read the contents of a netCDF file into a structure. It currently extracts the global attributes, dimensions, variables and variable attributes from the file. The variable attributes use the naming scheme 'varname_attname.'
READ_NETCDF(filename,'flipdim') Flips the dimensions of 2D arrays.
READ_NETCDF(filename,'strip') Strips non-alphanumeric characters from element names so they will be compatible with MATLAB structure element naming conventions. |
| MATLAB release |
MATLAB 7.11 (2010b)
|
| Other requirements |
This code uses Java calls to read the files. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 30 Aug 2010 |
Updated to v0.95. Now uses java to read netCDF files. I've found this is more portable than the MATLAB netCDF calls. |
| 03 Sep 2010 |
The function can now be called with the 'flipdim' option causing the array indices to be permuted in reverse order. |
| 03 Sep 2010 |
Fixed issue reading 1D arrays and some scalar variables. |
| 07 Oct 2010 |
Added the 'strip' and 'flipdim' options. |
| 28 Jan 2011 |
Increased code's ability to handle strings. |
| 15 Feb 2011 |
Fixed an issue where non-string attributes would cause the code to fail to read the file. Thanks to Zelalem Engida for bringing this to my attention. |
| 05 Jul 2011 |
All '+' converted to 'p' in names. All '-' converted to 'n' in names. Thanks to Thomas Leslie Leith for bringing this to my attention. |
|
Contact us at files@mathworks.com