%% Uncertain Real Parameter with Specified Deviation from Nominal
% Create an uncertain real parameter with nominal value 10, and an uncertainty range of ±2. Because this uncertainty is symmetric, you can specify it by setting PlusMinus to 2, instead of explicitly setting it to [-2,2].

p1 = ureal('p1',10,'PlusMinus',2)

%
% Create another parameter with nominal value 10, this time with an asymmetric uncertainty such that the value can decrease by 2 from the nominal but can increase by 5.

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

%
% Examine the properties of the parameter. The Range and Percentage properties are automatically set to values corresponding to this variability.

get(p2)

% Because you specified PlusMinus to create the parameter, the Mode property initializes to PlusMinus. In this mode, when you change the nominal value, PlusMinus remains fixed, while Percentage and Range change to reflect the new range of values the parameter can take. See Change Nominal Value or Uncertainty of Existing Parameter.
%
% Copyright 2020 The MathWorks, Inc.