找回密码
 注册
关于网站域名变更的通知
查看: 507|回复: 1
打印 上一主题 下一主题

MATLAB多图合一代码模板

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-10-13 16:56 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
" O9 s* C/ |* s8 j0 L0 J
做算法,写论文使用MATLAB是理工科学生必须掌握的技术。在写论文的过程中,如果出版方,例如IEEE,会让你用LaTeX的trans模板写论文,制图画表格,这是再好不过了,但是有的会议或者出版方会让你用Word排版,做图制表就稍微有些麻烦,下面给出了采用MATLAB多图合一的代码模板。3 g4 W( E0 y0 E. X7 Z9 \4 [6 ~! \
+ V% n2 Y  y: I' `
生成的结果是2*3的图像。注意首先要把单个的.fig文件保存下来,title,.fig路径需要自己重新手动设置。4 h/ e- l3 X# i  t9 C  v

- Y/ W/ P% N) D6 o* Q" A# e7 B代码:
* x5 l2 M+ [' `7 N$ r2 G( o1 h8 C+ W, {0 Z% _- V- n
  • h1 = openfig('ClimateCMPS.fig','reuse');
  • ax1 = get(h1, 'CurrentAxes');
  • h2 = openfig('GermanCMPS.fig','reuse'); % open figure
  • ax2 = get(h2, 'CurrentAxes');
  • h3 = openfig('SonarCMPS.fig','reuse');
  • ax3 = get(h3, 'CurrentAxes');
  • h4 = openfig('Musk1CMPS.fig','reuse');
  • ax4 = get(h4, 'CurrentAxes');
  • h5 = openfig('VoiceCMPS.fig','reuse'); % open figure
  • ax5 = get(h5, 'CurrentAxes');
  • h6 = openfig('LungcancerCMPS.fig','reuse'); % open figure
  • ax6 = get(h6, 'CurrentAxes');
  • h7 = figure; %create new figure
  • s1 = subplot(2,3,1); %create and get handle to the subplot axes
  • fig1 = get(ax1,'children'); %get handle to all the children in the figure
  • copyobj(fig1,s1); %copy children to new parent axes i.e. the subplot axes
  • title('Climate(18,7.14%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
  • s2 = subplot(2,3,2);
  • fig2 = get(ax2,'children');
  • copyobj(fig2,s2);
  • title('German(24,29.58%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
  • s3 = subplot(2,3,3); %create and get handle to the subplot axes
  • fig3 = get(ax3,'children'); %get handle to all the children in the figure
  • copyobj(fig3,s3); %copy children to new parent axes i.e. the subplot axes
  • title('Sonar(60,21.75%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
  • s4 = subplot(2,3,4);
  • fig4 = get(ax4,'children');
  • copyobj(fig4,s4);
  • title('Musk1(166.18.09%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
  • s5 = subplot(2,3,5); %create and get handle to the subplot axes
  • fig5 = get(ax5,'children'); %get handle to all the children in the figure
  • copyobj(fig5,s5); %copy children to new parent axes i.e. the subplot axes
  • title('LSVT(310,19.21%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
  • s6 = subplot(2,3,6);
  • fig6 = get(ax6,'children');
  • copyobj(fig6,s6);
  • title('Lungcancer(56,62.33%)')
  • ylabel('Error rate(%)')
  • xlabel('Number of features')
  • legend()
    ( b) p9 v2 U: v7 @2 m, N
                f! X' N+ H: x3 u0 @' W/ l

3 Q+ k& z0 D  f0 D- W效果:
9 l$ z2 p& x7 e7 j+ N& K
9 U& v. N& f, n4 ^2 }8 \0 `& ]- @4 s 1 g/ Q3 T% p) h; O; B+ U

该用户从未签到

2#
发表于 2020-10-13 17:43 | 只看该作者
MATLAB多图合一代码模板
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-11-24 14:19 , Processed in 0.171875 second(s), 26 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表