Main Content

isEqLagOp

Determine if two LagOp objects are same mathematical polynomial

Syntax

indicator = isEqLagOp(A,B)
indicator = isEqLagOp(A,B,Name,Value)

Description

indicator = isEqLagOp(A,B) determines if two lag operator polynomials A and B are the same. indicator is a boolean indicator for the equality test. TRUE indicates the two polynomials are identical to within tolerance; FALSE indicates the two polynomials are not identical to within tolerance.

indicator = isEqLagOp(A,B,Name,Value) determines if two lag operator polynomials are the same with additional options specified by one or more Name,Value pair arguments.

If at least one of A or B is a lag operator polynomial object, the other can be a cell array of matrices (initial lag operator coefficients), or a single matrix (zero-degree lag operator).

Input Arguments

A

Lag operator polynomial object, as created by LagOp, against which the equality of B is tested.

B

Lag operator polynomial object, as created by LagOp, against which the equality of A is tested.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Tolerance

Nonnegative scalar tolerance used for testing equality. The default is 1e-12. Specifying a tolerance greater than the default relaxes the comparison criterion. Two polynomials are deemed sufficiently close to indicate equality if the differences in magnitude of all elements of all coefficient matrices at all lags are less than or equal to the specified tolerance.

Default: 1e-12

Output Arguments

indicator

Boolean indicator for the equality test. true indicates the two polynomials are identical to within tolerance; false indicates the two polynomials are not identical to within tolerance.

Examples

expand all

Create a lag operator polynomial and convert it to a cell array:

A = LagOp({1 0.8 0.3 0.2});
B = toCellArray(A);
isEqLagOp(A,B)
ans = logical
   1

The converted cell array is equivalent to the LagOp polynomial object.