Main Content



Convert header field value to MATLAB type



value = convert(fields) converts the Value property of each element of fields to a MATLAB® type.

For each header field in fields, MATLAB checks the namespace for a class that supports a name with the same value as the fields.Name property. If the namespace contains a class for this field, then convert invokes the convert method of that class. To see the classes in the field namespace, call the method.

If the conversion fails or if no class supports one of the fields.Name properties, then convert throws an exception.

This method does not work on heterogeneous arrays. All members of fields must be the same class.

Input Arguments

expand all

Header fields, specified as a vector of class objects from the namespace. All members of fields must be the same class.

Output Arguments

expand all

Header field values, returned as a vector of MATLAB types. The types returned depend on the value of the specific class convert method.


expand all

Send a message to the Hubble Heritage website and display the year an image was modified.

uri ='');
req =;
r = send(req,uri);
d = convert(getFields(r,'Last-Modified'));
LastModified = d.Year
LastModified =


Version History

Introduced in R2016b