addpref - Add preference

Syntax

addpref('group','pref',val)
addpref('group',{'pref1','pref2',...'prefn'},{val1,val2,...valn})

Description

addpref('group','pref',val) creates the preference specified by group and pref and sets its value to val. It is an error to add a preference that already exists.

group labels a related collection of preferences. You can choose any name that is a legal variable name, and is descriptive enough to be unique, e.g. 'ApplicationOnePrefs'. The input argument pref identifies an individual preference in that group, and must be a legal variable name.

addpref('group',{'pref1','pref2',...'prefn'},{val1,val2,...valn}) creates the preferences specified by the cell array of names 'pref1', 'pref2',...,'prefn', setting each to the corresponding value.

Examples

This example adds a preference called version to the mytoolbox group of preferences and sets its value to the string 1.0.

addpref('mytoolbox','version','1.0')

See Also

getpref, ispref, rmpref, setpref, uigetpref, uisetpref

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS