Monday, March 17, 2014

[Trouble shooting / MATLAB] save '-v7.3'

When I saved large size structure, problem comes up.

Warning : Variable 'structure name' cannot be saved to a MAT-file whose version is older than 7.3. To save this variable, use the -v7.3 switch.

- With the -v7.3 flag, you could store more than 2GB variables with compression.
- Without the -v7.3 flag, there is no compression and you could not store large variables.





I clipped the documents from the MATLAB help documents.

Version Compatibility Options

The following table lists version compatibility options. These options enable you to save your workspace data to a MAT-file that can then be loaded into an earlier version of MATLAB software. The resulting MAT-file supports only those data items and features that were available in this earlier version of MATLAB. (See the second table below for what is supported in each version.)

version OptionUse When Running ...To Save a MAT-File That You Can Load In ...
-v7.3Version 7.3 or laterVersion 7.3 or later
-v7Version 7.3 or laterVersions 7.0 through 7.2 (or later)
-v6Version 7 or laterVersions 5 and 6 (or later)
-v4Version 5 or laterVersions 1 through 4 (or later)

The default version option is the value specified in the Preferences dialog box. Select File > Preferences in the Command Window, click General, and then MAT-Files to view or change the default.
The next table shows what data items and features are supported in different versions of MATLAB. You can use this information to determine which of the version compatibility options shown above to use.
MATLAB VersionsData Items or Features Supported
4 and earlierSupport for 2D double, character, and sparse
5 and 6Version 4 capability plus support for ND arrays, structs, and cells
7.0 through 7.2Version 6 capability plus support for data compression and Unicode character encoding
7.3 and laterVersion 7.2 capability plus support for data items greater than or equal to 2GB


Remarks

When using the -regexp switch, save considers all variables in the argument list, with the exception of the optional filename and structure name variables, to be regular expressions. The filename, if specified, is always the first argument in the argument list, provided that this argument is a variable name. The structure name, if specified, is always the first argument following the -struct keyword, provided that the argument list includes that keyword.
When working on 64-bit platforms, you can have data items in your workspace that occupy more than 2 GB. To save data of this size, you must use the HDF5-based version of the MATLAB MAT-file. Use the –v7.3 option to do this:
save -v7.3 myfile v1 v2
If you are running MATLAB on a 64-bit computer system and you attempt to save a variable that is too large for a version 7 (or earlier) MAT-file, that is, you save without using the -v7.3 option, MATLAB skips that variable during the save operation and issues a warning message to that effect.
If you are running MATLAB on a 32-bit computer system and attempt to load a variable from a -v7.3 MAT-file that is too large to fit in 32–bit address space, MATLAB skips that variable and issues a warning message to that effect.
MAT-files saved with compression and Unicode encoding cannot be loaded into versions of MATLAB prior to MATLAB Version 7.0. If you save data to a MAT-file that you intend to load using MATLAB Version 6 or earlier, you must specify the -v6 option when saving. This disables compression and Unicode encoding for that particular save operation.
If you want to save to a file that you can then load into a Version 4 MATLAB session, you must use the -v4 option when saving. When you use this option, variables that are incompatible with MATLAB Version 4 are not saved to the MAT-file. For example, ND arrays, structs, cells, etc. cannot be saved to a MATLAB Version 4 MAT-file. Also, variables with names that are longer than 19 characters cannot be saved to a MATLAB Version 4 MAT-file.

No comments:

Post a Comment