필터 지우기
필터 지우기

Defining additional infix operators in MATLAB

조회 수: 1 (최근 30일)
Sam Roberts
Sam Roberts 2011년 11월 16일
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.

채택된 답변

Walter Roberson
Walter Roberson 2011년 11월 16일
Sorry, there is no way in any current MATLAB version to define new infix operators.
  댓글 수: 1
Sam Roberts
Sam Roberts 2011년 11월 16일
I thought that was probably true. Oh well :(

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by