how to create a vector of 5 random integers each in rang of -10 and 10.
显示 更早的评论
how to create a vector of 5 random integers each in rang of -10 and 10. Perform each of the following using only vectorized code:
Subtract 3 from each element,
Count how many are positive,
Get the absolute value of each element,
Find the maximum.
回答(2 个)
Walter Roberson
2012-11-7
0 个投票
Read the documentation for randi()
Amin Bashi
2012-11-7
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!