How do I map a model simulink version obtatained with Simulink.M​DLInfo('my​model') to a MATLAB version (e.g. R2021b)

조회 수: 1 (최근 30일)
When I call Simulink.MDLInfo('mymodel') to get a Simulink version number with which my model was created, I would like to have a reliable mapping to a MATLAB version (e.g. R2021b, R2020a, etc ) that corresponds to the Simulink version returned (e.g. 9.11...). Is there an API for this, or a data structure that is available for programmatic use by an .m script?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 4월 26일
It looks like Simulink.MDLInfo() will give you 'ReleaseName'. I am running this in R2018b on an example model 'f14' and an old model of mine.
>> Simulink.MDLInfo('f14')
ans =
MDLInfo with properties:
BlockDiagramName: 'f14'
FileName: 'C:\Program Files\MATLAB\R2018b\toolbox\simulink\simdemos\aerospace\f14.slx'
IsLibrary: 0
SimulinkVersion: '9.2'
ReleaseName: 'R2018b'
FileFormatMinorVersion: ''
ModelVersion: '1.14'
LastModifiedBy: 'The MathWorks Inc.'
Description: ''
SavedCharacterEncoding: 'US-ASCII'
LastSavedArchitecture: 'glnxa64'
Metadata: []
Interface: [1×1 struct]
>> Simulink.MDLInfo('test_delay')
ans =
MDLInfo with properties:
BlockDiagramName: 'test_delay'
FileName: 'D:\Documents\MATLAB\test_delay.slx'
IsLibrary: 0
SimulinkVersion: '9.0'
ReleaseName: 'R2017b'
FileFormatMinorVersion: ''
ModelVersion: '1.35'
LastModifiedBy: 'TO92177'
Description: ''
SavedCharacterEncoding: 'windows-1252'
LastSavedArchitecture: 'win64'
Metadata: []
Interface: [1×1 struct]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by