Difference between revisions of "Multidimensional array"
(Created page with "Category: Arrays Multidimensional arrays are arrays with two or more than dimensions. Because papers and computer screens are 2-dimensional, arrays with higher...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: Arrays]] | [[Category: Arrays]] | ||
− | [[Multidimensional array]]s are [[array]]s with two or more | + | [[Multidimensional array]]s are [[array]]s with two or more dimensions, i.e. tables with values for "rows", "columns" and possibly for additional "axes" or "coordinates". |
− | Because papers and computer screens are 2-dimensional, arrays with higher number of dimensions are hard to | + | 3-dimensional arrays can be used to give positions of things in a 3-dimensional space (length, width, height), 4-dimensional arrays for positions in space-time (length, width, height, time), etc. |
+ | |||
+ | Because papers and computer screens are 2-dimensional, arrays with higher number of dimensions are hard to visualize. The following 3-dimensional array <code>A</code> indexed by three indexes, <code>Index_a</code>, <code>Index_b</code> and <code>Index_c</code>, serves as an example of a simple multi-dimensional array: | ||
:<code>Variable A :=</code> | :<code>Variable A :=</code> | ||
Line 177: | Line 179: | ||
==See Also== | ==See Also== | ||
+ | * [[Tutorial: Arrays]] | ||
* [[Arrays and Indexes]] | * [[Arrays and Indexes]] | ||
* [[Array Function Example Variables]] | * [[Array Function Example Variables]] | ||
* [[Array-reducing functions]] | * [[Array-reducing functions]] | ||
− | *[[Relational tables and multiD arrays]] | + | * [[Relational tables and multiD arrays]] |
+ | * [[Array Manipulation Examples and Challenge Problems]] | ||
+ | * [[Implicit Dimensions]] |
Latest revision as of 22:42, 22 August 2016
Multidimensional arrays are arrays with two or more dimensions, i.e. tables with values for "rows", "columns" and possibly for additional "axes" or "coordinates".
3-dimensional arrays can be used to give positions of things in a 3-dimensional space (length, width, height), 4-dimensional arrays for positions in space-time (length, width, height, time), etc.
Because papers and computer screens are 2-dimensional, arrays with higher number of dimensions are hard to visualize. The following 3-dimensional array A
indexed by three indexes, Index_a
, Index_b
and Index_c
, serves as an example of a simple multi-dimensional array:
Variable A :=
Index_c = 'displayed value'
Index_b ▶ Index_a ▼ a b c x value value value y value value value z value value value
As another example of a 3D array, consider the array Colors
indexed by Number
, Letter
, and Hue
:
Variable Colors :=
Number ▶ Letter ▼ 1 2 3 A 45 19 92 B 13 21 81 C 12 43 47 Hue = 'Red'
Number ▶ Letter ▼ 1 2 3 A 34 25 45 B 11 62 19 C 84 45 53 Hue = 'Green'
Number ▶ Letter ▼ 1 2 3 A 21 65 95 B 48 33 12 C 57 56 23 Hue = 'Blue'
Compare these multi-dimensional arrays to the following arrays with fewer dimensions:
An index or list and its values:
Index N :=
1 2 3 4 5
A one-dimensional array:
Variable Squares :=
Squares ▶ 1 2 3 4 5 1 4 9 16 25
A two-dimensional array:
Index_b ▶ Index_a ▼ a b c x value value value y value value value z value value value
See Also
Enable comment auto-refresher