Help with doing this simple problem please.
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
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.
Risposte (2)
madhan ravi
il 23 Ott 2018
0 voti
Use rand() and a loop to satisfy the condition , this would solve your homework problem
Image Analyst
il 23 Ott 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);
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!