How can i import an array into an embedded MATLAB function in simulink not as a signal?

Suppose i have to load an long array of coefficients from a .mat file. I want to import it as an array which i could call it as a whole one in an embedded MATLAB function in simulink. However, it seems to be treated as a signal or a parameter which means there is a single element every time i simulate.
How could i import this file properly? Thanks!

 Accepted Answer

Use a constant block, and set i's value for example to c_val; before running your simulink model, in matlab command, just load your mat file and assign you array to a variable c_val

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!