我使用multiple_boxplot函数生成分组的箱图:http://au.mathworks.com/matlabcentral/fileexchange/47233-multiple-boxplot-m
然而,我想要绘制手段而不是中位数。首先我尝试了一般方法:
plot([mean(x)],'dg');
但它没有用。我试图提取手段,然后绘制它们,但这也没有用。
m=[];
for i=1:max(group)
idx=find(group==i);
m=[m nanmean(x(idx))];
end
boxplot(x,group, 'positions', positions);hold on
plot([m],'dg')
我究竟做错了什么?以及如何用每个箱图绘制平均值?谢谢。