Originally Posted by
deragon999 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?