I never thought I'd say it was easier to obtain a python solution, but here it is:
import h5py
import numpy as np
FILENAME = 'data.h5'
f = h5py.File(FILENAME, 'a')
f['/second/values'][:] = f['/second/values'].value.astype(np.float32)
The key is the letter 'a' on the 4th line, which means "append" the file, don't just read it. How shall I do it in MATLAB or OCTAVE?