How do I load MAT-files generated by MATLAB 7.0 (R14) in prior versions?

3 views (last 30 days)
I would like to know how to load MAT-files generated by MATLAB 7.0 (R14) in prior versions.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to load MAT-files generated by MATLAB 7.0 (R14) in prior versions of MATLAB is not available, by default, if strings or figures are stored in the MAT-file.
This is a result of a change in how characters are stored in R14, which uses Unicode data encoding rather than ASCII data encoding. The default encoding can be overridden by using the -v6 flag. For example, when using the SAVE function to store variables into a MAT-file:
save filename -v6
Similarly, use the -v6 flag if saving figures to a FIG-file:
hgsave(filename, '-v6')
If you create a MAT-file in R14 and intend to read that MAT-file with an earlier version of MATLAB, you must use the -v6 flag in order to store it in a format that the earlier version can read correctly.
If you wish to store files using the -v6 option by default, you may change this setting in your preferences by selecting the "Ensure backward compatibility (-v6)", available in the General preferences section under the heading: "MAT-Files".

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!