Set step time in Simulink

8 ビュー (過去 30 日間)
HaMo
HaMo 2018 年 5 月 29 日
回答済み: Fangjun Jiang 2018 年 5 月 29 日
I have created a Simulink model with only a constant value (see screenshot).
Then I execute it by running the following script:
clear
set_param DummyTest FixedStep 1
sim DummyTest
disp(y.Time)
Turns out the step size of the simulation is 0.2 s, not 1 second. What do I do wrong?

採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 5 月 29 日
The setting of this parameter is dependent. It won't take effect until other settings are in place. You can check the solver type by the following. It must have been been 'Variable-step'.
get_param('DummyTest','SolverType')
After setting the following, you 1 second fixed step will take effect
set_param('DummyTest','SolverType','Fixed-step');

その他の回答 (1 件)

ES
ES 2018 年 5 月 29 日
You have set the solver?
set_param('Solver', 'FixedStepDiscrete');

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by