Main Content



Return supported file extensions for file adapter

Since R2022b


fileExtensions = getSupportedExtensions(adapterObj)


fileExtensions = getSupportedExtensions(adapterObj) returns the file extensions that are supported by the file adapter.

Custom file adapters must define behavior for the getAdapterName, getSupportedExtensions, and getData methods. In addition, you can choose to override the isSourceValid, supportsReading, getSectionNames, 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

List of supported file extensions for the custom file adapter, returned as a string array or cell array of character vectors.



To learn about attributes of methods, see Method Attributes.


expand all

Write the function definition for the getSupportedExtensions method to return the list of supported file extensions for your custom adapter. Simulink® uses this function to determine if the adapter can be used to load data from a particular external source file.

In this example, the getSupportedExtensions method for an XML file adapter returns only XML in its list of supported extensions.

function fileExtensions = getSupportedExtensions(adapterObj)
    fileExtensions = {'.XML'};

Version History

Introduced in R2022b