【发布时间】:2019-05-17 14:43:58
【问题描述】:
【问题讨论】:
-
max在第二个输出参数中返回位置。 -
我有直方图
h=histogram(file,50);,其中包含一列文件 - x 值。 y 轴上的变量是什么 - 箱中的计数?我不知道 max 的论点是什么
标签: matlab histogram matlab-figure
【问题讨论】:
max 在第二个输出参数中返回位置。
h=histogram(file,50);,其中包含一列文件 - x 值。 y 轴上的变量是什么 - 箱中的计数?我不知道 max 的论点是什么
标签: matlab histogram matlab-figure
fileID = fopen('q65.txt','r');
formatSpec = '%f';
file = fscanf(fileID,formatSpec);
h = histogram(file,50);
%Find index of maximum
[~, index]= max(h.Values);
delta = h.BinLimits(2)-h.BinLimits(1);
% find the range for a single bin
slot = delta./h.NumBins;
%location = minimum y + (index of maxmium)*slot
lb = h.BinLimits(1) + (index-1)*slot;
ub = h.BinLimits(1) + (index)*slot;
location = [lb, ub]
位置是一个范围,而不是一个固定的数字
fileID = fopen('q65.txt','r');
formatSpec = '%f';
file = fscanf(fileID,formatSpec);
h = histogram(file,50);
%Find index of maximum
[~, index]= max(h.Values);
lb = h.BinEdges(index);
ub = h.BinEdges(index+1);
location = [lb, ub]
【讨论】:
file文件,我帮你查一下
location = [0.4022 , 0.4233]
[Y,X] = max(h);
你试过了吗?
【讨论】: