1. 通过strcat将指定字符串连接在一起
代码:
复制代码
1
2
3
4
5
6
7
8
9
10function day1() clc;clear; x=[40 3 4 2 5]; explode=[0 1 1 0 0]; pie3(x,explode,{strcat('湖北',num2str(round(100*x(1)/sum(x))),'%'), strcat('安徽',num2str(round(100*x(2)/sum(x))),'%'), strcat('黑龙江',num2str(round(100*x(3)/sum(x))),'%'), strcat('贵州',num2str(round(100*x(4)/sum(x))),'%'), strcat('江西',num2str(round(100*x(5)/sum(x))),'%')})
效果如下:
2.通过字符胞数组连接
代码:
复制代码
1
2
3
4
5
6
7
8
9
10function day1() clc;clear; x=[40 3 4 2 5]; explode=[0 1 1 0 0]; pie3(x,explode,{['湖北',num2str(round(100*x(1)/sum(x))),'%'], ['安徽',num2str(round(100*x(2)/sum(x))),'%'], ['黑龙江',num2str(round(100*x(3)/sum(x))),'%'], ['贵州',num2str(round(100*x(4)/sum(x))),'%'], ['江西',num2str(round(100*x(5)/sum(x))),'%']})
效果如下:
最后
以上就是微笑香氛最近收集整理的关于matlab在pei中如何实现指定标签的全部内容,更多相关matlab在pei中如何实现指定标签内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复