How can we plot a random number ina bar graph

回答(1 个)

r = rand(1,20000) * 15 - 5; %random -5 exclusive to +10 exclusive
bar(r)
This assumes you are looking for continuous numbers. If you are looking for integers, then use randi() to generate the numbers.

类别

在 帮助中心 和 File Exchange 中查找有关 Networks 的更多信息

产品

版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by