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.

a[1]:1;
a[n]:=(2-a[n-1])/(3-a[n-1]);
create_list(ratsimp(a[k]),k,1,20)

          (%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-sqrt

f(x):=sqrt(x);

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

create_list(y[i] :f(x...

Calculate

create_list-ratsimp

a[1]:1;

a[n]:=(2+2*a[n-1])/(1...

create_list(ratsimp(a...

Calculate

create_list-makelist-member-random

L:makelist(k^2,k,0,9);

member(81,L);

create_list(random(10...

Calculate

create_list-evenp-indices-makelist-sublist_indices

arr: makelist(ii,ii,1...

arr2: makelist(ii^2,i...

arr1: sublist_indices...

Calculate

create_list-sqrt

f(x):=sqrt(x);

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

create_list(y[i] :f(x...

Calculate

create_list-kill-sin

kill(all);

f(x):=sin(x);

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

Calculate

create_list-sort

sort(create_list((100...

Calculate

create_list

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

Calculate