www.gusucode.com > robust 案例源码程序 matlab代码 > robust/SamplingUltidynElementsExample.m
%% Sampling ultidyn Elements % When sampling an |ultidyn| element or an uncertain object that contains a % |ultidyn| element, the result is always a state-space (|ss|) object. The % property |SampleStateDimension| of the |ultidyn| class determines the state % dimension of the samples. %% % Create a 1-by-1, gain bounded |ultidyn| object with gain bound 3. Verify % that the default state dimension for samples is 1. % Copyright 2015 The MathWorks, Inc. del = ultidyn('del',[1 1],'Bound',3); del.SampleStateDimension %% % Sample the uncertain element at 30 points. Verify that this creates a % 30-by-1 |ss| array of 1-input, 1-output, 1-state systems. delS = usample(del,30); size(delS) %% % Plot the Nyquist plot of these samples and add a disk of radius 3. Note % that the gain bound is satisfied and that the Nyquist plots are all % circles, indicative of 1st order systems. nyquist(delS) hold on; theta = linspace(-pi,pi); plot(del.Bound*exp(sqrt(-1)*theta),'r'); hold off; %% % Change |SampleStateDimension| to 4, and repeat entire procedure. The % Nyquist plots satisfy the gain bound and as expected are more complex % than the circles found in the 1st-order sampling. del.SampleStateDimension = 4; delS = usample(del,30); nyquist(delS) hold on; theta = linspace(-pi,pi); plot(del.Bound*exp(sqrt(-1)*theta),'r'); hold off;