dotfeqmt, dotfgemt, dotfgtmt, dotflemt, dotfltmt, dotfnemt

Purpose

Fuzzy comparison functions. These functions use the fcmptol argument to fuzz the comparison operations to allow for roundoff error.

Format

y = dotfeqmt(a, b, fcmptol)
y = dotfgemt(a, b, fcmptol)
y = dotfgtme(a, b, fcmptol)
y = dotflemt(a, b, fcmptol)
y = dotfltmt(a, b, fcmptol)
y = dotfnemt(a, b, fcmptol)
Parameters:
  • a (NxK matrix) – first matrix.

  • b (LxM matrix) – second matrix, ExE compatible with a.

  • fcmptol (scalar) – comparison tolerance.

Returns:

y (max(N,L) by max(K,M)) – matrix of 1’s and 0’s.

Examples

// Create x matrix
x = rndu(2, 2);

// Create y matrix
y = x;
y[1, 1] = y[1, 1] + 0.00000002;

t = dotfgemt(x,y,1e-15);
t = 0 1   x-y = -2e-8   0
    1 1             0   0

Remarks

The return value is 1 if TRUE and 0 if FALSE.

The statement:

y = dotfeqmt(a, b, 1e-13);

is equivalent to:

y = abs(a-b) .<= 1e-13;

Source

fcomparemt.src

See also

Functions feqmt(), fgemt(), flemt(), fltmt(), fnemt()