How to use the variables of a simulink model in matlab m file?

1 visualizzazione (ultimi 30 giorni)
0
down vote
favorite
I hope my keywords describe my situation. Basically, I'm working with SMC (Sliding Mode Control) in Simulink using simulink blocks and S Function blocks. Now, I want to use DE (Differential Evolution) algorithm, to determine the parameters of SMC that gives the best resluts. DE implemented by two m files, one of them contain a function for objective function (this need by DE), and the other one contain the rest of DE algorithm, used to running. What I did, is that, I converted one m file, to s function because it need some variables from the Simulink Model, my question is that, now I want to use the value of the objective function in the other m file (DE algorithm) to run the DE to make some iterations. Hopefully, I'm clear. I found some stuff here , but it seems, I'm looking exactly for the opposite scenario.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by