フィルターのクリア

How to read data form simulink in time

1 回表示 (過去 30 日間)
Chai Wei Kuo
Chai Wei Kuo 2021 年 11 月 28 日
回答済み: Pramil 2024 年 2 月 27 日
I have a model in simulink , and use block 'Interpreted MATLAB Fcn' to compute position output 'u'.
Now I want to limit my velocity, I need to get my output data form simulink to limit my next output.
I searched for answer, but I don't know how to use 'Access Block Data During Simulink' exactly.
Thanks for help.

回答 (1 件)

Pramil
Pramil 2024 年 2 月 27 日
To access block data in this case ‘position’ value and use this to limit ‘velocity’, you can use a “feedback loop”. You can do that through following steps:
  • Branch the output of 'Interpreted MATLAB Fcn' and pass it to a ‘unit delay’ block.
  • On that signal, apply any conditions through which you can calculate by what value to limit 'velocity'.
  • Add or subtract this signal as per your need, to the original 'velocity' signal.
We can do the above without the first step as well but it will introduce an ‘algebraic loop’ which is not desirable, you can know more about them on this page:
Here is an image for your reference, where velocity is reduced by ‘10’ when computed position ‘u’ gets greater than ‘1000’ during simulation. Input ‘X’ is a vector containing values from ’10,20…100’ and value of ‘a’ is ‘10’.

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by