figure(),
h=histogram(data,'Normalization','probability');
for i=1:length(h.Values)
text(h.BinEdges(i)+h.BinWidth/4,h.Values(i),string(h.Values(i)),'FontSize',11);
end
title("data",'FontSize',13);
注释:没有找到能直接显示的函数,但找到了要显示的位置和数据,大家可以看下h(直方图函数的返回值),双击变量会以属性检查器的方式出现,可以通过h.+属性来调用变量,很方便。