Main Content


Register adapter to convert test data



sltest.testmanager.registerTestAdapter(adapterfcn,adapterdefault) registers an adapter function to convert an Excel® or MAT file that contains test data to a format supported by the Test Manager. For information about the supported Excel format, see Microsoft Excel Import, Export, and Logging Format.


collapse all

Create and register a function to format a MAT file to use in the Test Manager. This example assumes that you have a MAT file that has x, y, and z parameters and xin and yin inputs.

Create a function that converts a baseline test parameter set in the MAT file.

function Adapter_InputBaselineParamSet(test,externalMATFile)
   % Set model property for the test case

   % Save external file parameters to a supported format
   % MAT file and add parameter set to test case
   paramset = addParameterSet(test,'FilePath',...

   % Save external file inputs to a supported format MAT
   % file and add inputs to test case
   inputs = addInput(test,'input.mat');;                         

   % Capture baseline critera and add to test case

Then register the function by using its function handle.


Input Arguments

collapse all

Adapter function name, specified as a function handle. The adapter function specifies how to convert an Excel or MAT test data file into a format supported by the Test Manager.

Whether to use the specified adapter as the default for the test case, specified as a numeric or logical 1 (true) or 0 (false). When you set the adapterdefault input to 1 or true, the test case uses specified adapter even if you previously registered a different adapter.

Version History

Introduced in R2022b