Write the function definition for the
supportsVariable
method to return true only when the reader can import
the input variable. Specify the code for the supportsVariable
method in
the class definition file.
This example does not show a complete class definition. All custom readers must define
behavior for the getName
,
getTimeValues
, and getDataValues
methods, and workspace data readers need to define the supportsVariable
method. For an example that shows the complete class
definition and import workflow for a workspace data reader, see Import Workspace Variables Using a Custom Data Reader.
The custom reader in this example imports a structure or an array of structures from
the workspace. The structures must contain fields for the signal data
(d
), the time data (t
), and the signal name
(n
). The supportsVariable
method returns true when:
The input variable is a structure or array of structures that contains the
appropriate fields.
The n
field of each structure contains a character array or
string to represent the signal name.
The t
field of each structure is a column vector of double
data.
The d
field of each structure contains numeric data and is
the same size as the t
field, meaning there is a sample value
for each time step.