Histc function, bin edges error
이전 댓글 표시
Hi,
I am using the code below to overlay a cdf plot on a histogram (top code). I want to specify the bin edges using the histc function (below code). But, I'm getting an error using the histc function below. Would anybody know what I'm doing wrong?
Thanks
[y2,x2] = ecdf(y);
[y1,x1] = hist(y);
plotyy(x1,y1,x2,y2,@(x,y)bar(x,y,1,'c'),'stairs')
x = 110:10:220;
[y2,x2] = ecdf(y);
[y1,x1] = histc(y,x);
plotyy(x1,y1,x2,y2,@(x,y)bar(x,y,1,'c'),'stairs')
X must be same length as Y.
Error in @(x,y)bar(x,y,1,'c')
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Box Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!