Modified Signal Logging file size gets very large

3 ビュー (過去 30 日間)
Will Schulke
Will Schulke 2022 年 11 月 8 日
回答済み: Dhruv 2023 年 8 月 31 日
I have a singnal logging file generrated from a model that is about 2800 KB. I have a script that trims off the first 1 second of data to strip out iniitialization anomolies I do not care about. I also modified the data downsampling from 10 msec to 40 msec samples. When the script is complete the mat file is anywhere from 25,000, to 30,000 KB. Thsi makes the file much less shareable/portable. It would be nice to understand why the file sized increased so much and if there are any tricks?
Thanks,
Will

回答 (1 件)

Dhruv
Dhruv 2023 年 8 月 31 日
The issue of file size being increased so much is essentially because of duplication of the data. When you trim off the first 1 second of data, it’s still getting stored but just not getting included in the final file. And when you downsample the data, you are storing the same data points, just less frequently.
There are a few tricks you can use to reduce the file size:
  • Only store the data that you need. If you don't need the first 1 second of data, don't store it. And if you don't need the data at 10 msec resolution, downsample it to a lower resolution.
  • Use a lossless compression format. There are several lossless compression formats available, such as GZIP and BZIP2. These formats can significantly reduce the file size without losing any data.
  • Use a smaller data type. If the data is floating point, you can use a smaller data type, such as half precision. This will reduce the file size by half.
Hopefully the above steps will help you solve the issue!

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by