| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
ncid = netcdf.open(filename, mode)
[chosen_chunksize, ncid] = netcdf.open(filename, mode,
chunksize)
ncid = netcdf.open(filename, mode) opens an existing netCDF file and returns a netCDF ID in ncid. mode describes the type of access to the file and can have any of the following values.
| Value | Description |
|---|---|
| 'NC_WRITE' | Read-write access |
| 'NC_SHARE' | Synchronous file updates |
| 'NC_NOWRITE' | Read-only access |
You can also specify mode as a numeric value that can be retrieved usingnetcdf.getConstant. Use these numeric values when you want to specify a bitwise-OR of several mode.
[chosen_chunksize, ncid] = netcdf.open(filename, mode, chunksize) opens an existing netCDF file, specifying an additional I/O performance tuning parameter, chunksize. The actual value used by the netCDF library might not correspond to the input value you specify.
This function corresponds to the nc_open and nc__open functions in the netCDF library C API. To use this function, you should be familiar with the information about netCDF contained in the NetCDF C Interface Guide for version 3.6.2.
This example opens the example netCDF file included with MATLAB, example.nc.
ncid = netcdf.open('example.nc','NC_NOWRITE');
netcdf.create,netcdf.getConstant
![]() | netcdf.inqVarID | netcdf.putAtt | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |