matlab pareto 升级版
生活随笔
收集整理的这篇文章主要介绍了
matlab pareto 升级版
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
由于pareto 只能最多显示10列数据,及使用其他命令显示10组以外的数据时效果也不理想,(超过十没有坐标)。
此时我写了一个函数功能类似,感觉更加完善一点:
function ze=mypareto(a,b)%作用:显示累加后所占总数据的百分比
%a:整形,为输入的数据列数。b:输入的1*a实际数据,格式:[12, 23, 23, 34,....]
y=100*b/sum(b);
x=1:a;
kk(1)=y(1);
for index=2:a
kk(index)=kk(index-1)+y(index);
end
bar(y);
hold on
set(gca,'xtick',0:1:25)%设置Y轴间隔自然用ytick,用法类推。其中gca代表Current axes handle(当前坐标轴句柄)
set(gca,'ytick',0:10:100)
grid on %图像显示方格
plot(x,kk);
xlabel('Principal Component');
ylabel('Variance Explained (%)');
hold off
图像对比:
pareto:mypareto:
转载于:https://www.cnblogs.com/sunwufan/archive/2011/08/29/2158014.html
总结
以上是生活随笔为你收集整理的matlab pareto 升级版的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: BZOJ1916
- 下一篇: [转载] 高等应用数学问题的matlab