How do I import a test harness with an existing model reference?

2 ビュー (過去 30 日間)
Pat Canny
Pat Canny 2019 年 10 月 30 日
回答済み: Pat Canny 2019 年 10 月 30 日
I accidentally "disassociated" a test harness model with its parent model. What is the easiest way to re-associate the harness model?

採用された回答

Pat Canny
Pat Canny 2019 年 10 月 30 日
One way to do this is through sltest.harness.import, which allows you to import a stand-alone model as a test harness model.
If you created a harness using the "parent" model as the unit under test (similar to a model reference), use the "parent" model name as the 'ComponentName' in sltest.harness.import
Here is a simple example:
mainModel = 'UnlimitedFreeTacosModel'; % free tacos need not only be on Tuesdays
harnessModel = 'UnlimitedFreeTacosModel_harness'; % ensure this works on all the other days of the week
load_system(mainModel)
sltest.harness.import(mainModel,'ImportFileName',harnessModel,'ComponentName',mainModel,'Name',harnessModel(1:end-4));
save_system(mainModel)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTest Scripts についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by