Defining additional infix operators in MATLAB
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Walter Roberson
2011-11-16
Sorry, there is no way in any current MATLAB version to define new infix operators.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!