Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Creating a vector of indexed variables

How can I create a vector like the following one

X=matrix(1, 8,(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7]))

with a loop like

X = list(var('x_%i' % i) for i in (0..7))
show(X)

but with an output $X = [x[1], ...x[8]]$ not $X = [x_1, \ldots, x_8]$. And is it possible to create such a list (vector) without loop ?