Generating random number from a vector

19 views (last 30 days)
Hello everyone, If i have a vector like A = [1 2 3 4 5 6.......30] and i want to pick a random value from this vector A. How can i do that. Thank you so much.

Accepted Answer

Guillaume
Guillaume on 10 Jan 2015
A(randi(numel(A))

More Answers (0)

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!