Main Content

getAdapterName

Class: Simulink.data.adapters.BaseMatlabFileAdapter
Package: Simulink.data.adapters

Return display name for file adapter

Syntax

dispName = getAdapterName(adapterObj)

Description

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 Simulink.data.adapters.BaseMatlabFileAdapter base class.

Example: myCustomFileAdapter

Output Arguments

expand all

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

Attributes

Abstracttrue

To learn about attributes of methods, see Method Attributes.

Examples

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';
end

Version History

Introduced in R2022b