Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (1)

Vignesh
Vignesh il 19 Dic 2017
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.

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by