For loops in simulink

1 回表示 (過去 30 日間)
Juan Nunez
Juan Nunez 2017 年 10 月 4 日
コメント済み: Juan Nunez 2017 年 10 月 11 日
I have a 36x5 matrix. Each column of this matrix is an input to a simulink block. I need to create a for loop for my simulink model using the matrix. For example, the first column of the matrix generates an output from the simulink block, then the second column should do the same and so on. All the output data should be sent to the workspace. What is the best way to generate this for loop? Thanks.

回答 (1 件)

KL
KL 2017 年 10 月 4 日
data = rand(35,1);
time = 1:35;
simulink_variable = timeseries(data,time)
and then use it with a from workspace block. Similarly use a to workspace block to get the outputs?
  1 件のコメント
Juan Nunez
Juan Nunez 2017 年 10 月 11 日
Thanks KL!!. Problem solved using your suggestion.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by