removevar removes variable(s) from selected Mat file(s)
removevar selects MAT file(s) matfiles and ask user to select which
variables to delete. If more than one MAT file, matfiles is of cell format. Otherwise, matfiles can be either of char or cell class.
removevar(matfiles) ask user to select which variables in matfiles to delete removevar(matfiles,varargin) deletes variables that matches varargin in matfiles.
Chaowei Chen (2021). remove varables in MAT file(s) (https://www.mathworks.com/matlabcentral/fileexchange/40532-remove-varables-in-mat-file-s), MATLAB Central File Exchange. Retrieved .
Please note that this function doesn't directly remove the file from the .mat file; it instead rewrites every other variable to another .mat file. This will be exceedingly slow for those times in which this method would be most useful--deleting a small variable from a very large .mat file.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!