Created hdf5 files, but want netcdf4 files

2 views (last 30 days)
Diana
Diana on 13 Jul 2015
Edited: Diana on 13 Jul 2015
Using matlab version 8.1.0.604 (R2013a), I have tried to create netcdf4 files using nccreate & netcdf.create. But the unix file command says they are hdf5 files. (And this creates a problem when trying to port them to an OPeNDaP server which will not serve hdf5 files.)
Also, I am not clear on the difference between nccreate and netcdf.create. See code fragments:
1) nccreate(filename, 'netcdf4')
>> nccreate('myfile_nccreate_netcdf4.nc','netcdf4')
>> !file myfile_nccreate_netcdf4.nc
myfile_nccreate_netcdf4.nc: Hierarchical Data Format (version 5) data
2) nccreate(filename, 'netcdf4_classic')
>> nccreate('myfile_nccreate_netcdf4_classic.nc','netcdf4_classic')
>> !file myfile_nccreate_netcdf4_classic.nc
myfile_nccreate_netcdf4_classic.nc: Hierarchical Data Format (version 5) data
3) netcdf.create(filename, 'netcdf4')
>> ncid=netcdf.create('myfile_netcdf.create_netcdf4','netcdf4');
>> netcdf.close(ncid)
>> !file myfile_netcdf.create_netcdf4
myfile_netcdf.create_netcdf4: Hierarchical Data Format (version 5) data

Answers (0)

Community Treasure Hunt

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

Start Hunting!