How to import constant data from an Excel sheet into Simulink

7 ビュー (過去 30 日間)
Evangelos Alexandros Jürgen Vorgias
Evangelos Alexandros Jürgen Vorgias 2023 年 12 月 6 日
回答済み: Fangjun Jiang 2023 年 12 月 6 日
I have 12 real sensors as input blocks in Simulink. After calibrating the sensors relative to the first one, I get twelve factors that I need to scale the signals with, so that all sensors output the same value, when subjected to a signal of the same strength.
This calibration takes place once every day or two, so I don't want to hard-code the correction factors into my Simulink model. Instead, I would like to read them from an Excel-file.
The "From Spreadsheet" - Block gives me the possibility of reading data, however, it seems to be designed primarily to read signals from a spreadsheet. Since this is not the case, I don't quite know how to deal with the issue.
Additional info: I am using Simulink for a high-speed real-time-control application, so efficiency is essential.

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 12 月 6 日
Use Constant blocks to specify these values in the Simulink model. Use Variables to specify the value for those Constant blocks. Use PreLoadFcn or InitFcn callback of the model to read Excel file and create those variables.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by