Main Content

matlab.settings.SettingsFileUpgrader

Settings file upgrader object

Description

A matlab.settings.SettingsFileUpgrader object represents the changes in the factory settings tree for a specific version of a toolbox. Create a SettingsFileUpgrader for each toolbox version that includes a change to the factory settings tree and record the changes to the tree. Recording changes ensures that toolbox users upgrading to a new version do not have any backward incompatibility issues with their toolbox settings.

Creation

Description

example

upgrader = matlab.settings.SettingsFileUpgrader(version) creates a SettingsFileUpgrader object for the specified toolbox version.

Input Arguments

expand all

Toolbox version to create a SettingsFileUpgrader object for, specified as a character vector or string.

Example: "mytoolbox_Version1"

Properties

expand all

Toolbox version of the SettingsFileUpgrader object, specified as a string.

Object Functions

moveRecord move or rename of factory setting or group
removeRecord removal of factory setting or group

Examples

collapse all

Record changes to the factory settings tree that occurred in two different versions of a toolbox.

Create a settings file upgrader object for version 2 of mytoolbox.

upgraders = matlab.settings.SettingsFileUpgrader('Version2');

Record the move of the settings group font from the mytoolbox.mysettings factory settings group to the mytoolbox group.

move(upgraders,'mytoolbox.mysettings.font','mytoolbox.font');

Create a settings file upgrader object for version 3 of mytoolbox.

upgraders(2) = matlab.settings.SettingsFileUpgrader('Version3');

Record the rename of the two font settings FontSize and FontColor, previously named MyFontName and MyFontColor.

move(upgraders(2),'mytoolbox.font.MyFontSize','mytoolbox.font.FontSize');
move(upgraders(2),'mytoolbox.font.MyFontColor','mytoolbox.font.FontColor');
Introduced in R2019b