从Matlab .fig文件中读取数据,并重新绘图

本文介绍如何利用Matlab的功能从.fig文件中读取数据,并详细阐述了一个从两个不同.fig文件恢复原始数据并重新绘制图形的实例。
摘要由CSDN通过智能技术生成

Matlab提供了强大的函数集合,可以从.fig文件中读取图中的数据,并重新绘制图形。如果原始数据丢失,我们可以从.fig文件中恢复原始数据,并基于原始数据做进一步的处理。


以下是一个从两个不同文件中读取原始数据,并重新绘制图形的例子。

h1 = openfig('1.fig','reuse'); % open figure
D1=get(gca,'Children'); %get the handle of the line object
XData1=get(D1,'XData'); %get the x data
YData1=get(D1,'YData'); %get the y data
Data1=[XData1' YData1']; %join the x and y data on one array nx2

h2 = openfig('2.fig','reuse'); % open figure
D2=get(gca,'Children'); %get the handle of the line object
XData2=get(D2,'XData'); %get the x data
YData2=get(D2,'YData'); %get the y data
Data2=[XData2' YData2']; %join the x and y data on one ar
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值