How to read out value from simout object

6 visualizaciones (últimos 30 días)
Peter
Peter el 20 de Feb. de 2025
Comentada: Fangjun Jiang el 24 de Feb. de 2025
I'm running the simulation from the Matlab script via sim() and I need to read output variables and since model is hierachivsl - how can I access the resulting values?
The values I want ot get are at subsystem:
global_model/control_loop with variable at "Out" port 6, named "my_estim"
and within Variant subsystem
global_model/plant/Variant Subsystem1/Lumped (abc_param) at port 8, named "my_ctrl"
running the model from cmd line: simout = sim("global_model.slx");
how to read these variables out of simout aka plot(simout.yout.get('my_estim').Values);
how to read these variables?

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 20 de Feb. de 2025
You need to click that signal line, right click, select properties, and then give it a name and log the signal. Once done that, the signal logging will be saved in the simout file.
  5 comentarios
Peter
Peter el 24 de Feb. de 2025
Editada: Peter el 24 de Feb. de 2025
I want to run multiple simulations with different configurations and then compare results on "Theta_elec_estim" vs. "Theta_elec_plant" vs. ""Theta_elec_ctrl"
aka
Fangjun Jiang
Fangjun Jiang el 24 de Feb. de 2025
'estim' is not logged. Right click the signal line, checkmark to log the signal.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by