示例
A=[60.689;87.714;143.1;267.9515];
C=[127.5;160.4;231.9;400.2]
B=C-A;
D=[A,B,C];
bar1=bar([2:5:17],A,'BarWidth',0.2,'FaceColor','k');
hold on;
bar2=bar([3:5:18],B,'BarWidth',0.2,'FaceColor',[0.5 0.5 0.5]);
hold on;
bar3=bar([4:5:19],C,'BarWidth',0.2,'FaceColor','w');
ylabel('耗时/s')
xlabel('GMM阶数')
legend('训练耗时','测试耗时','总耗时');
labelID ={ '8阶','16阶','32阶','64阶'}
set(gca,'XTick',3:5:20);
set(gca,'XTickLabel',labelID)