how to get simulink model outputs simultaneously(when the simulation is running)?
Ältere Kommentare anzeigen
I have a simulink model that have the outputs x and y. When i run the simulation they give me 500x1 double values. x values are reference values and y values are the outputs that i want to converge them to x. I used genetic algoirthm to optimize output y. There are 5 parameters to optimize outputs y. I want to get x and y values to calculate error(MSE, MAPE , ITAE vs.) for cost function of genetic algorithm. Is there any method to get these output values from simulink to .m file(genetic algorithm runninng in this file) when simulation is running . From .m file to simulink i can adjust the 5 parameters simultaneously by 'set_params' but i can not find for the exact opposite situation.
Akzeptierte Antwort
Weitere Antworten (3)
Dishant Arora
am 1 Apr. 2015
1 Stimme
You can bring or save simulation results to your workspace by making use of following blocks.
1.) to workspace form the sinks library
2.) to matffile from the sinks library
You can also make use out1(outport) block
2 Kommentare
Ilham Hardy
am 1 Apr. 2015
It doesn't meet the requirement : when simulation is running
Selim
am 1 Apr. 2015
Ilham Hardy
am 1 Apr. 2015
0 Stimmen
To meet the requirement, you might want to integrate your GA mfile to simulink (e.g. using Matlab Function block).
Jishnu Mukherjee
am 24 Sep. 2018
0 Stimmen
you can try and use matlab function block and log the output of the block and check the result in simulink data inspector while simulation is running
Kategorien
Mehr zu Prepare Model Inputs and Outputs finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!