How does simulink use data stored in matlab as an array for each time iteration?

5 ビュー (過去 30 日間)
M.I
M.I 2023 年 2 月 25 日
コメント済み: Paul 2023 年 2 月 26 日
So, I have a 141x4 array in matlab which corresponds to data and time (row vector of data for each time step. my time is basically 15 sec with 0.1 step size.)
now, I want to use my row vector of data 1x4 for each time step in simulink, but I don't know how to do that. Do I need to use interpoloation? Note that my simulink time step is different than matlab: 0.001.
Thank you.

採用された回答

Paul
Paul 2023 年 2 月 26 日
編集済み: Paul 2023 年 2 月 26 日
Hi M.I,
141 rows does not correspond to 15 sec with 0.1 step size. Perhaps it's just 14 seconds.
Whether or not you need to use interpolation is known only by you based on the requirements of your model. A From Workspace block or 2D Lookup Table block might be suitable.
  2 件のコメント
M.I
M.I 2023 年 2 月 26 日
so does From Workspace block work with code generation as well? like If I dont have matlab open, will the values be stored after I upload my simulink model to my external device hardware?
Paul
Paul 2023 年 2 月 26 日
Sorry. I don't know nearly enough about that process to comment.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by