MATLAB Answers

Visualizing HDF5 in Matlab

6 views (last 30 days)
Sebastian Godoy
Sebastian Godoy on 29 Sep 2016
Edited: per isakson on 6 Oct 2016
I'm trying to visualize a hdf5 file with matlab. Using this commands to read, store and create an image. Here is my script:
h5info = hdf5info('xlsmask_3155_d_6__Block_0759_Slice_.h5');
dset = hdf5read(h5info.GroupHierarchy.Groups(2).Datasets(1));
image1 = hdf5read('xlsmask_3155_d_6__Block_0759_Slice_.h5',dset);
It just shows me an error in line 3 that I don't understand. Can someone explain me whats wrong?
Cheers, Sebi


Geoff Hayes
Geoff Hayes on 29 Sep 2016
Sebastian - please copy and paste the full error message that you observe when you run the above code.
Sebastian Godoy
Sebastian Godoy on 29 Sep 2016
Hey Geoff,
here is the error message showed when a press run:
>> Untitled2
Error using hdf5read>parse_with_dataset (line 116)
The value of 'location' is invalid. It must satisfy the function: ischar.
Error in hdf5read (line 64)
settings = parse_with_dataset(varargin{:});
Error in Untitled2 (line 3)
image1 = hdf5read('xlsmask_3155_d_6__Block_0759_Slice_.h5',dset);
per isakson
per isakson on 6 Oct 2016
Did you inspect the value of your variable dset?
It is actually the value that you expect image1 to take.

Sign in to comment.

Answers (0)