Skip to content

Saving large data arrays with proc.Batch fails when default mat file is v7 #2

@spmeisburger

Description

@spmeisburger

By default, MATLAB uses v7 .mat files which have a size limit of 2^31 bytes per variable.

Certain batch operations (such as proc.Batch.reintegrate) produce such large arrays, and may throw a mysterious error when trying to write the file, such as:

Unable to save file '[...] /reintegrate.mat’. The file could not be closed, and might now be corrupt.

The problem can be solved by changing the default file format to v7.3 in preferences:
See:
https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html

However, it would be better to force v7.3 in this line of proc.Batch.saveToMatFile:

save(fileName,'-struct','dataToSave',varargin{isFlag});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions