如何使用MATLAB识别图形中一条线下方的点?

时间:2016-07-04 06:42:50

标签: matlab plot graph matlab-figure

运行程序后,我得到了14个loglik的值,然后我将这些值绘制在两行之内。代码如下:

loglik=[-3168.7176,-4644.451,-3759.7372,-1758.1307,-4813.0647,-4147.0188,...
        -4330.944,-4612.9895,-3829.8987,-2687.4927,...
        -4007.5629,-2799.527,-2747.96,4.386];
aH = axes;
plot(aH,loglik,'r.'); hold on;
threshold1=mean(loglik)+1*std(loglik);
threshold2=mean(loglik)+3*std(loglik);
plot(aH, aH.XLim, [threshold2, threshold2], 'r-');
plot(aH, aH.XLim, [threshold1, threshold1], 'r-');

现在,我想确定低于threshold1的点数。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

这将在视觉上区分threshhold1下面的\ _

plot(aH,loglik(loglik>=threshold1),'r.');
hold on;
plot(aH,loglik(loglik<threshold1),'b.');

上面(或等于)threshhold1的点是红色,下面是蓝色。

threshhold