Can I log data from all the nodes of a Simulink and Simscape model to a database?

2 visualizaciones (últimos 30 días)
In my Simscape model, can I log the data from all nodes, so that I can perform calculations on them?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 29 de Mzo. de 2024
Editada: MathWorks Support Team el 29 de Mzo. de 2024
The following example walks through a method for logging data in a Simscape model. It is important to note that you cannot access the data from the “simlog” variable in the workspace by clicking into the variable, you must use dot-indexing. Please see step 7 in the following example.
If you would like to perform calculations on the data, you will need to extract the data from a “series,” such as the one in step 7 of the “Log and Plot Simulation Data” example above. If you have the “series” saved in “s1” the data and time vectors can be extracted using the “values” and “time” object functions. Further information about this function can be found at the following location:
Also, here is some example code to perform this extraction:
s1 = simlog.Rotational_Electromechanical_Converter.R.w.series;
TimeData = time(s1);
ValueData = values(s1);
It is also possible to turn on the Simscape Results Explorer. This can be helpful as a first look at the logged data, before creating the command line functions that perform your calculations. The Simscape Results Explorer will open automatically after the simulation is run if you turn on the “Open viewer after simulation” check box in the Configurations Parameters dialog box.  More information on the Simscape Results Explorer can be found here:

Más respuestas (0)

Categorías

Más información sobre Data Logging en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by