How to log signal data from simulink to matlab with higher time interval to avoid high data storage?

3 ビュー (過去 30 日間)
In my problem of Reinforcement Learning, I am using a sample time of 0.3 sec and have a variable step solver in simulink. I want to run my simulation for 1000 episodes, and for each episode, I have logged a signal data. However, when accessing that in Matlab, I get data with interval of 0.001 sec. I want the data to be logged at 0.3 sec, which will be enough to get average value and at the same time use less memory.
Can we change the time step interval to store log signal irrespective to sample time or step size?
  3 件のコメント
Parth Patel
Parth Patel 2023 年 3 月 9 日
With option 'Log Selected Signals' on right clicking required signal in simulink.
Is this what you meant to know?
Parth Patel
Parth Patel 2023 年 3 月 9 日
Moreover, since I am using Reinforcement Learning toolbox. I can get the data under 'train' function.

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 3 月 9 日
Set the "Decimate data" to be 300. It means log every 300th data. It may not guarantee 0.3 second if using variable step size solver. It has to work with your solver and step size. Other logging methods have similar "Decimate data" setting.

その他の回答 (1 件)

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2023 年 3 月 9 日
If you are using R2022b, please take a look at this page. We recently added enhanced logging capabilities in Reinforcement Learning Toolbox so you have more flexibility over what and when to log. For example you can log a signal after an agent takes a step which ensures that you will have 0.3s sample time.

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by