This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.



Convert header field value to MATLAB type


value = convert(fields)



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 package for a class that supports a name with the same value as the fields.Name property. If the package contains a class for this field, then convert invokes the convert method of that class. To see the classes in the field package, 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 package. 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 =


Introduced in R2016b