How to reduce the decimal places if I want to save the mat file from the workspace?
5 次查看(过去 30 天)
显示 更早的评论
Hi,
I handled my structure data, saved it in workspace and then output as mat file, but I don't want my file to be this large. How to reduce the decimal places if I want to save the mat file from the workspace? At first I used preferences to change variables, but it didn't reduce the storage of the mat file. How can I use any functions in MATLAB without coding?
Thank you so much.
4 个评论
Rik
2022-3-24
Although with a touchscreen and the apps in the lint you can probably get quite some distance with a finger. Also no coding.
回答(1 个)
Jan
2022-3-24
There are two options:
- Use a MAT format with compression: -v7.3 . See: doc save
- Convert doubles to singles or (U)INT32/16/8 arrays, if the loss of precision is no problem. CHAR arrays need 2 bytes per element also, so UINT8 might save some space.
There is no magic "make the output files smaller" flag.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!