Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Iterative Procedure Using Vectors
Replies: 2   Last Post: Apr 26, 2013 3:26 AM

 Messages: [ Previous | Next ]
 Laura Posts: 1 Registered: 4/25/13
Iterative Procedure Using Vectors
Posted: Apr 25, 2013 1:56 PM

I have been told to carry out the following iterative procedure:
a) Set a vector v to be the vector [1 ; 0]
b) Find a new vector u = Av (where A is a 2 x 2 real matrix)
c) Find the magnitude of this new vector u, and call this magnitude c
d) Divide u by c
e) Set v to be this unit vector, then repeat steps b) to e) a number of times.

So far I have tried:
v(1) = [1 ; 0]
for n = 1:100
u(n) = A*v(n+1)
c(n) = norm(u(n))
v(n+1) = u(n)/c(n)
end

However, it doesn't seem to like the v(1) part and keeps saying sub-matrix error, probably because it thinks that I am referring to the first element in the vector instead of saying v = [1 ; 0] is the initial condition. Does anyone know how I can do this?
Also I'm not sure if the rest of it works ...

Date Subject Author
4/25/13 Laura
4/25/13 Steven Lord
4/26/13 Nasser Abbasi