Create Test Vectors with structures of busses in sltest.TestCase

조회 수: 8 (최근 30일)
Taylor
Taylor 2023년 4월 6일
댓글: Taylor 2023년 6월 26일
Hi,
I'm trying to write a test case where I have an input that is a bus containing multiple busses that is fed into a simulink model when called via the sltest.TestCase class. For certain tests, the majority of the input bus structure values can be set to zero and I would prefer not to have to manually initialize each parameter.
Is there a clean way to create an input test vector of time series objects with the same structure as my input bus?
Thanks,
Taylor

답변 (1개)

Manikanta Aditya
Manikanta Aditya 2023년 4월 21일
Hi Taylor,
As per my understanding, you are interested to know if there is a way to create an input test vector of time series objects with same structure as your input bus.
You can use ‘Simulink.Bus’ and ‘Simulink.BusElement’ classes in MATLAB to define the structure of your input bus, and then use the ‘timeseries’ function to create a time series object with the same.
Please refer to the following documentation for more info on:
I hope this resolves the issue you were facing.
  댓글 수: 1
Taylor
Taylor 2023년 6월 26일
This isn't quite the question. I have a model with a large defined bus as the input. I want to tests a specific element of the model with a matlab script that only requires a few elements of the given bus structure to be populated.
I'm looking for a way to write a test without having to manually recreate the entire bus structure (or create additional test harnesses that break out individual signals.
Thanks,
Taylor

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Inputs에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by