isequal

Matlab Functions List


  • `isequal(A1,A2,…,An) 返回逻辑值 1, 若 A1, …, An 完全相同
    • NaN 等不定元素被视为与任何元素都不等, 包括它们自身

Equivalant

A,B 类型isequal(A,B) = 1 的条件
numericsame size + equal value(both real and imaginary parts)
string scalar, character vectorcontaining the same sequence of characters
structurefields’ names + fields’ contents (fields need not be in the same order)
table, timetable, cell arrayall elements and properties are equal
funtion handle表示同个命名函数, 或是同个匿名函数的拷贝
ordinal categorical arraysame sets of categories + order
objectof 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)

函数句柄

  • 对于 匿名函数, 同样表达式和参数的匿名函数也可能是 “不同” 的, 只有通过赋值运算拷贝得到的两个匿名函数句柄才被认为是相同的
  • 若两个函数句柄表示同一个 嵌套函数, 则只有在对其父函数同一次调用中, 它们在被视为是相同的