%% Randomly Sample Parameter in Tunable Model
% Create the first-order model \[G\left( s \right) = 1/\left( {\tau s + 1} \right)\], where \tau is a tunable real parameter.

tau = realp('tau',5);
G = tf(1,[tau 1]);

%
% Restrain tau to nonnegative values only.

G.Blocks.tau.Minimum = 0;

%
% Generate 20 random samples of G. The result is a 20-by-1 array of first-order models with random values of tau taken from the range of tau.

Gs = rsampleBlock(G,'tau',20);
size(Gs)

% Copyright 2012 The MathWorks, Inc.