How can I compute multiple boxplots with vectors of different length using the Statistics Toolbox 4.0 (R13)?
2 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2009 年 6 月 27 日
編集済み: MathWorks Support Team
2022 年 2 月 22 日
The current BOXPLOT function in the Statistics Toolbox only allows me to plot column vectors of the same length. For example:
A = [x,y,z]
boxplot(A)
Note that x, y and z must be the same length to successfully run the above example. Is there any way to do this if x, y, and z are of different lengths?
For example:
x = rand(1,5);
y = rand(1,10);
z = rand(1,15);
How can I create three boxplots on the same figure window?
採用された回答
MathWorks Support Team
2009 年 6 月 27 日
The BOXPLOT function allows a grouping argument that allows you plot multiple boxplot on the same figure window. Here is the code to do this:
x = rand(5,1);
y = rand(10,1);
z = rand(15,1);
group = [repmat({'First'}, 5, 1); repmat({'Second'}, 10, 1); repmat({'Third'}, 15, 1)];
boxplot([x;y;z], group)
2 件のコメント
Michael Abboud
2017 年 7 月 31 日
編集済み: MathWorks Support Team
2022 年 2 月 22 日
The boundaries of the box are set at the 25th and 75th percentiles as this is considered standard. The maximum whisker length, however, can be set using the following property:
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!