cmatrix.Matrix.converter

Matrix.converter()

Convert the self matrix values into a string base converted values.

Parameters

Type

Description

mode

int

int value representing the function profile:
  • 0 => binary conversion

  • 1 => octal conversion

  • 2 => hexadecimal conversion

Examples

>>> mat=gaussian(3,0,0)
>>> mat.converter(0)
>>> Print(mat)
| 0b1        | | 0b10       | | 0b1        |
| 0b10       | | 0b100      | | 0b10       |
| 0b1        | | 0b10       | | 0b1        |
printed
>>> mat=gaussian(3,0,0)
>>> mat.converter(1)
>>> Print(mat)
| 0o1        | | 0o2        | | 0o1        |
| 0o2        | | 0o4        | | 0o2        |
| 0o1        | | 0o2        | | 0o1        |
printed
>>> mat=gaussian(3,0,0)
>>> mat.converter(2)
>>> Print(mat)
| 0x1        | | 0x2        | | 0x1        |
| 0x2        | | 0x4        | | 0x2        |
| 0x1        | | 0x2        | | 0x1        |
printed