简体   繁体   中英

Histogram in MatLab

I'm a little bit stuck on how to plot a histogram in MatLab, and typing help hist in MatLab does not make me any wiser. So I would appreciate any help!

Basically my problem is very simple. I have a vector, V , with five values, where each value represent the volume of a certain layer of the Earth. I simply want to create a histogram of these data, where the x-axis in my histogram should say "Inner Core", "Outer Core", etc., while the y-axis will display the volume. I've tried using the hist-command in various ways, but I can't get this to work. For instance, if I just type hist(V) , the volume-values actually show up on the x-axis, and not the y-axis.

If anyone can help me how to make this simple histogram I will be very grateful! According to the instructions on my homework, I have to use the hist-command.

What you actually what is a bar plot.

bar([4,20,10,3,8])

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM