Documentation Center

  • Trials
  • Product Updates

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_NULLPADPad with zeros
H5T_STR_NULLTERMNull-terminate
H5T_STR_SPACEPADPad 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?