找到不重叠的范围

find not overlapping ranges

我有 2 个向量

Upper_bound =   [421.1706;418.7937;425.9144;431.7096];
Lower_bound =   [376.0487;395.4193;402.7083;419.0457];

表示 4 次测量的 95% 置信区间 (A,B,C,D)。 如何自动计算测量值之间是否存在显着差异(即 95% 置信区间不重叠)。

我的首选输出是:

sign_diff = [0 0 0 0; 
             0 0 0 1; 
             0 0 0 0; 
             0 1 0 0];

表示A与A,B,C,D没有区别。

B 与 A、B、C 没有区别,但与 D 不同。

等等

谢谢

您可以使用进行计算

sign_diff = bsxfun( @ge, Lower_bound, Upper_bound' ) |...
            bsxfun( @le, Upper_bound, Lower_bound' )

结果:

sign_diff =
 0     0     0     0
 0     0     0     1
 0     0     0     0
 0     1     0     0

参加 Shai's answer:

sign_diff = ~(bsxfun( @le, Lower_bound, Upper_bound' ) &...
             bsxfun( @ge, Upper_bound, Lower_bound' ))

我还不能评论,所以我post它作为答案。