Results 1 to 2 of 2

Math Help - Matlab orth() function

  1. #1
    Junior Member
    Joined
    Apr 2008
    Posts
    72

    Matlab orth() function

    i have 3 column vectors each 4 numbers/rows high...
    to get an orthogonal basis for these in matlab i ahve to combine these into the matrix M and use orth(M) to solve it...my question:

    Do i use each vector as a row of the main matrix or do i use the top number of each vector as a row, then the 2nd to top number of each vector as the 2nd row etc..?

    I have done it with each vector as a row of the main matrix and the orth function is giving me a lot of decimals:

    >> s=[1,1,2,0;-1,2,1,0;1,0,0,1]

    s =

    1 1 2 0
    -1 2 1 0
    1 0 0 1

    >> orth(s)

    ans =

    -0.7071 0.5774 -0.4082
    -0.7071 -0.5774 0.4082
    -0.0000 0.5774 0.8165

    Have i done this correct and are the vectors for the basis the vertical columns or the rows of the ans?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by deragon999 View Post
    i have 3 column vectors each 4 numbers/rows high...
    to get an orthogonal basis for these in matlab i ahve to combine these into the matrix M and use orth(M) to solve it...my question:

    Do i use each vector as a row of the main matrix or do i use the top number of each vector as a row, then the 2nd to top number of each vector as the 2nd row etc..?

    I have done it with each vector as a row of the main matrix and the orth function is giving me a lot of decimals:

    >> s=[1,1,2,0;-1,2,1,0;1,0,0,1]

    s =

    1 1 2 0
    -1 2 1 0
    1 0 0 1

    >> orth(s)

    ans =

    -0.7071 0.5774 -0.4082
    -0.7071 -0.5774 0.4082
    -0.0000 0.5774 0.8165

    Have i done this correct and are the vectors for the basis the vertical columns or the rows of the ans?
    A basis of the space spanned by three 4-vectors will be a set of at most 3 4-vectors, you do not have 4-vectors therefore these do not span the space spanned by you three vectors.

    Also what does:

    Code:
    >>help orth
    tell you?

    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. need a matlab function
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 1st 2011, 10:52 PM
  2. Matlab function
    Posted in the Math Software Forum
    Replies: 2
    Last Post: April 17th 2010, 08:11 PM
  3. Please help with MATLAB function
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 16th 2010, 04:21 AM
  4. need help with matlab function
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 24th 2010, 09:47 AM
  5. MATLAB function help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 23rd 2010, 01:53 PM

Search Tags


/mathhelpforum @mathhelpforum