フィルターのクリア

SIMULINK - Save the different states of a variable in a vector

8 ビュー (過去 30 日間)
CamG52
CamG52 2018 年 7 月 6 日
コメント済み: CamG52 2018 年 7 月 9 日
Hello everybody,
I have a variable x that has its value changed every simulation step. What I would like to do is saving each value that x takes in a vector State.
State = [x1 x2 x3 ... xn] with x1, x2, x3, ... xn the values of x at the first, second, third...nth simulation step.
Is it possible ? Is there a block that can do that or do I have to create my own function ?
Thank you very much for your help.

採用された回答

goerk
goerk 2018 年 7 月 6 日
There are multiple solutions for this, dependent on what you want to do with the data.
To save the data to the workspace you can use the'To Workspace' block.
To use the last n values in your model you can for example use the 'Tapped Delay' block.
  1 件のコメント
CamG52
CamG52 2018 年 7 月 9 日
I needed to save the values during simulation so I used the 'Tapped Delay' block. Thank you very much for your answer !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by