MATLAB bins setting in histogram

若如初见. 提交于 2020-02-07 12:30:09

问题


I want to change how data are distributed in the histogram that I built.My histogram looks like

But I want it to look like

I set

bins1=[10,30,50,70];
hist(data,bins1) 

How can I arrange the bins as in the second figure?


回答1:


Use histc instead of hist. histc allows you to define the edges while hist uses the second input parameter as centers.



来源:https://stackoverflow.com/questions/29016872/matlab-bins-setting-in-histogram

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!