|
|
genrate uniform random variable from a set
Is there away to genrate random number from a set of numbers
for example
random number from the set {1,3,4,6,9}
|
|
0
|
|
|
|
Reply
|
Namo
|
4/15/2010 3:37:04 PM |
|
"Namo " <namo1983@hotmail.com> wrote in message
news:hq7br0$mll$1@fred.mathworks.com...
> Is there away to genrate random number from a set of numbers
>
> for example random number from the set {1,3,4,6,9}
>
Use RANDI to generate a random integer between 1 and NUMEL of the set, then
use that random integer as an index.
myset = [1 3 4 6 9];
indices = randi([1 numel(myset)], 10, 10);
values = myset(indices)
--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|
|
0
|
|
|
|
Reply
|
Steven
|
4/15/2010 4:06:45 PM
|
|
"Namo " <namo1983@hotmail.com> wrote in message <hq7br0$mll$1@fred.mathworks.com>...
> Is there away to genrate random number from a set of numbers
>
> for example
> random number from the set {1,3,4,6,9}
one of the many solutions
s={1,3,4,6,9}; % <- set
n=5; % <- # of randomly chosen elements of S
ix=ceil(5*rand(1,n));
r=[s{ix}]
% r = 9 6 3 6 6 % <- current state of RAND...
us
|
|
0
|
|
|
|
Reply
|
us
|
4/15/2010 6:02:21 PM
|
|
|
2 Replies
286 Views
(page loaded in 0.023 seconds)
Similiar Articles: uniform random variable - comp.soft-sys.matlab... uniform random variable - comp.soft-sys.matlab How to generate random number given density function? - comp.soft ... genrate uniform random variable from a set - comp.soft ... How to generate random number given density function? - comp.soft ...uniform random variable - comp.soft-sys.matlab How to generate random number given density function? - comp.soft ... genrate uniform random variable from a set - comp.soft ... How to generate vector of random numbers in any interval (e.g. [-1 ...... given sum of random variables, and this makes perfectly good sense. Unfortunately if one simply normalizes a set of random ... If you generate N uniform random numbers on ... Generating a uniform random rotation matrix - comp.soft-sys.matlab ...Hi, I'm wondering what is the best way to generate uniform random rotation ... to generate random number ... Simulation: Drawing one pseudo-random uniform variable ... creating a counting variable - comp.soft-sys.sasI have a set of variables that I need to create a new variable from by counting the number of 1s (as ... That's a very common way of how to create a set of random numbers ... random numbers from beta distribution - comp.soft-sys.matlab ...Random number with variable mean and variance - comp.soft-sys ... random numbers from ... uniform random number, call it U. Rand will do nicely. ... genrate uniform random ... Generate noise with specific crest factor - comp.dspassuming you have a uniform pseudo-random variable generated by the computer, you ... Hi, I know various methods to generate a ... Math.random() by some integer factor ... Generate noise model[Please help] - comp.soft-sys.matlab ...... function to get a function that can generate random numbers ... as input numbers that have been drawn from a uniform ... of imtool.) clear; % Erase all existing variables ... Randomly permute a given set of numbers - comp.soft-sys.matlab ...Also, is there any command to randomly arrange a given set of random numbers ... comp.lang ..... number without replacement in perl. ... How To Generate Non-Uniform Random ... ... How to Rescale dimensions of a 3-D matrix? - comp.soft-sys.matlab ...The SET Xtick command does not work for this. For the Z-Axis I do not ... matrix - comp.soft-sys.matlab Hi, I'm wondering what is the best way to generate uniform random ... Monte Carlo Simulation: IEOR E4703 Fall 2004 2004 by Martin Haugh ...Inverse Transform Algorithm for Continuous Random Variables: 1. Generate U 2. Set X = x if F x(x) = U, i.e ... Example 16 (Generating from a Uniform Distribution over a 2-D Region) How To Generate Non-Uniform Random Numbers In Excel Worksheetsgenerate a random number from the Uniform distribution: u=Uniform(0,1), and ... However, if you need to generate a single set of random numbers from a ... 7/17/2012 12:11:48 AM
|
|
|
|
|
|
|
|
|