How to reduce the decimal places if I want to save the mat file from the workspace?

조회 수: 4 (최근 30일)
WEN SHIN LU
WEN SHIN LU 2022년 3월 24일
댓글: Rik 2022년 3월 24일
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
Stephen23
Stephen23 2022년 3월 24일
@Rik: it sounds like you found the solution too: "use Matlab without mouse and keyboard" definitely means no coding !
Rik
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
Jan 2022년 3월 24일
There are two options:
  1. Use a MAT format with compression: -v7.3 . See: doc save
  2. 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.

카테고리

Help CenterFile 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!

Translated by