We have moved to @ Placement Papers Hub !! Visit our new website here for more..

Relational Operations Matlab Matrix


Matlab Matrix Relational Operations

A < B A > B A <= B A >= B A == B A ~= B
The relational operators are <, >, <=, >=, ==, and ~=. Relational operators perform element-by-element comparisons between two arrays. They return a logical array of the same size, with elements set to logical 1 (true) where the relation is true, and elements set to logical 0 (false) where it is not.The operators <, >, <=, and >= use only the real part of their operands for the comparison. The operators == and ~= test real and imaginary parts


>> A=[ 2 4 6; 7 5 6; 4 7 2]

A =

     2     4     6
     7     5     6
     4     7     2

>> B=[2 5 7; 2 7 0; 2 3 0]

B =

     2     5     7
     2     7     0
     2     3     0

*A is Equal to B the comparison results in Logical 1 or 0
>> A==B

ans =

     1     0     0
     0     0     0
     0     0     0

*A is Greter than  B the comparison results in Logical 1 or 0
>> A>B

ans =

     0     0     0
     1     0     1
     1     1     1
*A is Less than B the comparison results in Logical 1 or 0
>> A<B

ans =

     0     1     1
     0     1     0
     0     0     0

*A is Lessthan and Equal to B the comparison results in Logical 1 or 0
>> A<=B

ans =

     1     1     1
     0     1     0
     0     0     0

*A is Greterthan and Equal to B the comparison results in Logical 1 or 0
>> A>=B

ans =

     1     0     0
     1     0     1
     1     1     1

*A is Not Equal to B the comparison results in Logical 1 or 0
>> A~=B

ans =

     0     1     1
     1     1     1
     1     1     1