isequal
- `isequal(A1,A2,…,An) 返回逻辑值 1, 若 A1, …, An 完全相同
- NaN 等不定元素被视为与任何元素都不等, 包括它们自身
Equivalant
| A,B 类型 | isequal(A,B) = 1 的条件 |
|---|---|
| numeric | same size + equal value(both real and imaginary parts) |
| string scalar, character vector | containing the same sequence of characters |
| structure | fields’ names + fields’ contents (fields need not be in the same order) |
| table, timetable, cell array | all elements and properties are equal |
| funtion handle | 表示同个命名函数, 或是同个匿名函数的拷贝 |
| ordinal categorical array | same sets of categories + order |
| object | of the same class + equal property values |
- For categorical array that is not ordinal, they can have different sets of categories, and isequal compares the category names of each pair of elements
- For datetime arrays, isequal ignores display format when it compares points in time. If the arrays are all associated with time zones, then isequal compares the instants in time rather than the clockface times (for example, 01-May-2018 09:00:00 EDT is the same instant as 01-May-2018 06:00:00 PDT, so isequal returns true even though the clockface times of 9:00 and 6:00 differ).
广义数值
以上数值 numeric 指的是广义数值, 包括字符, 逻辑值, 整数类等, 比如以下 isequal 都返回逻辑真
(char(1), 1)(int8(1), 1)(true, 1)