%% Change Nominal Value or Uncertainty of Existing Parameter
% A ureal parameter stores the uncertainty as a relative deviation from nominal (PlusMinus), an absolute range of possible values (Range), and a percentage deviation from nominal (Percentage). The Mode property specifies which of these three does not change when you change the nominal value of the parameter. For instance, create a parameter with nominal value 10 and relative deviation of ±2.

p1 = ureal('p1',10,'PlusMinus',[-2,2])

% Examine the values of the other properties.

get(p1)

% In PlusMinus mode, when you change the nominal value, the PlusMinus property remains fixed, and the values of the other two ways of expressing the uncertainty are updated to reflect the new values. For instance, change the nominal value to 20.

p1.NominalValue = 20;
get(p1)

% The new uncertain parameter has the same PlusMinus value, but the range and percentage are adjusted to the new values that correspond to 20±2.
%
% If you change the PlusMinus value, the Range and Percentage values are updated to reflect the new uncertainties. The nominal value is unchanged.

p1.PlusMinus = [-4 4];
get(p1)

%
% Next change the parameter to Range mode. In this mode, when you change the nominal value, Range remains fixed at [16 24], while Percentage and PlusMinus are updated.

p1.Mode = 'Range';
p1.NominalValue = 22;
get(p1)

%
% Copyright 2020 The MathWorks, Inc.