Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Using a "to file" block to log data every few time steps
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Tushar Sinha
2015 年 11 月 3 日
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 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!