oct2dec

Convert octal to decimal numbers

Syntax

```d = oct2dec(c) ```

Description

`d = oct2dec(c)` converts an octal matrix `c` to a decimal matrix `d`, element by element. In both octal and decimal representations, the rightmost digit is the least significant.

Examples

collapse all

Convert a 2-by-2 octal matrix its decimal equivalent.

`d = oct2dec([12 144;0 25])`
```d = 2×2 10 100 0 21 ```

The octal number 144 is equivalent to 100 because $144=1\left({8}^{2}\right)+4\left({8}^{1}\right)+4\left({8}^{0}\right)=100$.

Extended Capabilities

C/C++ Code GenerationGenerate C and C++ code using MATLAB® Coder™.

Introduced before R2006a