Matlab Types

graph TD
A{{Array}} --> B(Numeric)
    B --> B1(Float)
        B1 --> B11(Single)
        B1 --> B12(Double):::imp
    B --> B2(Integer)
        B2 --> B21(Signed)
            B21 --- B211(int8-bit)
            B211 --- B212(int16-bit)
            B212 --- B213(int32-bit)
            B213 --- B214(int64-bit)
        B2 --> B22(Unsigned)
            B22 --- B221(uint8-bit)
            B221 --- B222(uint16-bit)
            B222 --- B223(uint32-bit)
            B223 --- B224(uint64-bit)
A --> C(Text)
    C --> C1(Character):::imp
    C --> C2(String)
A --> D(Function Handle):::imp
A --> E(Heterogeneous Container)
    E --> E1(Cell):::imp
    E --> E2(Structure):::imp
A --> F(Logical):::imp

classDef imp stroke:#ff0000,stroke-width:4px;
  • The string type was introduced later; the difference from character can be roughly read from the names — see Matlab Characters and Strings
    • A character is analogous to a single value within a numeric array; each character occupies exactly 2 bytes
    • A string behaves more like a numeric array taken as a single value
  • Integer types come in signed and unsigned flavours; the former includes negative values, the latter does not
  • The trailing number indicates the bit width of the binary representation
    • For the same width, unsigned covers a larger non-negative range than signed, since one bit is reserved for the sign

Types Conversion

A