Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Using a "to file" block to log data every few time steps
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposte (1)
Tushar Sinha
il 3 Nov 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 Commento
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!