The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: Iterative Procedure Using Vectors
Posted: Apr 25, 2013 2:30 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Laura " <> wrote in message
> 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]

You can't fit the two elements of [1; 0] into the one element of v(1). It's
too big. If you wanted to store that in the first column of v, that would

v(:, 1) = [1; 0]

> for n = 1:100
> u(n) = A*v(n+1)

See above plus you'll want to change all your indexing to refer to columns
of the matrix rather than individual elements.

Also pay close attention to whether you want elementwise or vector division.

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.