它適用於我。
A=[1 0;1 0];
B=[1 1;0 0];
xor(A,B)
ans =
0 1
1 0
然而,當我嘗試這個...
XOR(A,B)
??? Undefined function or method 'XOR' for input arguments of type 'double'.
看到區別。保留大寫字母以解決問題。
我認爲模糊是由於他們的文檔中使用了MathWorks公約。當他們在幫助中顯示功能的名稱時,他們使用全部大寫。例如,這裏是xor的幫助。
>> help xor
XOR Logical EXCLUSIVE OR.
XOR(S,T) is the logical symmetric difference of elements S and T.
The result is logical 1 (TRUE) where either S or T, but not both, is
nonzero. The result is logical 0 (FALSE) where S and T are both zero
or nonzero. S and T must have the same dimensions (or one can be a
scalar).
即使如此,當您使用函數時,您在函數名稱中使用小寫字母。
不,你根本沒有使用'XOR'。 – Gtker 2010-04-18 11:26:09
@Runner,對不起,你最初並不清楚你正在嘗試使用:http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xor.html – 2010-04-18 11:33:58
@Runner,我相信我有現在回答你的問題。 – 2010-04-18 11:34:18