フィルターのクリア

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

2 ビュー (過去 30 日間)
Joe
Joe 2015 年 12 月 3 日
回答済み: Joe 2015 年 12 月 9 日
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 件)

Sebastian Castro
Sebastian Castro 2015 年 12 月 8 日
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

Joe
Joe 2015 年 12 月 9 日
excellent. thank you.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by