Error when saving a work space

14 views (last 30 days)
Hello, I am trying to save a workspace after I run a simulation but something seems to be going wrong... I have attached two screen shots of what matlab tells me.
I'm not sure if there is any real limitation on what size variables you can and can not store, but I am guessing there is another issue other than this. If you have any idea, I'd really appreciate some help! I want to compare multiple results from different simulations which will take forever if I can not just save the variables! Thanks in advanced.

Accepted Answer

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi on 12 Apr 2020
Edited: Vinai Datta Thatiparthi on 12 Apr 2020
Hello Marcus,
As a workaround, try using the 'v7.3' flag from the command window while using "save". Large files require using this flag when working with "save".
For example, to save the variable 'D',
save('DVal.mat', 'D', '-v7.3')
You can set 'v7.3' as the default in -
Preferences --> MATLAB --> General --> MAT-Files
Secondly, loading a MAT file which is still being saved in the background or which was interrupted halfway through (because of closing MATLAB, or any other reason) results in the error "File might be corrupted".
Hope this helps!
  1 Comment
Marcus Rosales
Marcus Rosales on 15 Apr 2020
Thanks for the reply! I'll just put that line of code at the end of my file with the desired variables.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by