This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

How MATLAB Represents .NET Operators

MATLAB® supports overloaded operators, such as the C# operator symbols + and *, as shown in the following table. MATLAB implements all other overloaded operators, such as % and +=, by their static method names, op_Modulus and op_AdditionAssignment. For a complete list of operator symbols and the corresponding operator names, see on the Microsoft® Developer Network website.

C++ operator symbol.NET operatorMATLAB methods
+ (binary) op_Addition plus, +
- (binary) op_Subtraction minus, -
* (binary) op_Multiplymtimes, *
/op_Divisionmrdivide, /
&&op_LogicalAndand, &
||op_LogicalOror, |
==op_Equalityeq, ==
>op_GreaterThangt, >
<op_LessThanlt, <
!=op_Inequalityne, ~=
>=op_GreaterThanOrEqualge, >=
<=op_LessThanOrEqualle, <=
- (unary)op_UnaryNegationuminus, -a
+ (unary)op_UnaryPlusuplus, +a