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!