Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

H5T.get_strpad

Storage mechanism for string data type

Syntax

output = H5T.get_strpad(type_id)

Description

output = H5T.get_strpad(type_id) returns the storage mechanism (padding type) for a string data type. Possible values are:

'H5T_STR_NULLPAD'Pad with zeros
'H5T_STR_NULLTERM'Null-terminate
'H5T_STR_SPACEPAD'Pad with spaces

Examples

fid = H5F.open('example.h5');
dset_id = H5D.open(fid,'/g3/string');
type_id = H5D.get_type(dset_id);
padding = H5T.get_strpad(type_id);
switch(padding)
    case H5ML.get_constant_value('H5T_STR_NULLTERM')
        fprintf('null-terminated\n');
    case H5ML.get_constant_value('H5T_STR_NULLPAD')
        fprintf('padded with zeros\n');
    case H5ML.get_constant_value('H5T_STR_SPACEPAD')
        fprintf('padded with spaces\n');
end

See Also

Was this topic helpful?