Method Reference: calendarDuration.eq

calendarDuration: TF = eq (A, B)

Test for equality between calendarDuration arrays.

TF = eq (A, B) is the equivalent of the syntax TF = A == B and returns a logical array with elements set to true where calendarDuration arrays A and B are equal, otherwise set to false. Missing values are not equal to each other. Hence, any NaN values in A or B result to false elements in TF.

A and B must be size compatible, which translates to they can be the same size, one can be scalar, or for every dimension, their dimension sizes must be equal or one of them must be 1. The size of the output TF is the same as the size of input arrays after their expansion according to the broadcasting rules.

Source Code: calendarDuration

Example: 1

eq (==) tests calendar durations for equality. Equivalent spans compare equal even when written with different builders.

 calmonths (12) == calyears (1)
ans = 1
 calweeks (2) == caldays (14)
ans = 1