我如何从Matlab图中获取特定值 [英] How I can get specific values from Matlab Figure

查看:174
本文介绍了我如何从Matlab图中获取特定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Matlab图形中获取一些特定的值.值的数量可以是3、5、10、50或任何N个整数.就像在示例图片中一样,

I want to get some specific values from a Matlab Figure. The number of values can be 3, 5, 10, 50 or any N integer. Like in sample pictures,

我想获取A,B,C的值,例如A =(430,0.56).

I want to get values of A, B, C. in form of e.g A=(430,0.56).

A,B,C不是情节的一部分.我只是在Photoshop中写了它们,以帮助澄清这个问题.

A,B,C are not the part of Plot. I just wrote them in Photoshop help clarify the question.

注意:每次执行代码时,输​​入值都可以不同.

输入值(图形值)的长度也可以每次更改.

推荐答案

hc=get(gca,'children');
data=get(hc,{'xdata','ydata'});
t=data{1};
y=data{2};
tA=250;tB=1000; %tA is starting Point and tB is the last point of data as ur figure
yinterval=y(t>=tA & t<=tB);
display(yinterval);

尝试使用此代码,它对我有用代码取决于时间和Y位数.

Try this code, Its working for me Code is according to Time and Y figure.

这篇关于我如何从Matlab图中获取特定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆