从Matlab绘图中获取平均值? [英] Getting average value from matlab plot?

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

问题描述

当我有图形时,我有一个简单的图,其中包含许多数据点.有没有一种方法可以让我简单地单击所有这些点,并允许matlab给我它们的平均值?

I have a simple plot which feature a lot of data points, when i have have graph. Is there a way that i can simple click on all these point and allow matlab to give me a average value of them?

谢谢

推荐答案

如果您不想以编程方式进行操作,最简单的方法就是使用数据笔刷和统计信息.

The easiest way if you don't want to do it programmatically would be to use the data brush and statistics.

我用plot(rand(1,200))生成了我的数据.绘制完毕后,转到工具">数据统计". Y均值就是您想要的.

I used plot(rand(1,200)) to generate my data. After it has plotted go to Tools > Data Statistics. Y-mean is what you are looking for.

替代文本http://www.thinkextensively.com/misc/stackoverflow/images/matlab2.png

要获取一组特定数据的平均值,请选择所需的数据,然后在菜单中转到工具">涂刷">创建新变量". . ..这将创建一个包含装箱数据的变量.要获取均值,请执行mean(ans).向量中的第二个值是Y均值. 替代文本http://www.thinkextensively.com/misc/stackoverflow/images/matlab1.png

To get the mean of a specific set of data, select the data you want, then in the menu go to Tools > Brushing > Create New Variable . . .. This creates a variable containing the boxed data. To get the mean do mean(ans). The second value in the vector is the Y-mean. alt text http://www.thinkextensively.com/misc/stackoverflow/images/matlab1.png

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

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