Saving large struct files

I am trying to save a struct file previously of size 84 MB. After modifying some fields, when I use the save function i.e. save('Blocks','-v7.3'), it creates a new file with size 17 GB. Any ideas to work around this?

5 Comments

We would need to see more details about this struct and how you build/modify it. E.g., maybe the struct has a lot of shared data variable fields that get duplicated when saved.
The command save('Blocks','-v7.3') stores all variables of the workspace to the file "Block.mat". Do you mean:
save('Blocks.mat', '-v7.3', 'Blocks', '-struct')
save('Blocks.mat', '-v7.3', '-struct','Blocks')
[MOVED FROM FLAG]
Eugene Ben-Awuah wrote:
The file I am trying to save is already a struct file. I get this error message: "The argument to -STRUCT must be the name of a scalar structure variable"
@Eugene: Please use flags only to inform the admins or editors about contents, which is not appropriate for the forum, e.g. due to rudeness. Thanks.
@Eugene: Please do not let us guess all details. I do not know, what a "struct file" is and what the contents of the variable Blocks is. Currently you do not provide any details beside the sizes of the MAT file.

Sign in to comment.

Answers (0)

Categories

Asked:

on 5 Dec 2017

Commented:

Jan
on 6 Dec 2017

Community Treasure Hunt

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

Start Hunting!