I need to know if there is a any function in matlab to choose random numbers from a given list. The list is given by the user. Suppose the list is (4,9,10,18,2) each time I want one value to be taken for calculation what function do I use?

1 view (last 30 days)
Is there a function like that?

Accepted Answer

madhan ravi
madhan ravi on 10 Feb 2019
yourlist(randi(numel(yourlist)))
  3 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!