how to find differences in two simulink configuration settings using m-script

9 ビュー (過去 30 日間)
gvreddy
gvreddy 2015 年 5 月 19 日
コメント済み: gvreddy 2015 年 5 月 22 日
Hello,
I am comparing two simulink configuration settings using visdiff command. here is my code:
Simulink.BlockDiagram.saveActiveConfigSet(bdroot, 'active_config')
visdiff('active_config', 'standard_config')
when I type visdiff, its giving comparision report.
But what I need is, If I find any difference between config then I should say different configuation is active else its fine. This should be done using m-script.
  3 件のコメント
gvreddy
gvreddy 2015 年 5 月 20 日
編集済み: gvreddy 2015 年 5 月 20 日
Hello Jakob.
Thanks for answering. For example, I have standard configuration settings with solver type as Fixed-step in .m file and I am using Variable-step in my active config. With below command I can save active config.
Simulink.BlockDiagram.saveActiveConfigSet(bdroot, 'active_config')
Now how to compare both settings in order to get only differences ? i.e I should say solver type is different.
I do not mind if I am using function or variable. just it should return the differences in config.
Jakob Janecek
Jakob Janecek 2015 年 5 月 20 日
Thank you for clarifying the issue. Unfortunately there is no API available that makes this possible at the moment. The only way to view differences is, as you have already identified, to run visdiff which generates a comparison report.

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

採用された回答

Nobel Mondal
Nobel Mondal 2015 年 5 月 21 日
You can return a variable if you run the function 'active_config' after you have saved it as mentioned in the question.
>> cs = active_config();
If you create two such variables for two different models, then 'isequal' is directly going to tell you if they have the exact same configurations.
Finding the exact parameters for differentiation might require to write your own api. The list of properties in a config set is already available in the same active_config.m file. Maybe, you could pass each (or only the ones you're interested into) property value one-by-one and compare. (Bit of a brutal check)
  7 件のコメント
Nobel Mondal
Nobel Mondal 2015 年 5 月 22 日
You could put them in the paramList - all the parameters which you want to check for - in that cell array.
>> paramList = { 'SolverType'; 'SaveOutput', ...
'SystemTargetFile', 'ProdHWDeviceType', ... 'and_anything_else_you_want_to_check_for'};
gvreddy
gvreddy 2015 年 5 月 22 日
Thank you very much..you really helped me a lot..

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by