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:

Create_list Calculator

Create_list

Function: create_list (<form>, <x_1>, <list_1>, ..., <x_n>, <list_n>) Create a list by evaluating <form> with <x_1> bound to each element of <list_1>, and for each such binding bind <x_2> to each element of <list_2>, .... The number of elements in the result will be the product of the number of elements in each list. Each variable <x_i> must actually be a symbol - it will not be evaluated. The list arguments will be evaluated once at the beginning of the iteration.

M:matrix([1,2],[2,3],[3,4],[4,1],[5,2]);
load(lsquares);
L:lsquares_estimates(M,[x,y],y=k*x+b,[k,b]);
y(x):=ev(k*x+b,L);
float(y(2));
p:create_list(M[i],i,1,length(M));
plot2d([[discrete,p],y(x)],[x,1,5],[style,points,lines],[point_type,asterisk]);

          (%i1) create_list(x^i,i,[1,3,7]);
                           3   7
          (%o1)       [x, x , x ]

With a double iteration:

          (%i1) create_list([i,j],i,[a,b],j,[e,f,h]);
          (%o1) [[a, e], [a, f], [a, h], [b, e], [b, f], [b, h]]

Instead of <list_i> two args may be supplied each of which should evaluate to a number. These will be the inclusive lower and upper bounds for the iteration.

          (%i1) create_list([i,j],i,[1,2,3],j,1,i);
          (%o1) [[1, 1], [2, 1], [2, 2], [3, 1], [3, 2], [3, 3]]

Note that the limits or list for the j variable can depend on the current value of i.

(%o1)                                true
(%i2) 

Create_list Example

Related Examples

create_list

create_list(2^i-1, i,...

Calculate

create_list-mod

f(x):=x^3+15*x^2+29*x+8;

p:[2,3,5,7,11,13,17,1...

create_list([mod(m,p[...

Calculate

create_list-imagpart-realpart

create_list([realpart...

create_list([realpar...

Calculate

create_list-ev-float-length-load-matrix-plot2d
plot2d([[discrete,p],y(x)],[x,1,4],[style,points,lines],[point_type,asterisk]);

M:matrix([1,2],[2,4],...

load(lsquares);

L:lsquares_estimates(...

Calculate

create_list-kill-sin

kill(all);

f(x):=sin(x);

create_list(x[i] :-6+...

Calculate

create_list

? create_list;

Calculate

create_list

create_list(2^i-1, i,...

Calculate