Generating random number from a vector

11 ビュー (過去 30 日間)
Aftab Ahmed Khan
Aftab Ahmed Khan 2015 年 1 月 10 日
コメント済み: Aftab Ahmed Khan 2015 年 1 月 10 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by