Main Content

getSupportedExtensions

Class: Simulink.data.adapters.BaseMatlabFileAdapter
Namespace: Simulink.data.adapters

Return supported file extensions for file adapter

Since R2022b

Syntax

fileExtensions = getSupportedExtensions(adapterObj)

Description

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

Attributes

Abstracttrue

To learn about attributes of methods, see Method Attributes.

Examples

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

Version History

Introduced in R2022b