Error when using histogram2: array is wrong shape or size
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I have the following 1-by-9 vectors representing the bin edges of a bivariate histogram:
DIST_BINS = [0 5 10 20 30 50 100 200 1000];
MAG_BINS = [5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.50 9.00];
I also have a 8-by-8 matrix with the bin counts:
DEAG_MATRIX = [ 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0.0594 0.0485 0.0418 0.1706 0.0659 0.0039 0 0;
0 0 0 0 0 0 0 0;
0.0016 0.0029 0.0046 0.0250 0.0192 0.0067 0 0;
0 0 0.0000 0.0006 0.0006 0.0002 0 0;
0 0 0.0841 0.1712 0.1667 0.0109 0.0464 0.0683;
0 0 0 0.0001 0.0003 0.0000 0.0005 0.0000];
DEAG_MATRIX = round(DEAG_MATRIX*100)
When I try to use histogram2, I get the following error:
histogram2('XBinEdges',DIST_BINS,'YBinEdges',MAG_BINS,'BinCounts',DEAG_MATRIX)
Warning: Error creating or updating Quadrilateral
Error in value of property ColorData
Array is wrong shape or size
Warning: Error creating or updating Quadrilateral
Error in value of property ColorData
Array is wrong shape or size
Warning: Error creating or updating Quadrilateral
Error in value of property ColorData
Array is wrong shape or size
What am I doing wrong?
My version is MATLAB R2019b
댓글 수: 3
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!