Change one element in a row at a time with an uniform probability.
1 view (last 30 days)
Show older comments
Hello! I want to change one element in a row of my matrix at a time with uniform probability. Currenty my matrix of [50*50] chooses one element at a time from a set of [0, 0.1, 0. 0.2, 0.3, 0.4] with an uniform probability. With the following code. But in this more than one element changes at a time which does not satisfy the above condition. How to satisfy changing one element at a time with an uniform probablility?
% code
value_set = [range];
numvalues = 50;
x_star = value_set(randi(numel(value_set), 1, numvalues));
0 Comments
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!