Difference between revisions of "Multidimensional array"

Line 177: Line 177:
  
 
==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]]

Revision as of 22:00, 22 August 2016


Multidimensional arrays are arrays with two or more than dimensions.

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

Comments


You are not allowed to post comments.