what is the result?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
per isakson
le 24 Oct 2017
Read the documentation on min once more
[ m, ix ] = min( x );
Réponse acceptée
KL
le 24 Oct 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.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!