


CustomDefaults - User-defined custom default values for function properties.
The behavior of most FMAToolbox functions can be modified using optional
property-value pairs, e.g. GetPositions returns position samples in different
coordinate systems depending on the property 'coordinates'. Such properties
usually have default values. In some cases, default values can be customized.
Note that customizing a default value is *different* from assigning an explicit
value to a property: it applies when the function is called without explicitly
setting a value for the property.
An example will make this clear. By default, GetPositions returns position
samples in normalized coordinates. To use video coordinates instead, one can
of course call:
p = GetPositions('coordinates','video');
but this does not affect the *default* behavior of GetPositions, which is
to return normalized coordinates if one calls:
p = GetPositions;
What custom default values allow is to override this default behavior and
have GetPositions return video coordinates when called without explicit
parameters.
To define a custom default value, users can e.g. add the following lines to
their startup.m file:
global SETTINGS;
SETTINGS.GetPositions.coordinates = 'video';

0001 %CustomDefaults - User-defined custom default values for function properties. 0002 % 0003 % The behavior of most FMAToolbox functions can be modified using optional 0004 % property-value pairs, e.g. GetPositions returns position samples in different 0005 % coordinate systems depending on the property 'coordinates'. Such properties 0006 % usually have default values. In some cases, default values can be customized. 0007 % 0008 % Note that customizing a default value is *different* from assigning an explicit 0009 % value to a property: it applies when the function is called without explicitly 0010 % setting a value for the property. 0011 % 0012 % An example will make this clear. By default, GetPositions returns position 0013 % samples in normalized coordinates. To use video coordinates instead, one can 0014 % of course call: 0015 % 0016 % p = GetPositions('coordinates','video'); 0017 % 0018 % but this does not affect the *default* behavior of GetPositions, which is 0019 % to return normalized coordinates if one calls: 0020 % 0021 % p = GetPositions; 0022 % 0023 % What custom default values allow is to override this default behavior and 0024 % have GetPositions return video coordinates when called without explicit 0025 % parameters. 0026 % 0027 % To define a custom default value, users can e.g. add the following lines to 0028 % their startup.m file: 0029 % 0030 % global SETTINGS; 0031 % SETTINGS.GetPositions.coordinates = 'video'; 0032 %