Wednesday, August 31, 2011

Octave - Matrix notation and the dot product of vectors

I am going to list some matrix applications in this post for myself (and whoever wishes to utilize this) so I can return to look up later if needed. This post concerns matrix notation and the dot product of vectors, A matrix in Octave is the same notation as in MATLAB:
A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
where commas separate columns on a row and the semicolon separates rows. In order to take the dot product between tow vectors we can do:
U = [ 1, 1, 1 

V = [-1, 4, 1]

dot(U, V)

ans =  4

No comments:

Post a Comment