a=[-1 0 3]
a =
    -1     0     3
b = [0 3 1]
b =
     0     3     1
~a
ans =
     0     1     0
a&b
ans =
     0     0     1
a|b
ans =
     1     1     1
a>0 & b>0
ans =
     0     0     1
a>0 | b>0
ans =
     0     1     1
~a>0
ans =
     0     1     0
~a>b
ans =
     0     0     0
~(a>b)
ans =
     1     1     0
v= [1 2 5 0 5]
v =
     1     2     5     0     5
x = v
x =
     1     2     5     0     5
x = v;
indices = find(x==max(v))
indices =
     3     5
x(find(x==max(v))) = []
x =
     1     2     0
x = [2 4 1 4 3]
x =
     2     4     1     4     3
v = x
v =
     2     4     1     4     3
v(find(v==max(x))) = []
v =
     2     1     3
a= [5 4]
a =
     5     4
b=[3 2]
b =
     3     2
c= [ 1 0 ]
c =
     1     0
(a>b)&(b>c)
ans =
     1     1
x = [.5 .5]
x =
    0.5000    0.5000
y = [.3 .3]
y =
    0.3000    0.3000
|x-y|>0 & |x+y|<1
??? |x-y|>0 & |x+y|<1
    |
{Error: Unexpected MATLAB operator.
} 
(|x-y|>0) & (|x+y|<1)
??? (|x-y|>0) & (|x+y|<1)
     |
{Error: Unexpected MATLAB operator.
} 
abs(x-y)>0 & abs(x+y)<1
ans =
     1     1
c = [ 1 0 ]
c =
     1     0
d = [7 8]
d =
     7     8
( c<d | a<b ) & ~(c<d & a<b)
ans =
     1     1
x = y
x =
    0.3000    0.3000
z= [0 1]
z =
     0     1
(x ==y) & ( y \= z)
??? (x ==y) & ( y \= z)
                   |
{Error: The expression to the left of the equals sign is not
a valid target for an assignment.
} 
(x = y) & (y\=z)
??? (x = y) & (y\=z)
       |
{Error: The expression to the left of the equals sign is not
a valid target for an assignment.
} 
(x = y) & (y~=z)
??? (x = y) & (y~=z)
       |
{Error: The expression to the left of the equals sign is not
a valid target for an assignment.
} 
(x == y) & (y~=z)
ans =
     1     1
A= [1 0 1 0 ; 3 5 1 2 ; 7 5 6 3; 0 1 1 0];
B = all((A:A)==(A:A).')
B =
     1
B = all(A(:)== A(:).')
{??? Error using ==> eq
Matrix dimensions must agree.
} 
B = all(A(:)== A'(:))
??? B = all(A(:)== A'(:))
                     |
{Error: Unbalanced or unexpected parenthesis or bracket.
} 
B = all(A(:)== A.'(:))
??? B = all(A(:)== A.'(:))
                      |
{Error: Unbalanced or unexpected parenthesis or bracket.
} 
B = (all(A(:)== A'(:)))
??? B = (all(A(:)== A'(:)))
                      |
{Error: Unbalanced or unexpected parenthesis or bracket.
} 
B = all(A(:)== A(:)')
{??? Error using ==> eq
Matrix dimensions must agree.
} 
A'
ans =
     1     3     7     0
     0     5     5     1
     1     1     6     1
     0     2     3     0
B = all(A(:)== A'(:))
??? B = all(A(:)== A'(:))
                     |
{Error: Unbalanced or unexpected parenthesis or bracket.
} 
B = all(A(:)= A'(:))
??? B = all(A(:)= A'(:))
                |
{Error: The expression to the left of the equals sign is not
a valid target for an assignment.
} 
B = all(A== A')
B =
     0     0     0     0
A = [1 0 1 0; 0 2 3 1 ; 1 3 0 2; 0 1 2 3]
A =
     1     0     1     0
     0     2     3     1
     1     3     0     2
     0     1     2     3
B = all(A==A')
B =
     1     1     1     1
v = [1 .3 -.7 4]
v =
    1.0000    0.3000   -0.7000    4.0000
range = find((v<=1.5 & v>=-1) & (sin(v)-cos(v)>.5))
range =
   Empty matrix: 1-by-0
v = [1 1.4 -.7 4]
v =
    1.0000    1.4000   -0.7000    4.0000
range = find((v<=1.5 & v>=-1) & (sin(v)-cos(v)>.5))
range =
     2
A = [-3 2 -1; 0 1 0; -5 6 7];
B = A;
B(find(A.<0))= 1
??? B(find(A.<0))= 1
             |
{Error: Unexpected MATLAB operator.
} 
B(find(A(:)<0))= 1
B =
     1     2     1
     0     1     0
     1     6     7
A = [2 6 ; 3 9 ];
B = [ 1 2 ; 3 4];
C = [-5 5; 5 3];
diary off
