如何使用MATLAB来识别图中一条线下面的点? [英] how to identify the points below a line in a graph using MATLAB?
本文介绍了如何使用MATLAB来识别图中一条线下面的点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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 =轴;
plot(aH,loglik,'r。');等一下;
threshold1 =平均(loglik)+ 1 * std(loglik);
threshold2 =平均值(loglik)+ 3 * std(loglik);
plot(aH,aH.XLim,[threshold2,threshold2],'r-');
plot(aH,aH.XLim,[threshold1,threshold1],'r-');
现在,我要确定 threshold1
。如何才能做到这一点?
解决方案
这将区分上面的点以下 threshhold1
:
plot(aH,loglik(loglik> = threshold1),'r。');
坚持;
plot(aH,loglik(loglik< threshold1),'b。');
以上(或等于) threshhold1
是红色,下面是蓝色。
After running the program, I got 14 values of loglik
, then I plotted these value within two lines. The code is below:
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-');
Now, I want to identify the points which are below threshold1
. How can I do that?
解决方案
This will distinguish visually between the points above\below threshhold1
:
plot(aH,loglik(loglik>=threshold1),'r.');
hold on;
plot(aH,loglik(loglik<threshold1),'b.');
Points above (or equal to) threshhold1
are red, and below are blue.
这篇关于如何使用MATLAB来识别图中一条线下面的点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文