%% Write to Entire Dataset
% Create a 10-by-20 dataset named DS1.

h5create('myfile.h5','/DS1',[10 20])

% Write a 10-by-20 array of random numbers to the dataset. Since the dimensions of 'DS1' are fixed, the amount of data to be written to it must match its size.

mydata = rand(10,20);
h5write('myfile.h5', '/DS1', mydata)

%
% Display the contents of the file.

h5disp('myfile.h5')

% Copyright 2015 The MathWorks, Inc.