Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Using a "to file" block to log data every few time steps

2 visualizaciones (últimos 30 días)
Adam Rhoads
Adam Rhoads el 30 de Oct. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello,
I am trying to log results from a Simulink system using to File blocks, but have run into issues. Right now the .mat files remain empty until the simulation has been stopped. How can I make a To File block start logging data during the simulation? From the documentation it seems like this should be possible.
Thank you.

Respuestas (1)

Tushar Sinha
Tushar Sinha el 3 de Nov. de 2015
Hi Adam,
The default behavior of the "To File" block is to write to the output file incrementally, with minimal memory overhead during simulation. If the output file exists when the simulation starts, the block overwrites the file. The file automatically closes when simulation is complete or paused. If simulation terminates abnormally, the To File block saves the data it has logged up until the point of the abnormal termination.
Refer to the link below for more information on the same:
However, in your case, if you still see that the data is not getting logged during the simulation you can change certain properties to control when Data is written to the file. Refer to the steps below to achieve the same:
1) The To File block Decimation and Sample Time parameters control when data is written to the file.
2) The To File block does not log data outside of the intervals specified by the Model Configuration Parameters > Data Import/Export > Logging intervals parameter. The block stores the logged data in the file associated with the block instead of storing the data in the variable that you specify for the Save simulation output as single object parameter.
I hope the above information helps answer your question.
Thanks,
Tushar
  1 comentario
Adam Rhoads
Adam Rhoads el 3 de Nov. de 2015
Editada: Adam Rhoads el 3 de Nov. de 2015
Tushar,
Thank you for the information. Could you please explain this portion? "
"The To File block does not log data outside of the intervals specified by the Model Configuration Parameters > Data Import/Export > Logging intervals parameter. The block stores the logged data in the file associated with the block instead of storing the data in the variable that you specify for the Save simulation output as single object parameter."
I have modified the logging intervals parameter without any luck.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by