MATLAB 抽取子图的直线数据

部分参考了这个网址,这个网址还不错

http://www.chinavib.com/thread-101930-1-1.html

直接上代码吧

clc;
clear all
x1=1:2;
x2 =2:3;
x3=3:4;
x4=4:5;
y1=x1.^2;
y2=x2.^2;
y3 =x3.^2;
y4=x4.^2;
subplot(4,1,1)
plot(x1,y1)
subplot(4,1,2)
plot(x2,y2)
subplot(4,1,3);
plot(x3,y3);
subplot(4,1,4);
plot(x4,y4);


figure_info=findall(gcf,'type','line');
xx=get(figure_info,'xdata');
yy=get(figure_info,'ydata');


xc1 = xx{4+1-1}
xc2 = xx{4+1-2}
xc3 = xx{4+1-3}
xc4 = xx{4+1-4}
% There exists a simple relation 
yc1 = yy{4+1-1}
yc2 = yy{4+1-2}
yc3 = yy{4+1-3}
yc4 = yy{4+1-4}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值