|
Hi Matlab users,
I am making a HDF5 (hierarchical data format) file and I have fields like this: Grid, Results, Time. Every one of them has another fields inside, for example in Grid there are: Bathymetry, Latitude, Longitude. My problem is that I can not write the attributes for the Grid field, don't know why. For latitude, longitude and bathymetry it works perfect, but when I am trying for Grid it gives me an error.
The coding for longitude would be like this:
HDF5pathGrid = '/Grid';
HDF5pathGridLAT = '/Grid/Latitude';
HDF5pathGridLON = '/Grid/Longitude';
HDF5pathGridBATH = '/Grid/Bathymetry';
%** WRITE LON
hdf5write(HDF5filename,HDF5pathGridLON,LON,'WriteMode', 'append')
Maximum=max(max(LON));
attr.max = Maximum;
attr_details.Name = 'Maximum';
attr_details.AttachedTo = HDF5pathGridLON;
attr_details.AttachType = 'dataset';
hdf5write(HDF5filename,attr_details, attr.max,'WriteMode', 'append')
Minimum=min(min(LON));
attr.min = Minimum;
attr_details.Name = 'Minimum';
attr_details.AttachedTo = HDF5pathGridLON;
attr_details.AttachType = 'dataset';
hdf5write(HDF5filename,attr_details, attr.min,'WriteMode', 'append')
Units='º';
attr.Units = Units;
attr_details.Name = 'Units';
attr_details.AttachedTo = HDF5pathGridLON;
attr_details.AttachType = 'dataset';
hdf5write(HDF5filename,attr_details, attr.Units,'WriteMode','append')
and it works perfect. But when I replace HDF5pathGridLON with HDF5pathGrid and LON with Grid I get errors. Does anyone knows why?
Robert.
|