How to Automatically Compare Simulink Models

조회 수: 14 (최근 30일)
Garret Fick
Garret Fick 2017년 12월 11일
댓글: Chirag 2023년 4월 28일
Is there a way to automatically produce a diff of Simulink models? I would like to be able to generate a report of the differences and have this shown by our code review tool so that it is possible to do simple reviews without loading the code in MATLAB.
I know it is possible to do this manually with MATLAB (see for Compare Revisions and How to Compare Models). Is this also available via the MATLAB API, and if so, could you point me to the documentation?
Thanks.

답변 (1개)

Gavin Walker
Gavin Walker 2018년 2월 27일
You can create an HTML or Word report of the differences between two Simulink models using the ‘comparison’ output argument of the visdiff function (R2017b or newer).
For example, you can try something like this
>> comparison = visdiff(model1, model2);
>> % Publish the results of the comparison to a file:
>> reportFile = publish(comparison, 'Format', 'HTML', 'Name', 'myreport.html')
For more information, see the ‘Publish Comparison Report’ section of the visdiff documentation page:
  댓글 수: 2
Amol Koli
Amol Koli 2019년 6월 17일
Any alternative to this solution to make this work on R2016b?
Chirag
Chirag 2023년 4월 28일
Any way of using visdiff to compare rivisions of same model? (for-eg compare model1 from previous commit to current model1 version)

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

카테고리

Help CenterFile Exchange에서 Reporting and Database Access에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by