www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/WriteToEntireDataSetExample.m

    %% Write to Entire Data Set
% Write random values to a data set named |DS1|. 

% Copyright 2015 The MathWorks, Inc.

h5create('myfile.h5','/DS1',[10 20])
mydata = rand(10,20);
h5write('myfile.h5', '/DS1', mydata)
%%
% Display the contents of the file.
h5disp('myfile.h5')