problem with saving dataset

조회 수: 1 (최근 30일)
Walter
Walter 2012년 1월 9일
Loading a dataset and saving it directly without any other variables in workspace generates a much bigger file . 1.387 Mb becomes a matfile of 137.751 Mb. Any reason for this? Matlab version 7.3 is used for saving.
  댓글 수: 1
Jaap
Jaap 2012년 1월 9일
did you look at things like format (xls,txt,...) and to data types (doubles, integers...)?

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt Tearle
Matt Tearle 2012년 1월 9일
What is the size of the variable in the workspace? (You can run whos to see this info.)
If it's ~137 Mb then my guess is that it's something to do with the type of file you're reading from and/or the type of data that allows it to be compressed or stored in a small amount of memory, but when you're bringing it into MATLAB it's probably using "large-footprint" types like doubles. Simple example to explain what I mean:
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
saved as a text file is only 36 bytes. Read it into MATLAB and it will be a 4-by-4 array of doubles => it's 16*8 = 128 bytes.

카테고리

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