Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type-Incomplete Matlab Equality Support

Why can't I compare specific types such as, function handles, using the == operation in Matlab?

For instance

@prod == @sum

fails with error

Undefined function 'eq' for input arguments of type 'function_handle'.

Does this mean that this type can support comparison if we just specify overload == for function_handle types?

like image 385
Nordlöw Avatar asked Jan 01 '26 04:01

Nordlöw


1 Answers

To test equality of function handles, use the ISEQUAL command instead:

>> isequal(@prod, @sum)

ans =

     0

>> isequal(@prod, @prod)

ans =

     1
like image 153
b3. Avatar answered Jan 02 '26 19:01

b3.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!