Documentation |
Generate random samples of uncertain object
B = usample(A); B = usample(A,N) [B,SampleValues] = usample(A,N) [B,SampleValues] = usample(A,Names,N) [B,SampleValues] = usample(A,Names1,N1,Names2,N2,...) [B,SampleValues] = usample(A,N,Wmax) [B,SampleValues] = usample(A,Names,N,Wmax)
B = usample(A) substitutes a random sample of the uncertain objects in A, returning a certain (i.e., not uncertain) array of size [size(A)].
B = usample(A,N) substitutes N random samples of the uncertain objects in A, returning a certain (i.e., not uncertain) array of size [size(A) N].
[B,SampleValues] = usample(A,N) additionally returns the specific sampled values (as a Struct whose field names are the names of A's uncertain elements) of the uncertain elements. Hence, B is the same as usubs(A,SampleValues).
[B,SampleValues] = usample(A,Names,N) samples only the uncertain elements listed in the Names variable (cell, or char array). If Names does not include all the uncertain objects in A, then B will be an uncertain object. Any entries of Names that are not elements of A are simply ignored. Note that usample(A,fieldnames(A.Uncertainty),N) is the same as usample(A,N).
[B,SampleValues] = usample(A,Names1,N1,Names2,N2,...) takes N1 samples of the uncertain elements listed in Names1, and N2 samples of the uncertain elements listed in Names2, and so on. size(B) will equal [size(A) N1 N2 ...].
The scalar parameter Wmax in
[B,SampleValues] = usample(A,N,Wmax) [B,SampleValues] = usample(A,Names,N,Wmax) [B,SampleValues] = usample(A,Names,N,Wmax)
affects how ultidyn elements within A are sampled, restricting the poles of the samples. If A is a continuous-time uss or ufrd, then the poles of sampled GainBounded ultidyn elements in SampleValues will each have magnitude <= BW. If A is a discrete-time, then sampled GainBounded ultidyn elements are obtained by Tustin transformation, using BW/(2*TS) as the (continuous) pole magnitude bound. In this case, BW should be < 1. If the ultidyn type is PositiveReal, then the samples are obtained by bilinearly transforming (see Normalizing Functions for Uncertain Elements) the GainBounded elements described above.