test harness input for "read from file"
1 view (last 30 days)
Show older comments
Hi. I have a simulation which captures a .png file and creates share 1 and share 2. I need to use test harness for my homework. In order to test the subsystem, I need to use input data, baseline criteria etc.
But, my input data is not a logical signal or not a sinus signal. It's an image data. As you see my simulink:
And i need to specify an input in order to test the system:
What kind of input do I need to use?
I also need to determine a baseline criteria so that I can understand whether the subsystem is working or not :
Can you please give me advices? How can I understand my test scenario is succesful?
Thanks in advance.
0 Comments
Answers (1)
Guilherme Costa Nascimento
on 5 Dec 2023
Hi Bertug,
As you are using image files, you need to use the "Parameter Overrides" section to change the name of the image you are importing with the Image From File block. This will take the place of the input and you can leave the "Inputs" section of the test case empty. See this doc page for more details: https://www.mathworks.com/help/sltest/ug/specify-test-properties-in-the-test-manager.html#bulu9hh
As for determining if your test passed or failed, "Baseline Criteria" is just one way to do it. The best approach will depend on how you assess whether your test passes or not. One option is to do any necessary post processing in the test harness with Simulink blocks, and then compare then expected output with your block output using an Assertion block. Another option is to use a Test Assessment block. This example here should be helpful: https://www.mathworks.com/help/sltest/ug/connecting-blocks-for-verify-statements.html
Hope this helps.
0 Comments
See Also
Categories
Find more on Outputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!