How can I randomly select one variable between 3 variables?

3 views (last 30 days)
Hwajin Choi
Hwajin Choi on 28 Feb 2022
Commented: Hwajin Choi on 28 Feb 2022
I want to randomly select 1 variable between variables 10, 20, and 30.
This is what I did and it failed.
a = [10:10:30]
It gives me numerous floats. I want to get 10 or 20 or 30.
Thank you for your help.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 28 Feb 2022
a = [10:10:30]

More Answers (0)




Community Treasure Hunt

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

Start Hunting!