Data types
In Nelson every value is an array, and a scalar is simply a 1x1 array. Numeric and logical types exist in any number of dimensions and in dense or sparse storage, and the floating-point types can be real or complex. The pages below describe each type with short examples.
Numeric
- double - the default type: 64-bit floating point, real or complex, dense or sparse, from scalars to N-dimensional arrays.
- single - 32-bit floating point, with the same array shapes.
- integer - signed and unsigned 8, 16, 32, and 64-bit integers, with saturating arithmetic.
- sparse -
a compact storage form for mostly-zero
doubleandlogicalmatrices that keeps only the non-zero entries. It is a storage attribute rather than a separate class, soclassstill reportsdoubleorlogical.
Logical
- logical -
trueandfalsevalues, dense or sparse, produced by comparisons and used to index and mask arrays.
Text
- character array - Unicode character arrays written in single quotes.
- string array - double-quoted string arrays, with per-element text
operations and a
<missing>value.
Containers
- cell array - containers that hold a value of any type and size in each element.
- structure - named fields grouped into a record, including structure arrays.
- dictionary - maps with typed keys and values.
- function handle -
a reference to a function, including anonymous functions such as
@(x) x.^2.
Tables and time series
- table - column-oriented data with named variables and mixed column types.
- timetable - a table whose rows are indexed by time.
- datetime - points in time.
- duration - elapsed time in fixed units such as seconds, minutes, and hours.
- calendarDuration - calendar spans such as months and days.
- categorical - labelled categories for discrete data.
Objects and graphics
- objects -
user-defined classes written with
classdef, with properties, methods, inheritance, and operator overloading (see also Overloading). - handle object - objects with reference semantics.
- graphics object - the figures, axes, and other handles that make up a plot.