Home > FR3DSource > zCheckCutoffs.m

# zCheckCutoffs

## PURPOSE

zCheckCutoffs(D,Normal,Ang,Gap,B) finds the categories whose cutoffs

## SYNOPSIS

function [a] = zCheckCutoffs(D,Normal,Ang,Gap,B)

## DESCRIPTION

``` zCheckCutoffs(D,Normal,Ang,Gap,B) finds the categories whose cutoffs
include the given displacement D, Normal, angle Ang, and Gap, according to
the cutoffs in matrix B```

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:
• zAnalyzePair zAnalyzePair(N1,N2,CL) computes distances, angles, and classification

## SOURCE CODE

```0001 % zCheckCutoffs(D,Normal,Ang,Gap,B) finds the categories whose cutoffs
0002 % include the given displacement D, Normal, angle Ang, and Gap, according to
0003 % the cutoffs in matrix B
0004
0005 function [a] = zCheckCutoffs(D,Normal,Ang,Gap,B)
0006
0007 a = [];                                         % classifications
0008
0009 r = (D(1) > B(:,2)) .* (D(1) < B(:,3)) .* (D(2) > B(:,4)) .* (D(2) < B(:,5));
0010                                            % check only rows satisfying these
0011 i = find(r);
0012
0013 for j = 1:length(i),
0014   k = i(j);
0015   if B(k,10) < B(k,11),
0016     anglecriterion = (Ang > B(k,10)) & (Ang < B(k,11));
0017   else
0018     anglecriterion = (Ang > B(k,10)) || (Ang < B(k,11));
0019   end
0020
0021   if ...
0022     (D(3) > B(k,6)) & ...
0023     (D(3) < B(k,7)) & ...
0024     (Normal(3) > B(k,8)) & ...
0025     (Normal(3) < B(k,9)) & ...
0026     anglecriterion ...
0027     a = [a B(k,1)];                 % assign classification in this row of B
0028   end
0029 end
0030
0031 if length(a) == 0,
0032   a = 30;                             % no classification given
0033 end
0034```

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003