Import constants to Simulink from Excel file
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/418233/image.jpeg)
댓글 수: 0
채택된 답변
cr
2020년 11월 18일
Setup a model callback InitFcn function in which you call a script that loads the xls file using xlsread()
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!