Steve
Steve

Reputation: 4097

Assign output of h5disp to variable

I am using MATLAB R2012a to read an hdf5 data file using the the function h5disp. How can I assign the output to a variable or write it to disk? Is there a way to redirect the output in MATLAB? My goal is to read in many files and output a summary of their contents to disk in a format equal to or similar to h5disp.

Like

h = output(h5disp(myhdf5file))

or to disk like

h5disp(myhdf5file) > outputfile.txt

Upvotes: 0

Views: 361

Answers (1)

Sardar Usama
Sardar Usama

Reputation: 19689

You can use h5info to store that information in the workspace i.e.

h = h5info(myhdf5file);

or you can use diary to write the output of h5disp to a text file.

diary outputfile.txt
h5disp(myhdf5file)
diary off

Upvotes: 1

Related Questions