www.gusucode.com > robust 案例源码程序 matlab代码 > robust/UncertainRealParameterWithNonsymmetricRangeExample.m

    %% Uncertain Real Parameter with Nonsymmetric Range
% Create a nonsymmetric parameter. The end points are
% 1 normalized unit from nominal, and the nominal is 0 normalized units
% from nominal.  Moreover, points inside the range are less than 1 unit from
% nominal, and points outside the range are greater than 1 unit from
% nominal. However, the relationship between the normalized distance and
% numerical difference is nonlinear.

% Copyright 2015 The MathWorks, Inc.

au = ureal('ua',4,'range',[1 5]); 
NV = actual2normalized(au,[1 4 5]) 
%%
NV = actual2normalized(au,[2 4.5]) 
%%
NV = actual2normalized(au,[0 6]) 
%%
% Graph the relationship between actual and normalized values. The
% relationship is very nonlinear.

AV = linspace(-5,6,250);
NV = actual2normalized(au,AV); 

plot(NV,AV,0,au.NominalValue,'ro',-1,au.Range(1),'bo',1,au.Range(2),'bo') 
grid, xlabel('Normalized Values'), ylabel('Actual Values')
%%
% The red circle shows the nominal value (normalized value = 0). The blue
% circles show the values at the edges of the uncertainty range (normalized
% values = -1, 1).