Results 1 to 4 of 4

Math Help - Urgent Matlab

  1. #1
    Junior Member
    Joined
    Apr 2008
    Posts
    72

    Urgent Matlab

    I think i may have posted this before but watever... I have 3 column vectors belonging to S, these vectors are: [1;1;2;0] [-1;2;1;0] and [1;0;0;1]

    I have been asked to find an orthogonal basis for S, I don't care if its not supposed to work..i just need to know how to write it into matlab to get some sort of answer.

    Thanks in advance for your help
    Deragon999
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Dec 2007
    Posts
    131
    There is a function orth(A) which returns the orthonormal basis for the given matrix A. You can fine what you want by writing your column vectors into one matrix and running the command on that:

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

    S =

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

    >> orth(S)

    ans =........

    ........*........-1170/1351........*
    -985/1393 .....390/1351..... 881/2158
    -985/1393 .....-390/1351 .....-881/2158
    ........ * ........-390/1351 .....881/1079

    >>

    the * means 0, since i had my matlab in format rat.

    orthonormal is just orthogonal with the added perk of being normalized.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Apr 2008
    Posts
    72

    R=Thanks

    Thats exactly what i thought i was supposed to get I just didn't understand the *S
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member
    Joined
    Dec 2007
    Posts
    131
    if you just change to format long or type just format alone and re-enter orth(S), you will get 0s instead of *s. i think the * is supposed to be some kind of underflow flag....but im not sure. glad i could help.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. matlab matrices code - urgent
    Posted in the Math Software Forum
    Replies: 0
    Last Post: November 22nd 2009, 10:00 AM
  2. Matlab help~~urgent
    Posted in the Math Software Forum
    Replies: 3
    Last Post: November 10th 2009, 04:47 PM
  3. URGENT: MATLAB quad function frustration
    Posted in the Math Software Forum
    Replies: 3
    Last Post: May 30th 2009, 11:27 PM
  4. MATLAB Iterative Methods: URGENT
    Posted in the Math Software Forum
    Replies: 1
    Last Post: October 15th 2008, 07:12 AM
  5. Replies: 2
    Last Post: September 28th 2008, 08:58 AM

Search Tags


/mathhelpforum @mathhelpforum