This little function allows you to save your data to a mat-file without worrying about accidentally overwriting a previous mat file by the same name. If a mat-file by the specified name (e.g. 'example.mat') already exists, this file is backed-up as e.g. 'example_backup_000.mat' before overwriting 'example.mat'. Every time another overwrite is attempted, the backup counter is incremented.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.