| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Robust Control Toolbox |
| Contents | Index |
Generate random samples of uncertain variables
samples = usample(uvars,N) generates N random samples of the uncertain variables in uvars. uvars is a structure that lists uncertain variables (ureal, ucomplex or ultidyn) by name. You can automatically obtain uvars for a Simulink model that contains Uncertain State Space blocks using ufind. samples is an N-by-1 structure array whose field names and values are the names and sample values of the uncertain variables. Use this syntax, together with ufind, to generate random samples for uncertain variables in Simulink models.
samples = usample(uvars) is equivalent to usample(uvars,1).
samples = usample(uvars,N,Wmax) specifies constraints, as described in uss/usample, for sampling uncertain variables of type ultidyn in uvars.
Example 1
Generate random samples of uncertain variables:
% Create a structure that contains uncertain variables a and % b. uvars = struct('a',ureal('a',5),'b',ultidyn('b',[2 3],'Bound',7)) % Use usample to generate random values of a and b. samples = usample(uvars)
Example 2
Generate random samples of uncertain variables in a Simulink model:
The model, as shown in the following figure, contains three Uncertain State Space blocks named Unmodeled Plant Dynamics, Plant, and Sensor Gain. These blocks depend on three uncertain variables named input_unc, unc_pole and sensor_gain.

ufind, usubs, ureal, ucomplex, ultidyn, umat, ufrd, uss, uss/usample
Varying Uncertainty Values Using Individual Uncertain State Space Blocks
Varying Uncertainty Values Across Multiple Uncertain State Space Blocks
Robustness Analysis in Simulink
"Simulating Uncertainty Effects
| Provide feedback about this page |
![]() | uss/usample | usimfill | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |