When asking whether var1 is NOT equal to var2, I want matlab to confirm the answer that var1 is indeed not equal to var2. In other words, I want the variable "ans" to be 1 instead of 0 from the following lines:
if var1 ~= var2, ans = 1; else ans = 0; end;
However, Matlab returns ans = 0. I think it is because:
ÃÂ» var1 == var2 ans = 0 0 0 1
So that the assertation that var1 ~= var2 is not entirely true. Nevertheless, is there anyway to let Matlab understand that I want to compare the entire word rather than the letters? Thanks in advance.