Star
Star

Reputation: 2299

Saving efficiently some large variables using MATLAB

I have a question on how to save large variables created in MATLAB. I have some cell variables (A, B, C) . Each of those occupies more than 2Gb of memory. At the moment I'm saving them by typing

savefile = 'All.mat';
save(savefile, 'A', 'B', 'C', '-v7.3')

It takes a while. I was wondering whether there is a more efficient way to store them, for example by converting them to some other file extension. Any suggestion?

Upvotes: 0

Views: 208

Answers (2)

lhoupert
lhoupert

Reputation: 704

You could also try to save A, B and C in 3 different files? It is what I am generally doing.

Or if you want to have them in the same file you could also save a subset of each cell (e.g. 10) in different files?

Upvotes: 0

Alan Race
Alan Race

Reputation: 41

If disk space is not an issue for you, then you can try turning off compression:

save(savefile, 'A', 'B', 'C', '-v7.3', '-nocompression')

Upvotes: 1

Related Questions