commands → assign

assign(X,i)
assign(X,i,A)

The assign command allows you to assign to variables Xi generated by concatenation. That is, X is a variable, i is a non-negative integer, and we are assigning A to Xi. If two arguments are given then any assignment to the variable Xi is cleared.

Examples

# generate 5 variables and assign xi = i^2
for (i=0; i < 5; i=i+1) assign(x,i,i^2);
x0; x1; x2; x3; x4;
	0
	1
	4
	9
	16

# clear the assignments
for (i=0; i < 5; i=i+1) assign(x,i);
x0; x1; x2; x3; x4;
	x0
	x1
	x2
	x3
	x4