[go: up one dir, main page]

Menu

[r65]: / trunk / randext.m  Maximize  Restore  History

Download this file

28 lines (24 with data), 789 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function aSample = randext(varargin)
% randext - extended simple random generator (returns only one sample)
% Uses the same parameters as UBASE constuctor, and 'name' field can be
% omitted.
%
% Example:
%
% % a 3-d complex vector, uniformly distibuted in p-inf norm:
% x = randext('complex_vector_uniform', 'nominal', [1, j, 1+j], ...
% 'range', [0.1, 0.5, 0.2], 'p_norm', inf, 'rho', 1)
%
% % get coefficients of a monic discrete stable polynomial of degree 10
% x = randext('real_stable_discrete_poly_uniform', 'degree', 10)
%
% SEE ALSO: UBASE
% $Id$
% name parameter used
if mod(nargin, 2) == 0
A = ubase(varargin{:});
else
% otherwise function can be used without
A = ubase('tmp', varargin{:});
end
aSample = ubasesample(A, 1);