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

    %% Sample Uncertain Complex Parameter
% Compute 400 random samples of an uncertain complex parameter and
% visualize them in a plot. 
%%
% Create an uncertain complex parameter with internal name |A|.  

% Copyright 2015 The MathWorks, Inc.

A = ucomplex('A',4+3*j)
%%
% The
% uncertain parameter's possible values are a complex disc of radius 1,
% centered at 4 + 3_j_. The value of |A.percentage| is 20 (radius is 1/5 of
% the magnitude of the nominal value).
%%
% You can visualize the uncertain complex parameter by sampling and
% plotting the data.
sa = usample(A,400); 
w = linspace(0,2*pi,200); 
circ = sin(w) + j*cos(w); 
rc = real(A.NominalValue+circ); 
ic = imag(A.NominalValue+circ); 
plot(real(sa(:)),imag(sa(:)),'o',rc,ic,'k-') 
xlim([2.5 5.5]) 
ylim([1.5 4.5]) 
axis equal