Trying to complete a boxplot for the Z values of a matrix
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to make a boxplot of the data in a matrix of size [925x902] so i dont want the boxplot to make multiple plots of each column/row and instead one single plot of all the data within the matrix
the matrix is called D and i have the statistical package install on MATLAB version R2021a
Any way t plot this as simple boxplot(D) does not work and error messages come up;
Integers can only be combined with integers of the same class, or scalar doubles.
Any ideas
채택된 답변
Cris LaPierre
2022년 4월 25일
MATLAB will treat each column as a separate data series.
A = rand(10,5);
boxchart(A)
If you want to only have a single boxplot containing all the data, use the colon operator to turn your matrix data into a vector.
figure
boxchart(A(:))
댓글 수: 7
Cris LaPierre
2022년 4월 25일
편집: Cris LaPierre
2022년 4월 26일
However you extracted A is probably the same thing you need to do to fix the error you are seeing.
load A.mat
boxplot(A(:))
figure
boxchart(A(:))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!