www.gusucode.com > robust 案例源码程序 matlab代码 > robust/EvaluateUncertainMatrixoverGridofUncertainParametersExample.m
%% Evaluate Uncertain Matrix over Grid of Uncertain Parameters % Evaluate an uncertain matrix over a 3-by-4 grid of values of the uncertain % parameters of the matrix. % Copyright 2015 The MathWorks, Inc. %% % Create a 2-by-2 uncertain matrix with two uncertain parameters. a = ureal('a',5); b = ureal('b',-3); M = [a b;0 a*b]; %% % Build arrays of values for the uncertain parameters. aval = [1;2;3;4]; bval = [10;20;30]; [as,bs] = ndgrid(aval,bval); %% % This command builds two 4-by-3 grids of values. %% % Evaluate M over the parameter grids |A| and |B|. B = usubs(M,'a',as,'b',bs); %% % This command evaluates |M| for each four different combination of values % |(A(k),B(k))|. |B| is a 2-by-2-by-4-by-3 array of numeric values, which % is a 4-by-3 array of values of |M|, i.e., |M| evaluated over the parameter % grids.