Help with doing this simple problem please.
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
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.
0 个评论
回答(2 个)
madhan ravi
2018-10-23
0 个投票
Use rand() and a loop to satisfy the condition , this would solve your homework problem
0 个评论
Image Analyst
2018-10-23
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);
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!