Is there a way to input an array from the workspace into a Simulink model chunk by chunk/per simulation step?

1 回表示 (過去 30 日間)
Amanda
Amanda 2021 年 9 月 21 日
回答済み: Paul 2021 年 9 月 22 日
I want to input a 20x2 array (named A) into my simulink model one ordered pair at a time. for instance A(1,1) is input, then A(2,2), etc until the end. I have tried doing a 20x3 array with the first column being time, however I am not sure how to extract only the 2nd and 3rd columns as one ordered pair at a time. The data from columns 2 and 3 could also be input as separate data points and not ordered pairs, but I am unsure how to only take values from row x columns 2 and 3 only, then in the next simulation step from row y columns 2 and 3 only, etc. Can anyone help me with this? I’m using R2021a

回答 (1 件)

Paul
Paul 2021 年 9 月 22 日
Can you use a From Workspace block? Use your 20 x 3 array and uncheck the box for Interpolate Data.

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by