Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Array

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

array(data,8,8,8);
for i: 0 thru 7 do  for j: 0 thru 7 do    for k: 0 thru 7 do      (th: random(2.0) * %pi,       ph: (random(1.0) - 0.5) * %pi,       data[i,j,k]: [cos(th)*cos(ph),sin(th)*cos(ph),sin(ph)]);
data[0,0,0];

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

array-listarray

array (a1, fixnum,100);

listarray(a1);

Calculate

array-arrayinfo

array(a, 5, 1);

a [1,1] : 5;

arrayinfo(a);

Calculate

array-disp-do

array( E,1000);

array(F,1000);

E[0]:0;

Calculate

array-expand-plot2d
plot2d([[discrete, p],f(x)], [x,1,3.6], [style, points, lines],  [color, red, blue], [point_type, asterisk],  [legend, "data", "approximation"], [xlabel, "x"], [ylabel, "y"]);

p:[[1.3,0.25],[1.15,3...

n:6;

array (d, n, n);

Calculate

array

array(S_alfa, 3, 3);

S_alfa;

Calculate

array-expand-plot2d
plot2d([[discrete, p],f(x)], [x,1.0,3.6], [style, points, lines],  [color, red, blue], [point_type, asterisk],  [legend, "data", "approximation"], [xlabel, "x"], [ylabel, "y"]);

p:[[1.14,2.5],[1.52,2...

n:6;

array (d, n, n);

Calculate

array-cos-do-load

load(fft);

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

array(ra, float, 31);

Calculate

array-block-float-listarray-plot2d-print-random
plot2d([[discrete, listarray(Lx), listarray(Ly)],f], [x,0,n], [y,0,1.2]);

n : 1000;

array(Lx, flonum, n) ;

array(Ly, flonum, n) ;

Calculate