This error occurs because if 'H5S_UNLIMITED' is specified for one of the dataset dimensions, the dataset must be chunked rather than contiguous. To resolve the error, one can simply define the dataset creation property list to specify that the dataset should be chunked. For the example in the question, this can be done as follows:
dims = [60 30 10];
maxdims = {dims(1), dims(2), 'H5S_UNLIMITED'};
spaceID = H5S.create_simple(length(dims),fliplr(dims),fliplr(maxdims));
typeID = H5T.copy ('H5T_NATIVE_DOUBLE');
dcpl = H5P.create('H5P_DATASET_CREATE');
chunk_dims = [60 30 10];
h5_chunk_dims = fliplr(chunk_dims);
H5P.set_chunk(dcpl,h5_chunk_dims);
dset = H5D.create (fid, 'sourceName', typeID, spaceID, dcpl);
For more information, please consult <http://www.hdfgroup.org/HDF5/doc/RM/RM_H5Front.html the API for the HDF5 library>.
Best Answer