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.

 採用された回答

Guillaume
Guillaume 2015 年 1 月 10 日

2 投票

A(randi(numel(A))

1 件のコメント

Aftab Ahmed Khan
Aftab Ahmed Khan 2015 年 1 月 10 日
Thank you, it worked the way i wanted it to. take care.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Random Number Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by