what is the result?

2 Ansichten (letzte 30 Tage)
diadalina
diadalina am 24 Okt. 2017
Beantwortet: KL am 24 Okt. 2017
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 Kommentare
per isakson
per isakson am 24 Okt. 2017
Read the documentation on min once more
[ m, ix ] = min( x );
diadalina
diadalina am 24 Okt. 2017
Bearbeitet: diadalina am 24 Okt. 2017
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 ?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KL
KL am 24 Okt. 2017
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.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by