Calling a Matlab Function in Simulink which integrates Data from Excel when Stateflow State is active

1 次查看(过去 30 天)
Hey Guys,
i am trying to build a Simulink model of a manufacturing line. As powerload profiles are of interest i tried to simulate the current power used by the machines, therefore i developed a stateflow chart with five states (off,deactivated,standby,operational,working). Each state is associated to a typical load profile which was measured and stored in severel excel sheets. I now try to develop a function which is called when, for example, working state is active. The function shall read the first row and second column of the associated excel data(first column is time, not equal to simulation time!) in the first time step when state working is active and the second value in the second time step of simulation etc... Do you guys know how to do it? I tried programming a matlab function using if,while,for loops, but non of these worked because the only read out the first value of the data sheet.
Kind regards, Vincent

回答(1 个)

Vignesh
Vignesh 2017-12-19
I think it might be easier to read the file using From SpreadSheet block and passing the values as input or storing them in Data Store Memory blocks.

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by