Help with doing this simple problem please.
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Create a vector containing 100 random numbers between 0.5 and 0.75. Display on the screen how many times in the vector the following number is greater than the preceding one.
Réponses (2)
madhan ravi
le 23 Oct 2018
0 votes
Use rand() and a loop to satisfy the condition , this would solve your homework problem
Image Analyst
le 23 Oct 2018
Here's some hints to get you started: rand(), diff(), and sum(), fprintf().
r = rand(......
count = sum(diff(.......
fprintf('The number is %d.\n', count);
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!