Randomize three chosen arrays in matlab
1 view (last 30 days)
Show older comments
Hello, On matlab I named A=[0,0,1] B=[0,1,0] C=[1,0,0]
and I want matlab to randomly pick from A B and C how can I do it please ?
In the end I want to display the randomly chosen array?
Please help
1 Comment
Adam
on 20 Oct 2016
I guess you already have 3 answers, but 'randomly pick from A B and C' is not at all a clear definition of what you want. There are numerous different interpretations of what that means!
Answers (3)
Jan
on 20 Oct 2016
A=[0,0,1]
B=[0,1,0]
C=[1,0,0]
R = [A(randi(3)), B(randi(3)), C(randi(3))]
0 Comments
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!