Best way to test Simulink model that doesn't change over time
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a Simulink model which takes a bus of discrete values in, transforms them, and outputs the results. This essentially models a simple function like in a standard programming language. What would be the best way to test this? Most of the available tools seem to be for data that changes over time, whereas I want to simply plug some data in and confirm that the result is correct. I have tried using the Test Sequence and test manager tools but these make it hard to view the output with just one timestep and they also regularly take a significant amount of time to complete or hang (I believe due to the size of my data). There are no problems with running the model by itself and observing inputs and outputs in a small test system, so I know that it compiles and runs fine, but this setup does not make it easy to switch in and out data for standardised testing.
댓글 수: 0
답변 (1개)
Akshat Dalal
2024년 10월 7일
Hey Matt,
You can probably write a matlab script that simulates your model programatically using the 'sim' command. The inputs can be stored in workspace or excel and then you can iterate through the inputs. You can also have expected outputs stored somewhere for direct comparison or write a simple logic for dynamically testing the output.
Also, you can keep the time-step and simulation time same as your model is static. This will execute the inputs only once which should be quicker to simulate and test.
If needed, you could also generate code for your model for further testing and analysis.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Outputs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!