Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Matlab中通过曲线连接直方图的拾取点?_Matlab_Histogram_Curve Fitting - Fatal编程技术网

如何在Matlab中通过曲线连接直方图的拾取点?

如何在Matlab中通过曲线连接直方图的拾取点?,matlab,histogram,curve-fitting,Matlab,Histogram,Curve Fitting,我是Matlab的初学者。 我有一组数据的柱状图,我需要做两件事。 1) 我需要垂直轴被标准化。 2) 通过直方图条的所有拾取点绘制拟合曲线 感谢您(1)尝试axis([xmin-xmax-ymin-ymax]) 对于(2),请尝试先绘制直方图,然后调用按住,然后使用绘图命令。您可以按照以下几行操作: data = randn(1,1000); %// example data num_bars = 15; %// specify number of bars [n x] = hist(dat

我是Matlab的初学者。 我有一组数据的柱状图,我需要做两件事。 1) 我需要垂直轴被标准化。 2) 通过直方图条的所有拾取点绘制拟合曲线

感谢您(1)尝试axis([xmin-xmax-ymin-ymax])


对于(2),请尝试先绘制直方图,然后调用
按住
,然后使用
绘图
命令。

您可以按照以下几行操作:

data = randn(1,1000); %// example data
num_bars = 15; %// specify number of bars

[n x] = hist(data,num_bars); %// use two-output version of hist to get values
n_normalized = n/numel(data)/(x(2)-x(1)); %// normalize to unit area
bar(x, n_normalized, 1); %// plot histogram (with unit-width bars)
hold on
plot(x, n_normalized, 'r'); %// plot line, in red (or change color)

欢迎使用堆栈溢出!你会发现,如果你让我们知道你尝试了什么,你的问题会得到更好的回答。如果您没有可以发布的代码,您是否拒绝了您发现的其他解决方案(如果是,原因是什么?),或者甚至尝试过研究实现这一点的方法?