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

    %% Instantiate Uncertain Parameter Using Different Value for Each Entry in Array  
% Evaluate an array of uncertain models, substituting a different value
% for the uncertain parameter in each entry in the array.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Create a 1-by-2 uncertain matrix with two uncertain parameters. 
a = ureal('a',5);
b = ureal('b',-3);
M = [a b];  

%% 
% Replace |a| by each of the values 1, 2, 3, and 4. 
Ma = usubs(M,'a',[1;2;3;4]); 

%%
% This command returns a 4-by-1 array of 1-by-2 uncertain matrices that
% contain one uncertain parameter |b|.  

%% 
% For each model in the array |Ma|, evaluate |b|. Use |b = 10| for the first
% entry in the array, |b = 20| for the second entry, and so on. 
B = usubs(Ma,'b',{10;20;30;40},'-once'); 

%%
% The |'-once'| flag causes |usubs| to evaluate the first model in the array
% using the first specified value for |b|, the second model for the second
% specified value, etc.