Main Content

open

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

Code that executes when connection to external file is opened

Syntax

open(adapterObj,sourceFile,section)

Description

open(adapterObj,sourceFile,section) executes when the connection to an external source file is first opened. By default, the source file and section name are saved as the properties source and section in the adapter object.

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

External source file, specified as a character array or string.

Section of the external source file, specified as a character array or string. The section name must be one of the sections returned by the getSectionNames method. The default implementation of the getSectionNames method returns the adapter name.

Version History

Introduced in R2022b