Simulink function that access to step final value

5 ビュー (過去 30 日間)
Alejandro Fernández
Alejandro Fernández 2020 年 11 月 7 日
編集済み: Piyush Aggarwal 2020 年 11 月 10 日
Hello, would anyone know how can I create a function to put in the third block of the figure that will allow to have a variable that varies according to the final step you put in the step block?
Thnk you so much

回答 (1 件)

Piyush Aggarwal
Piyush Aggarwal 2020 年 11 月 10 日
編集済み: Piyush Aggarwal 2020 年 11 月 10 日
The parameter 'Final value' of the Step Block with a default value of 1 can be defined using a MATLAB Base Workspace variable. You can do this by simply defining a variable in the Base Workspace using command prompt or writing a code statement in the Model's 'PreLoadFcn' Callback by going in Model Properties in the modelling tab. And use this variable to enter the value of 'Final value' parameter in the Step block's parameter dialog box. You can now use this variable in the MATLAB Fcn Block's code script to code whatever behavior you wanted to.

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by