フィルターのクリア

how do I use simulation time as realtime changing variable?

107 ビュー (過去 30 日間)
sagiv
sagiv 2011 年 4 月 21 日
Hi, my need is as follows: I have an array of structures. [1xN] I need MPC controller block to get external reference signal: array(i), where 'i' is the cycle number of the simulation (equivalent to time). i.e. the input is different in each cycle. using the "to workspace" function does not help since it is written to workspace only once when simulation is finished, and I need the real time counter while running the simulation. how can I create a simulink variable, that is changing over time, that I can refer to by its name? (i.e. writing: input(t) will be legal when 't' is dynamic and represents the simulation time) thanks, Sagiv.

採用された回答

Seth Popinchalk
Seth Popinchalk 2011 年 4 月 21 日
Use a Clock or Discrete Clock block to create a signal (t) then operate with that as your input to the algorithm. The algorithm should be built with base Simulink blocks.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by