Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### Array

Function: array (<name>, <dim_1>, ..., <dim_n>) Function: array (<name>, <type>, <dim_1>, ..., <dim_n>)

Function: array ([<name_1>, ..., <name_m>], <dim_1>, ..., <dim_n>) Creates an n-dimensional array. n may be less than or equal to 5. The subscripts for the ith dimension are the integers running from 0 to <dim_i>.

`array (<name>, <dim_1>, ..., <dim_n>)` creates a general array.

`array (<name>, <type>, <dim_1>, ..., <dim_n>)` creates an array, with elements of a specified type. <type> can be `fixnum` for integers of limited size or `flonum` for floating-point numbers.

`array ([<name_1>, ..., <name_m>], <dim_1>, ..., <dim_n>)` creates m arrays, all of the same dimensions.

If the user assigns to a subscripted variable before declaring the corresponding array, an undeclared array is created. Undeclared arrays, otherwise known as hashed arrays (because hash coding is done on the subscripts), are more general than declared arrays. The user does not declare their maximum size, and they grow dynamically by hashing as more elements are assigned values. The subscripts of undeclared arrays need not even be numbers. However, unless an array is rather sparse, it is probably more efficient to declare it when possible than to leave it undeclared. The `array` function can be used to transform an undeclared array into a declared array.

There are also some inexact matches for `array`. Try `?? array` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

y(t):=cos(2*%pi*0.1*t);

array(ra, float, 31);

Calculate

##### array-listarray

array (ans,1,2);

ans[1,1] : vasemmalle;

ans[1,2] : oikealle;

Calculate

array(rs,5);

i:0;

f(x):=x^2;

Calculate

##### array-cos-random-sin

array(data,8,8,8);

for i: 0 thru 7 do f...

data[0,0,0];

Calculate

##### array-plot2d-signum-sum q(x):=(signum(x)+1)*0.5;

plot2d(q(x),[x,-5,5]);

U0:2;

Calculate

##### array

array (aa, 2, 3);

aa;

Calculate

##### array-listarray

array (x,6,3);

n:0;

for a:1 thru 3 do ...

Calculate

##### array-block-float-listarray-make_random_state-plot2d-print-set_random_state s1: make_random_state...

set_random_state (s1) ;

n : 100;

Calculate

##### array-sum

array(cs,4,4,4);

for i: 0 thru 3 do f...

Calculate

##### array-plot2d-signum-sum q(x):=(signum(x)+1)*0.5;

plot2d(q(x),[x,-5,5]);

U0:2;

Calculate 