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에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2015년 1월 10일

댓글:

2015년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by