필터 지우기
필터 지우기

what is the result?

조회 수: 4 (최근 30일)
diadalina
diadalina 2017년 10월 24일
답변: KL 2017년 10월 24일
Pull 20 numbers randomly in the interval [0; 1]. What is the minimum value of the vector and the position of the Coefficient which realizes?
  댓글 수: 5
per isakson
per isakson 2017년 10월 24일
Read the documentation on min once more
[ m, ix ] = min( x );
diadalina
diadalina 2017년 10월 24일
편집: diadalina 2017년 10월 24일
yes, you're right, i can obtain the minimum value of the vector and the position of the Coefficient which realizes with the command min,but the first part of the question, how can i do it, can you help me please ?

댓글을 달려면 로그인하십시오.

채택된 답변

KL
KL 2017년 10월 24일
Did you read the documentation of rand?
It says X = rand returns a single uniformly distributed random number in the interval (0,1)
So to generate 20 random numbers, you would use,
X = rand(20,1);
Then you can use min to find the value and index of the minimum value.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by