| MATLAB Function Reference | ![]() |
addpref('group','pref',val)
addpref('group',{'pref1','pref2',...'prefn'},{val1,val2,...valn})
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.
Note Preference values are persistent and maintain their values between MATLAB sessions. Where they are stored is system dependent. |
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')getpref, ispref, rmpref, setpref, uigetpref, uisetpref
![]() | addpath | addprop (dynamicprops) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |