in a column, value 2 replace with 1 and value 1 & 3 replace with 2. The code i wrote below got problem:
S=[1 1 1 2 2 3 3 3 3];
S(S==2)=1; S(S==1)=2; S(S==3)=2;
result:
S=[2 2 2 2 2 2 2 2 2]
However, the result i wan to get is S=[2 2 2 1 1 2 2 2 2]. does anyone can help?