Automatic data exporting/saving into "to workspace"

I am working in simulation of model and I want to automate data exporting/saving of data from that simulation for every certain time. Can someone help me how to do this?

 Respuesta aceptada

Raj
Raj el 21 de Mayo de 2019
Question is not very clear. What I undertand is that you want to save some data to workspace. But instead of continuously saving the data you want to save it only at certain time steps. In that case try using the 'To Workspace' block inside an Enabled Subsystem with the control signal design dependent on your timing constraints. Get back with your model and further details in case you are looking for something more.

3 comentarios

rolando pula
rolando pula el 21 de Mayo de 2019
Hello Sir. Thank you for your reply, what I want is to record the output like for example every 10 seconds of 1 hour simulation and save the output into .mat or .csv format for each recorded time frame, and generate automatic file name for each output for example. data1, data2, data3,... Hope you can help me with this. Thank you in advance
Raj
Raj el 21 de Mayo de 2019
In that case, use of 'To Workspace' block in an enabled subsystem as I mentioned in my first answer should work. Please note that the "To Workspace" block logs the signal at each time step of simulation and at the end of simulation, there is an array/structure with signal values as well as the time-stamps corresponding to each value. At the end of simulation you can split the data into data1, data2 etc using the time stamps. On top level I think this approach should work out for your case.
rolando pula
rolando pula el 21 de Mayo de 2019
Oh, I get it now. Thank you for this. =)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Prepare Model Inputs and Outputs en Centro de ayuda y File Exchange.

Preguntada:

el 21 de Mayo de 2019

Comentada:

el 21 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by