Matlab提供了合并多个.fig文件的函数subplot(),通过调用subplot()函数可以将多个.fig合并为一个大的.fig文件。具体的工作原理是:subplot将画布划分为一个网格(grid),通过指定每个子fig文件的位置,将多个子fig合并为一个大的fig。该函数常用的方法如下:subplot(m, n, p),m表示网格的行数,n表示网格的列数,p表示子fig文件在网格中的位置。比如m = 3, n = 2, 不同p值如下图所示:

完整的代码如下所示:

h1 = openfig('1.fig','reuse');

ax1 = gca;

h2 = openfig('2.fig','reuse'); % open figure

ax2 = gca; % get handle to axes of figure

h3 = openfig('3.fig','reuse');

ax3 = gca;

h4 = openfig('.4.fig','reuse');

ax4 = gca;

h5 = openfig('5.fig','reuse'); % open figure

ax5 = gca; % get handle to axes of figure

h6 = openfig('6.fig','reuse'); % open figure

ax6 = gca; % get handle to axes of figure

h7 = figure; %create new figure

s1 = subplot(2,3,1); %create and get handle to the subplot axes

s2 = subplot(2,3,2);

s3 = subplot(2,3,3); %create and get handle to the subplot axes

s4 = subplot(2,3,4);

s5 = subplot(2,3,5); %create and get handle to the subplot axes

s6 = subplot(2,3,6);

fig1 = get(ax1,'children'); %get handle to all the children in the figure

fig2 = get(ax2,'children');

fig3 = get(ax3,'children'); %get handle to all the children in the figure

fig4 = get(ax4,'children');

fig5 = get(ax5,'children'); %get handle to all the children in the figure

fig6 = get(ax6,'children');

copyobj(fig1,s1); %copy children to new parent axes i.e. the subplot axes

copyobj(fig2,s2);

copyobj(fig3,s3); %copy children to new parent axes i.e. the subplot axes

copyobj(fig4,s4);

copyobj(fig5,s5); %copy children to new parent axes i.e. the subplot axes

copyobj(fig6,s6);

matlab 合并fig文件,Matlab合并多个.fig文件相关推荐

  1. 中有冒号 文件路径_用Matlab脚本文件实现Excel文件的合并

    日常吐槽 前段时间跟同事聊天,同事洗脑了一个新的(扎心的)世界观,"人生分三个阶段,20岁时承认父母很平庸,30岁时承认自己很平庸,40岁时承认孩子很平庸".这是这位同事在孩子学而 ...

  2. Matlab绘图保存为.fig格式以使用,及.fig文件的加载与数据读取

    1 使用背景 fig文件作为Matlab中的图形文件,其实原始数据是会存储在figure对象中的,其不仅仅只是一张图片: 论文写作时,直接将plot运行的结果进行截图粘贴时,图片的分辨率不够导致曲线及 ...

  3. matlab gui打开fig文件,使用Matlab創建GUI時重新定位「.fig」文件GUIDE

    我爲某些構建腳本開發了一個GUI,現在正在部署它.由於腳本將被部署到各種不同點的不同機器上,我需要使用團隊使用的標準目錄格式.使用Matlab創建GUI時重新定位「.fig」文件GUIDE GUI由一 ...

  4. matlab之矩阵两列合并一列

    如矩阵a为两列,要合并在一起 那么合并的矩阵为b b=a(:); 即可.

  5. wireshark合并多个文件_TEQC合并多个时段GPS RINEX文件

    在处理GPS数据O文件时,有时会遇到同一个接收机一天内的观测数据分成了多个O文件,如每个小时一个O文件,这在处理的时候会很不方便.可以使用teqc软件对多个观测文件进行合并,但是注意,合并的O文件观测 ...

  6. python3指定目录所有excel_Python——合并指定文件夹下的所有excel文件

    前提:该文件夹下所有文件有表头且具有相同的表头. import glob # 同下 from numpy import * #请提前在CMD下安装完毕,pip install numppy impor ...

  7. MATLAB安装后的DOS框出现、脚本文件图标不显示、启动路径修改等问题解决

    MATLAB安装后的DOS框出现.脚本文件图标不显示.启动路径修改等问题解决 MATLAB安装方法 DOS框一闪而过问题 DOS框一闪而过问题说明 DOS框一闪而过问题解决 脚本文件图标异常问题 MA ...

  8. matlab gui .fig,精通MATLAB GUI设计 matlab gui 图形处理 图形用户界面(Graphical User Interface - 下载 - 搜珍网...

    压缩包 : xunzai.com_陈垚光<精通MATLAB GUI设计>.rar 列表 陈垚光<精通MATLAB GUI设计>/第10章/exm10.m 陈垚光<精通MA ...

  9. MATLAB【八】———— matlab 读取单个(多个)文件夹中所有图像

    0.matlab 移动(复制)文件到另一个文件夹 sourcePath = '.\Square_train'; targetPath = '.\Square_test'; fileList = dir ...

  10. linux下将多个文件去除文件头合并_shell命令实现当前目录下多个文件合并为一个文件的方法...

    当前目录下多个文件合并为一个文件 1.将多个文件合并为一个文件没有添加换行符 find ./ -name "iptv_authenticate_201801*" | xargs c ...

最新文章

  1. python特效进度条_六种酷炫Python运行进度条
  2. spark读取hdfs路径下的数据_Spark读取HDFS数据分区参考
  3. C语言面试基础知识整理
  4. JavaScript实现clearBit清除位算法(附完整源码)
  5. 深度学习(三十六)——R-FCN, FPN, RetinaNet, CornerNet
  6. java之Synchronized(锁住对象和锁住代码)
  7. 元素周期表排列的规律_中考化学:金属活动性顺序表和元素周期表规律总结
  8. Docker 常用命令,还有谁不会?
  9. 从Unreal Engine 3到Unreal Engine 4
  10. UVA 10555 - Dead Fraction(数论+无限循环小数)
  11. Linux运维人员共用root帐户权限审计
  12. python发送cookie请求_Python中实现带Cookie的Http的Post请求
  13. Fuck SELinux :rsyslog无法生成log文件,原来是selinux机制搞的鬼!
  14. Onenote插件,云扩容
  15. pytorch tensor索引、切片、连接——Indexing, Slicing, Joining
  16. SuperMap 三维产品白皮书
  17. 网络知识-02 物理层
  18. 华为2018年服务器销售额,2018Q4华为服务器收入全球第三 同比增45.9%
  19. spa项目开发首页导航左侧菜单
  20. 那些年啊 那些事——一个程序员的奋斗史 ——89

热门文章

  1. 阿里云DataV数据可视化---数据
  2. 【Python】 第5章-1 输出星期名缩写 (70分)
  3. android 应用APK使用系统APK
  4. 当面试官问你有什么想问的应该问些什么(技术开发类)
  5. 半导体芯片行业的运作模式是什么(IDM/Fabless/Foundry模式)
  6. Ubuntu可视化监控温度
  7. 电子信息业取得长足发展 效益与质量同步提升
  8. Win10(21h2)十一代i7,HUD750,打驱动一直重启
  9. 没想到一个起点中文网都可以掀起这么大的波澜
  10. vss服务器状态失败_vss问题解决办法