Import constants to Simulink from Excel file

4 ビュー (過去 30 日間)
ryan muddiman
ryan muddiman 2020 年 11 月 18 日
コメント済み: ryan muddiman 2020 年 11 月 18 日
I am running a simulation in Simulink that requires some constants that change every run. These constants are in an excel file (Uvalues, Area). I would like to import these constants in to a constant block or other for use.
I understand the Simulink from Spreadsheet block treats rows as time which is preventing me from setting constants easily.
I have tried using the MATLAB function block as a source, but it doesn't support xlsread.
Any help is appreciated.

採用された回答

cr
cr 2020 年 11 月 18 日
Setup a model callback InitFcn function in which you call a script that loads the xls file using xlsread()
  1 件のコメント
ryan muddiman
ryan muddiman 2020 年 11 月 18 日
Thanks, that works like a charm

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by