How to delete a variable in a MAT-file, which corresponds to an instance of matlab.io.MatFile

4 次查看(过去 30 天)
Background
I use an instance of &nbsp matlab.io.MatFile &nbsp to store and manipulate huge variables. (Huge compared to the capacity of my PC.) During the development of my code I create too many useless variables in the mat-file. The size of the mat-file and the number of variables increases.
The mat-file is version v7.3, which is an HDF5-file. With HDF5 there is no easy way to delete a dataset and recover the space. It is possible to "unlink" a variable and copy the HDF5-file to a new one.
Question
How to delete a variable in a MAT-file, which corresponds to an instance of &nbsp matlab.io.MatFile ? &nbsp Is there a better way than copy the variables, which I want to keep, to a new mat-file and delete the old one?

采纳的回答

Walter Roberson
Walter Roberson 2018-1-5

更多回答(1 个)

Stalin Samuel
Stalin Samuel 2014-10-24

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by