cell part not saved using '-struct' option

Hi:
I have a structure variable 'ImaInfo' like below:
Capture.JPG
then I saved it into disk using '-struct' option, using command:
save('test.mat','-struct','ImaInfo')
but the variable data in the struction ('ImaInfo.data') is not saved in the 'test.mat' file, as shown below:
Capture.JPG
just want know if there is any mistake with my operation? or 'cell' type is not allow to save in '-struct' option?
Thanks!
Yu

10 Kommentare

Walter Roberson
Walter Roberson am 21 Mai 2019
In my quick test in R2019a, all three fields show up for me.
Yu Li
Yu Li am 21 Mai 2019
Hi Walter:
I tried both 2018a and 2018b the result is the same.
Thanks!
Yu
Did you receive any warning message when you tried saving the struct array? If so what is the full text of that warning (all the text displayed in orange?)
Are you certain you're using the built-in save function? What does this return?
which -all save
What type of data is stored inside the cell array named data?
Walter Roberson
Walter Roberson am 21 Mai 2019
Is it possible that the data field contained over 1 gigabyte ?
Yu Li
Yu Li am 21 Mai 2019
Bearbeitet: Yu Li am 21 Mai 2019
Hi Steven:
there is no warning.
below is the result of which -all save:
>> which -all save
built-in (/apps/matlab/R2018b/toolbox/matlab/general/save)
save is a Java method % com.mathworks.services.Prefs method
/apps/matlab/R2018b/toolbox/matlab/codetools/+matlab/+desktop/+editor/@Document/Document.m % matlab.desktop.editor.Document method
save is a Java method % com.mathworks.mde.editor.MatlabEditor method
save is a Java method % com.mathworks.matlab.api.editor.Editor method
/apps/matlab/R2018b/toolbox/matlab/appdesigner/appdesigner/+appdesigner/+internal/+model/AppModel.m % appdesigner.internal.model.AppModel method
/apps/matlab/R2018b/toolbox/matlab/winfun/@COM/save.m % COM method
/apps/matlab/R2018b/toolbox/simulink/simulink/@slxPackager/save.p % slxPackager method
/apps/matlab/R2018b/toolbox/sl3d/sl3d/@vrworld/save.m % vrworld method
the data inside the 'ImaInfo.data' is 'unit8' matrix which obtained from 'imread':
Hi Walter:
the file is very large: ~700Mb.
Thanks!
Yu
Walter Roberson
Walter Roberson am 22 Mai 2019
The cell array contains more than 4 gigabytes and so needs the -v7.3 flag to save
Yu Li
Yu Li am 22 Mai 2019
the totally size is 700Mb, which is less than 4Gb
Walter Roberson
Walter Roberson am 22 Mai 2019
The limitation is not on the compressed size of the data: it is on the raw size of the data including the uncompressed headers.
Yu Li
Yu Li am 22 Mai 2019
I tried the '-v7.3' option, yes, the parameter is successfully saved. but I have one more question:
the size of original file is: 778436Kb
the size of compressed file is: 778431Kb
the usage of '-v7.3' only reduced 5Kb of the disk size, do you think this weird?
Thansk!
Yu
Walter Roberson
Walter Roberson am 22 Mai 2019
V7.3 is not a compression specification. V7.3 uses a completely different internal format for data that is able to hold large variables where the old format included size counters that were limited to 1 gigabytes.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Gefragt:

am 21 Mai 2019

Kommentiert:

am 22 Mai 2019

Community Treasure Hunt

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

Start Hunting!

Translated by