Zurück zum Inhaltsverzeichnis

Kapitel 10

Tabellen

> restart:

> tab[eins]:=x1+y1;

tab[eins] := x1+y1

> tab[zwei]:=x2+y2;

tab[zwei] := x2+y2

> tab[eins];

x1+y1

> tab[eins]:=x1+y1+z1;

tab[eins] := x1+y1+z1

> tab;

tab

> eval(tab);

TABLE([zwei = x2+y2, eins = x1+y1+z1])

> tab[0.3]:=f(x):

> tab[1,2]:=nochEinEintrag:

> tab[x^2+y^2]:=1:

> tab[1][1]:=y: tab[1][2]:=y:

> eval(tab);

TABLE([1 = TABLE([1 = y, 2 = y]), .3 = x(x)^5-10*x(...
TABLE([1 = TABLE([1 = y, 2 = y]), .3 = x(x)^5-10*x(...
TABLE([1 = TABLE([1 = y, 2 = y]), .3 = x(x)^5-10*x(...
TABLE([1 = TABLE([1 = y, 2 = y]), .3 = x(x)^5-10*x(...

> table( [x,y]);

TABLE([1 = x, 2 = y])

> tab:=table(symmetric, [ (1,1)=1, (1,2)=2, (2,2)=3] ):

> tab[2,1];

2

> func:=table( [sin2=sin^2, cos2=cos^2]);

>

func := TABLE([cos2 = cos^2, sin2 = sin^2])

> func[sin2](x);

sin(x)^2

eval(plots)

> eval(plots);

TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...
TABLE([densityplot = readlib('`plots/densityplot`')...

>

Felder

> ar:=array([[a,b],[c,d]]);

ar := matrix([[a, b], [c, d]])

> ar[1,1]:=a^2;

ar[1,1] := a^2

> eval(ar);

matrix([[a^2, b], [c, d]])

> array(1..3,[1,2,3]);

vector([1, 2, 3])

> array(1..3,1..1,[[1],[2],[3]]);

matrix([[1], [2], [3]])

> map(sin,ar);

matrix([[sin(a^2), sin(b)], [sin(c), sin(d)]])

> ar:=array(sparse,-1..1,-1..1);

ar := array(sparse,-1 .. 1,-1 .. 1,[])

> eval(ar);

ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...
ARRAY(sparse,[-1 .. 1, -1 .. 1],[(-1, -1) = 0, (-1,...

Index Funktionen

> ar:=array(antisymmetric,1..3,1..3,1..3):

> ar[1,2,3]:=1: ar[2,3,1];

1

> eval(ar);

ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...
ARRAY(antisymmetric,[1 .. 3, 1 .. 3, 1 .. 3],[(1, 1...

> ar:=array(antisymmetric,1..3,1..3):

> ar[1,2]:=4: ar[3,1]:=5: ar[2,3]:=6:

> eval(ar);

matrix([[0, 4, -5], [-4, 0, 6], [5, -6, 0]])

Kopieren von table- und array-Objekten

> a:=array([[1,2],[3,4]]):

> b:=a: b[2,2]:=5:

> eval(a),eval(b);

matrix([[1, 2], [3, 5]]), matrix([[1, 2], [3, 5]])

> a:=array([[1,2],[3,4]]):

> b:=copy(a): b[2,2]:=5:

> eval(a),eval(b);

matrix([[1, 2], [3, 4]]), matrix([[1, 2], [3, 5]])

Umwandlungen

> test:=array([[1,2,3],[4,5,6],[7,8,9]]):

> data:=convert(test,listlist);

data := [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

> seq( op(data[i]), i=1..3);

1, 2, 3, 4, 5, 6, 7, 8, 9

> max(%);

9

>

Zurück zum Inhaltsverzeichnis