Compare the contents to 2 subsystems within Simulink

13 ビュー (過去 30 日間)
Lucas
Lucas 2015 年 5 月 7 日
編集済み: N Kando 2017 年 7 月 12 日
Is there an easy way to compare the contents of 2 subsystems in MatLab? I want to take one subsystem and check it against another to ensure the contents of both are the same. I didn't want to try to create a loop that'll take all the block from the subsystems and loop through them checking each parameter of each block to make sure all the logical operator are the same.

回答 (2 件)

Michael Haderlein
Michael Haderlein 2015 年 5 月 7 日
I don't know what you mean with "subsystem", but if you have two variables with any kind of data (no matter if it's a struct or a cell or a numerical array) and you want to check for equality, use isequal(var1,var2).
  3 件のコメント
Michael Haderlein
Michael Haderlein 2015 年 5 月 7 日
I didn't work with Simulink so far, so I cannot tell you if this works there as well. In Matlab you would use isequal.
As Simulink wasn't mentioned anywhere, I'll add this as the product here.
Lucas
Lucas 2015 年 5 月 7 日
I tried to use isequal, but it only works for the blocks in the subsystems, it doesn't compare the parameters. If I have to do it by hand, I'll have to use isequal on all the blocks parameters as well.

サインインしてコメントする。


N Kando
N Kando 2017 年 7 月 12 日
編集済み: N Kando 2017 年 7 月 12 日

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by