Can Simulink Test treat imported Excel data as a piece-wise input instead of automatically interpolating the input vector in R2018a?

4 views (last 30 days)
I am using Simulink Test in MATLAB R2018a to build a test case for a component. I am importing Excel data to be used as the test vector. However, when the data is imported it appears that Simulink is linearly interpolating the data by default. I would like to have this input test vector to be treated as step-wise and hold its current value until the next point is available.
How can I configure a test case to use the test vector as a step-wise input instead of a linearly interpolated input test vector?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Nov 2023
Edited: MathWorks Support Team on 12 Jan 2024
When building test cases using the graphical interface, the imported Excel data is linearly interpolated by default. However, the Excel file can be modified to contain additional information, such as interpolation method, to be used by the Test Manager during import. For the input vector to be treated as "step-wise", "zero-order hold" can be used as an interpolation method. Inside the Excel sheet containing the input data, place "Interp: zoh" in the row above the signal data in the Excel sheet.
For more information on this workflow, you can run the following command in MATLAB R2018a: 
web(fullfile(docroot, 'sltest/ug/specify-microsoft-excel-file-format-for-signal-data.html'))
This is also possible by using the programmatic interface to Simulink Test instead of the GUI.
The "sltest.testmanager.SignalCriteria" class can be used to do this by setting the 'InterpMethod' property to 'zoh' (zero-order hold).
For more information on this property and this specific API class, please refer to the following documentation link:
Also refer to the following link for more functions and classes that can be used with the test manager API:
Towards the bottom of this page there are several examples of creating and running test cases from the test manager API that can be followed.
Please follow the below link to search for the required information regarding the current release:

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!