Main Content



Return display name for file adapter

Since R2022b


dispName = getAdapterName(adapterObj)


dispName = getAdapterName(adapterObj) returns the display name of the file adapter. This name can be used by Simulink® to display available adapters or used in an error message.

Custom file adapters must define behavior for the getAdapterName, getSupportedExtensions, and getData methods. In addition, you can choose to override the isSourceValid, supportsReading, getSectionNames, getCurrentChecksum, open, and close methods.

Input Arguments

expand all

Custom file adapter, specified as an object of a class that derives from the base class.

Example: myCustomFileAdapter

Output Arguments

expand all

Display name of the custom file adapter, returned as a character array.



To learn about attributes of methods, see Method Attributes.


expand all

Write the function definition for the getAdapterName method to return the display name for your custom file adapter. Specify code for the getAdapterName method in the class definition file.

In this example, the getAdapterName method returns the display name for an adapter than can read data from an XML file.

function name = getAdapterName(adapterObj)
    name = 'XML Adapter';

Version History

Introduced in R2022b