How can I import excel datas to manage the Simulink blocks parameters

1 回表示 (過去 30 日間)
Okagan
Okagan 2019 年 12 月 12 日
コメント済み: Okagan 2020 年 2 月 9 日
Hello,
I have a Simulink model which contains nearly 100 blocks. Each of the blocks have "Amplitude" parameter. I want to choose all of the Amplitude parameters with importing data from an Excel sheet. For example;
Block 1; Amplitude= 25
Block 2; Amplitude= 21
Block 3; Amplitude= 26
...
Block 100; Amplitude= 17
I thought a solution like this:
Block 1; Amplitude= a1
Block 2; Amplitude= a2
Block 3; Amplitude= a3
...
Block 100; Amplitude= a100
These a1,a2,...,a100 parameters can be imported from MATLAB Workspace, which are created from Excel sheet, but I hope there is more easy way to do this. Thanks.

採用された回答

Shashwat Bajpai
Shashwat Bajpai 2019 年 12 月 16 日
Hey,
There are two ways in which you can import excel data and use it in Simulink
  1. Use the importdata function and create an array (say ‘A’) of all the values imported and then change the variable name in each block to A(1), A(2),…….A(100).
  2. Use the MATLAB fcn blockin Simulink import the data using the importdata function and generate 100 outputs from that block or create a bus for the same and provide the input to the desired blocks.
Hope this helps!

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by