MATLAB Function Reference Previous page   Next Page
getpref

Get preference

Syntax

Description

getpref('group','pref') returns the value for the preference specified by group and pref. It is an error to get a preference that does not exist.

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.

getpref('group','pref',default) returns the current value if the preference specified by group and pref exists. Otherwise creates the preference with the specified default value and returns that value.

getpref('group',{'pref1','pref2',...'prefn'}) returns a cell array containing the values for the preferences specified by group and the cell array of preference names. The return value is the same size as the input cell array. It is an error if any of the preferences do not exist.

getpref('group',{'pref1',...'prefn'},{default1,...defaultn}) returns a cell array with the current values of the preferences specified by group and the cell array of preference names. Any preference that does not exist is created with the specified default value and returned.

getpref('group') returns the names and values of all preferences in the group as a structure.

getpref returns all groups and preferences as a structure.

Examples

Example 1.

Example 2.

See Also

addpref, ispref, rmpref, setpref, uigetpref, uisetpref


Previous page  getplottool get (timer) Next page

© 1994-2005 The MathWorks, Inc.