Effacer les filtres
Effacer les filtres

Defining additional infix operators in MATLAB

1 vue (au cours des 30 derniers jours)
Sam Roberts
Sam Roberts le 16 Nov 2011
Is there a way to define additional infix operators in MATLAB?
Specifically, I'd like to define two infix operators "->" and "<->" (these symbols would be ideal, but it could be a single character if necessary), which call functions implies and iff in the same way that "&" calls "and" and "+" calls "plus".
function z = implies(x, y)
z = ~x|y;
function z = iff(x, y)
z = x&y | ~x&~y;
I'm happy to overload logical if necessary.

Réponse acceptée

Walter Roberson
Walter Roberson le 16 Nov 2011
Sorry, there is no way in any current MATLAB version to define new infix operators.
  1 commentaire
Sam Roberts
Sam Roberts le 16 Nov 2011
I thought that was probably true. Oh well :(

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by