MATLAB Answers


Visualizing HDF5 in Matlab

Asked by Sebastian Godoy on 29 Sep 2016
Latest activity Edited by 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
on 29 Sep 2016
Sebastian - please copy and paste the full error message that you observe when you run the above code.
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
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.


0 Answers