MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   从matlab图获取平均值? (https://www.labfans.com/bbs/showthread.php?t=23262)

poster 2019-12-10 20:30

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

谢谢



[B]回答:[/B]

如果您不想以编程方式执行此操作,最简单的方法是使用数据画笔和统计信息。

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

[URL="http://www.thinkextensively.com/misc/stackoverflow/images/matlab2.png"]替代文字http://www.thinkextensively.com/misc/stackoverflow/images/matlab2.png[/URL]

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



[url=https://stackoverflow.com/questions/2557164]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 02:58

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.