Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

H5S.select_elements

Specify coordinates to include in selection

Syntax

H5S.select_elements(space_id,op,h5_coord)

Description

H5S.select_elements(space_id,op,h5_coord) selects the array elements to be included in the selection for the data space specified by space_id. The op argument determines how the new selection is to be combined with the previously existing selection for the data space and can be specified as one of the following:

'H5S_SELECT_SET'
'H5S_SELECT_APPEND'
'H5S_SELECT_PREPEND'

h5_coord is a two-dimensional array of 0-based values specifying the coordinates of the elements being selected. If m is the rank of the data space and if n is the number of points, then h5_coord should be an m-by-n array.

    Note:   The HDF5 library uses C-style ordering for multidimensional arrays, while MATLAB® uses FORTRAN-style ordering. The h5_coord parameter assumes coordinates have C-style ordering. Please consult "Using the MATLAB Low-Level HDF5 Functions" in the MATLAB documentation for more information.

Examples

Select the corner points of a data space. In this case, h5_coord should have size 2x4.

dims = [100 200];
h5_dims = fliplr(dims);
space_id = H5S.create_simple(2,h5_dims,h5_dims);
coords = [0 0; 0 199; 99 0; 99 199];
h5_coords = fliplr(coords);
h5_coords = h5_coords';
H5S.select_elements(space_id,'H5S_SELECT_SET',h5_coords);
Was this topic helpful?