Question: How can I create a Vector using symbolic name for the entries and then modify the entries using the symbolic name?

I have the following example.

> A:= Vector(3,symbol=v)

A:= Vector(3,symbol=v)

>v[1]:= 5


> A



Is there any way such that v[1] is actually referring to the first element in the vector? In other words, changing v[1] actually modifies the vector A.


If the question does not make sense, then here is the actual scenario that I faced.

I need to solve a system of equations in the form of 

2 = c[2] + a[1],
2 = 2*c[3] + a[2],
-2 = -3*c[1] + a[3],
-1 = -2*c[2] + a[1],
-1 = -c[3] + a[2],
1 = a[3]

where a[i], c[i] refers to the entries in the vector.

solve returns the following:

[[a[1] = 1, a[2] = 0, a[3] = 1, c[1] = 1, c[2] = 1, c[3] = 1]]

I then did an assign(%). However, the entries in A and C are not changed. I want the answer returned by solve to be properly applied to the entries of the vectors.

Please Wait...