How can I programmatically set the "analysis mode" of the "machine environment" block in a Simulink model based on SimMechanics using a Matlab script?

I'd like to write a Matlab script that allows me to programmatically set the "analysis mode" of the "machine environment" block in my SimMechanics based model. I'll be switching between the "trimming" and "forward dynamics" settings.
Is this possible to do in an .m file?

답변 (2개)

Yes, you can use the following syntax:
>> blockName = 'myModel/Machine Environment';
>> type = get_param(blockName,'AnalysisType');
>> set_param(blockName,'AnalysisType','Trimming');
>> set_param(blockName,'AnalysisType','Forward Dynamics')
- Sebastian

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

질문:

Joe
2015년 12월 3일

답변:

Joe
2015년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by