Operator

 

| HOME |

Using operators makes an expression more easy to read, and look more like a general  mathematic expression that you wrote down on paper.  Noodbeed has an extensive set of operator that work over several classes, such as double number, integer number, Matrix, and Image. 

For an image object, in which spatial information is stored as part of the object, operation is done by taking into account the spatial information.  Therefore results of operation between matrices "A" and "B" does not necessarily equal to that of Images "a" and "b", whose matrices' size and content are exactly the same as matrices "A" and "B".  This is due to an image is supposed to have a spatial location on earth, and only those image content in the same spatial area are eligible in the operation.  All of these are taken care automatically by Noobeed.

Noobeed has put a lot of effort in data type casting, so that you can always feel comfortable to mix different types of arguments in your expression.

The following are list of all available operators.

Operator Function Used for
+ addition String, number, complex, Matrix, Image
- subtraction number, complex, Matrix, Image
* multiplication number, complex, Matrix, Image
/ division  number, complex, Matrix, Image
^ exponentiation number, complex, Matrix, Image
% remainder/modulus  number only
< less than number, complex, Matrix, Image
<= less than or equal to number, complex, Matrix, Image
> greater than number, complex, Matrix, Image
>= greater than or equal to number, complex, Matrix, Image
== equal to number, complex, Matrix, Image
<> not equal to number, complex, Matrix, Image
! not number, complex, Matrix, Image
& and number, complex, Matrix, Image
| or number, complex, Matrix, Image

 

Matrix operator

binary operator

Argument 1 Operator Argument 2 Return
Matrix + number Matrix
Matrix - number Matrix
Matrix * number Matrix
Matrix / number Matrix
Matrix ^ number Matrix
Matrix < number Matrix_bln
Matrix <= number Matrix_bln
Matrix > number Matrix_bln
Matrix >= number Matrix_bln
Matrix == number Matrix_bln
Matrix <> number Matrix_bln
number + Matrix Matrix
number - Matrix Matrix
number * Matrix Matrix
number / Matrix Matrix
number ^ Matrix Matrix
number < Matrix Matrix_bln
number <= Matrix Matrix_bln
number > Matrix Matrix_bln
number >= Matrix Matrix_bln
number == Matrix Matrix_bln
number <> Matrix Matrix_bln
Matrix + Matrix Matrix
Matrix - Matrix Matrix
Matrix * Matrix Matrix
Matrix / Matrix Matrix
Matrix ^ Matrix Matrix
Matrix < Matrix Matrix_bln
Matrix <= Matrix Matrix_bln
Matrix > Matrix Matrix_bln
Matrix >= Matrix Matrix_bln
Matrix == Matrix Matrix_bln
Matrix <> Matrix Matrix_bln
Matrix & Matrix Matrix_bln
Matrix | Matrix Matrix_bln

 

unary operator

Operator Argument 1 Return
! Matrix Matrix_bln
+ Matrix Matrix
- Matrix Matrix

Example:

->a = [ 1 2 3; 4 5 6]
->a

ans =

  no of row    : 2
  no of column : 3

  0:    1.00000    2.00000    3.00000
  1:    4.00000    5.00000    6.00000


->a<=2

ans =

  no of row    : 2
  no of column : 3

  0:    1      1      0
  1:    0      0      0



->v = find(!(a<=2))
->v

ans =
Vector of Index (row, column)...

list id : 0

Vector size : 4

(0 , 2)
(1 , 0)
(1 , 1)
(1 , 2)


->

 

Image operator

binary operator

Argument 1 Operator Argument 2 Return
Image + number Image
Image - number Image
Image * number Image
Image / number Image
Image ^ number Image
Image < number Image_bln
Image <= number Image_bln
Image > number Image_bln
Image >= number Image_bln
Image == number Image_bln
Image <> number Image_bln
number + Image Image
number - Image Image
number * Image Image
number / Image Image
number ^ Image Image
number < Image Image_bln
number <= Image Image_bln
number > Image Image_bln
number >= Image Image_bln
number == Image Image_bln
number <> Image Image_bln
Image + Image Image
Image - Image Image
Image * Image Image
Image / Image Image
Image ^ Image Image
Image < Image Image_bln
Image <= Image Image_bln
Image > Image Image_bln
Image >= Image Image_bln
Image == Image Image_bln
Image <> Image Image_bln
Image & Image Image_bln
Image | Image Image_bln

 

unary operator

Operator Argument 1 Return
! Matrix Matrix_bln
+ Matrix Matrix
- Matrix Matrix

Example:

->a = Image(2,3)

->a.matrix() = [ 1 2 3; 4 5 6]

->a.matrix()

ans =

    no of row     : 2

    no of column  : 3

   0:              1.000       2.000      3.000

   1:              4.000       5.000      6.000

->v = find(!(a>2))

->v

->ans = 

Vector of Pt2D...

list id : 0

Vector size : 2

(0.500 , 1.500)

(1.500 , 1.500)

->

 


| HOME |