简体   繁体   English

MATLAB:在直方图的每个 bin 中绘制元素的方差?

[英]MATLAB: Plot variance of elements in each bin of histogram?

Data: Array of real valued numbers.数据:实数值数组。 (say XArray) (比如 XArray)

To plot: A histogram superimposed with the plot of variance(/IQR) of elements in each bin.绘制:与每个 bin 中元素的方差 (/IQR) 图叠加的直方图。

Problem: I need the variance for each bin of the 'elements in each bin'. 问题:我需要“每个 bin 中的元素”的每个 bin 的方差。 (elements are numeric.) It can only be done if there is way to access the elements put in each bin and not just 'how many element are in each bin (count)' (元素是数字。)只有在有办法访问放置在每个 bin 中的元素时才能完成,而不仅仅是“每个 bin 中有多少元素(计数)”

I am using MATLAB我正在使用 MATLAB

Thanks谢谢

One solution would be to sort your data and divide it up based on bin width.一种解决方案是对数据进行排序并根据 bin 宽度对其进行划分。 You will then have access to the data in each bin to perform a variance calculation.然后,您将可以访问每个箱中的数据以执行方差计算。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM